diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /queries/vim | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2 nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip | |
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'queries/vim')
| -rw-r--r-- | queries/vim/folds.scm | 4 | ||||
| -rw-r--r-- | queries/vim/highlights.scm | 354 | ||||
| -rw-r--r-- | queries/vim/injections.scm | 44 | ||||
| -rw-r--r-- | queries/vim/locals.scm | 19 |
4 files changed, 0 insertions, 421 deletions
diff --git a/queries/vim/folds.scm b/queries/vim/folds.scm deleted file mode 100644 index 0a1fb695f..000000000 --- a/queries/vim/folds.scm +++ /dev/null @@ -1,4 +0,0 @@ -[ - (if_statement) - (function_definition) -] @fold diff --git a/queries/vim/highlights.scm b/queries/vim/highlights.scm deleted file mode 100644 index df7b3cf48..000000000 --- a/queries/vim/highlights.scm +++ /dev/null @@ -1,354 +0,0 @@ -(identifier) @variable - -((identifier) @constant - (#lua-match? @constant "^[A-Z][A-Z_0-9]*$")) - -; Keywords -[ - "if" - "else" - "elseif" - "endif" -] @keyword.conditional - -[ - "try" - "catch" - "finally" - "endtry" - "throw" -] @keyword.exception - -[ - "for" - "endfor" - "in" - "while" - "endwhile" - "break" - "continue" -] @keyword.repeat - -[ - "function" - "endfunction" -] @keyword.function - -; Function related -(function_declaration - name: (_) @function) - -(call_expression - function: (identifier) @function.call) - -(call_expression - function: (scoped_identifier - (identifier) @function.call)) - -(parameters - (identifier) @variable.parameter) - -(default_parameter - (identifier) @variable.parameter) - -[ - (bang) - (spread) -] @punctuation.special - -[ - (no_option) - (inv_option) - (default_option) - (option_name) -] @variable.builtin - -[ - (scope) - "a:" - "$" -] @module - -; Commands and user defined commands -[ - "let" - "unlet" - "const" - "call" - "execute" - "normal" - "set" - "setfiletype" - "setlocal" - "silent" - "echo" - "echon" - "echohl" - "echomsg" - "echoerr" - "autocmd" - "augroup" - "return" - "syntax" - "filetype" - "source" - "lua" - "ruby" - "perl" - "python" - "highlight" - "command" - "delcommand" - "comclear" - "colorscheme" - "scriptencoding" - "startinsert" - "stopinsert" - "global" - "runtime" - "wincmd" - "cnext" - "cprevious" - "cNext" - "vertical" - "leftabove" - "aboveleft" - "rightbelow" - "belowright" - "topleft" - "botright" - (unknown_command_name) - "edit" - "enew" - "find" - "ex" - "visual" - "view" - "eval" - "sign" - "abort" -] @keyword - -(map_statement - cmd: _ @keyword) - -(keycode) @character.special - -(command_name) @function.macro - -; Filetype command -(filetype_statement - [ - "detect" - "plugin" - "indent" - "on" - "off" - ] @keyword) - -; Syntax command -(syntax_statement - (keyword) @string) - -(syntax_statement - [ - "enable" - "on" - "off" - "reset" - "case" - "spell" - "foldlevel" - "iskeyword" - "keyword" - "match" - "cluster" - "region" - "clear" - "include" - ] @keyword) - -(syntax_argument - name: _ @keyword) - -[ - "<buffer>" - "<nowait>" - "<silent>" - "<script>" - "<expr>" - "<unique>" -] @constant.builtin - -(augroup_name) @module - -(au_event) @constant - -(normal_statement - (commands) @constant) - -; Highlight command -(hl_attribute - key: _ @property - val: _ @constant) - -(hl_group) @type - -(highlight_statement - [ - "default" - "link" - "clear" - ] @keyword) - -; Command command -(command) @string - -(command_attribute - name: _ @property - val: (behavior - name: _ @constant - val: (identifier)? @function)?) - -; Edit command -(plus_plus_opt - val: _? @constant) @property - -(plus_cmd - "+" @property) @property - -; Runtime command -(runtime_statement - (where) @keyword.operator) - -; Colorscheme command -(colorscheme_statement - (name) @string) - -; Scriptencoding command -(scriptencoding_statement - (encoding) @string.special) - -; Literals -(string_literal) @string - -(integer_literal) @number - -(float_literal) @number.float - -(comment) @comment @spell - -(line_continuation_comment) @comment @spell - -(pattern) @string.special - -(pattern_multi) @string.regexp - -(filename) @string.special.path - -(heredoc - (body) @string) - -(heredoc - (parameter) @keyword) - -[ - (marker_definition) - (endmarker) -] @label - -(literal_dictionary - (literal_key) @property) - -((scoped_identifier - (scope) @_scope - . - (identifier) @boolean) - (#eq? @_scope "v:") - (#any-of? @boolean "true" "false")) - -; Operators -[ - "||" - "&&" - "&" - "+" - "-" - "*" - "/" - "%" - ".." - "==" - "!=" - ">" - ">=" - "<" - "<=" - "=~" - "!~" - "=" - "^=" - "+=" - "-=" - "*=" - "/=" - "%=" - ".=" - "..=" - "<<" - "=<<" - "->" - (match_case) -] @operator - -[ - "is" - "isnot" -] @keyword.operator - -; Some characters have different meanings based on the context -(unary_operation - "!" @operator) - -(binary_operation - "." @operator) - -; Punctuation -[ - "(" - ")" - "{" - "}" - "[" - "]" - "#{" -] @punctuation.bracket - -(field_expression - "." @punctuation.delimiter) - -[ - "," - ":" -] @punctuation.delimiter - -(ternary_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -; Options -((set_value) @number - (#lua-match? @number "^[%d]+(%.[%d]+)?$")) - -(inv_option - "!" @operator) - -(set_item - "?" @operator) - -((set_item - option: (option_name) @_option - value: (set_value) @function) - (#any-of? @_option "tagfunc" "tfu" "completefunc" "cfu" "omnifunc" "ofu" "operatorfunc" "opfunc")) diff --git a/queries/vim/injections.scm b/queries/vim/injections.scm deleted file mode 100644 index 30d11cbb4..000000000 --- a/queries/vim/injections.scm +++ /dev/null @@ -1,44 +0,0 @@ -(lua_statement - (script - (body) @injection.content - (#set! injection.language "lua"))) - -(lua_statement - (chunk) @injection.content - (#set! injection.language "lua")) - -(ruby_statement - (script - (body) @injection.content - (#set! injection.language "ruby"))) - -(ruby_statement - (chunk) @injection.content - (#set! injection.language "ruby")) - -(python_statement - (script - (body) @injection.content - (#set! injection.language "python"))) - -(python_statement - (chunk) @injection.content - (#set! injection.language "python")) - -; If we support perl at some point... -; (perl_statement (script (body) @perl)) -; (perl_statement (chunk) @perl) -(autocmd_statement - (pattern) @injection.content - (#set! injection.language "regex")) - -((set_item - option: (option_name) @_option - value: (set_value) @injection.content) - (#any-of? @_option - "includeexpr" "inex" "printexpr" "pexpr" "formatexpr" "fex" "indentexpr" "inde" "foldtext" "fdt" - "foldexpr" "fde" "diffexpr" "dex" "patchexpr" "pex" "charconvert" "ccv") - (#set! injection.language "vim")) - -((comment) @injection.content - (#set! injection.language "comment")) diff --git a/queries/vim/locals.scm b/queries/vim/locals.scm deleted file mode 100644 index 870647279..000000000 --- a/queries/vim/locals.scm +++ /dev/null @@ -1,19 +0,0 @@ -[ - (script_file) - (function_definition) -] @local.scope - -(function_declaration - name: (identifier) @local.definition.function) - -(function_declaration - parameters: (parameters - (identifier) @local.definition.parameter)) - -(let_statement - [ - (scoped_identifier) - (identifier) - ] @local.definition.var) - -(identifier) @local.reference |
