diff options
| author | ObserverOfTime <chronobserver@disroot.org> | 2023-09-17 12:41:06 +0300 |
|---|---|---|
| committer | ObserverOfTime <chronobserver@disroot.org> | 2023-09-18 11:38:56 +0300 |
| commit | c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd (patch) | |
| tree | a98445ba839ef0bbc751aaf31f0a85ab6c20440f /queries | |
| parent | Update parsers: agda, wing (diff) | |
| download | nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar.gz nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar.bz2 nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar.lz nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar.xz nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.tar.zst nvim-treesitter-c0f4363b72ec4f3ca2e4ce5fcd81aa67925379fd.zip | |
feat: add ssh config
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/ssh_config/folds.scm | 4 | ||||
| -rw-r--r-- | queries/ssh_config/highlights.scm | 81 | ||||
| -rw-r--r-- | queries/ssh_config/indents.scm | 7 | ||||
| -rw-r--r-- | queries/ssh_config/injections.scm | 17 |
4 files changed, 109 insertions, 0 deletions
diff --git a/queries/ssh_config/folds.scm b/queries/ssh_config/folds.scm new file mode 100644 index 000000000..659835657 --- /dev/null +++ b/queries/ssh_config/folds.scm @@ -0,0 +1,4 @@ +[ + (host_declaration) + (match_declaration) +] @fold diff --git a/queries/ssh_config/highlights.scm b/queries/ssh_config/highlights.scm new file mode 100644 index 000000000..d6b060f56 --- /dev/null +++ b/queries/ssh_config/highlights.scm @@ -0,0 +1,81 @@ +; Literals + +(string) @string + +(pattern) @string.regex + +(token) @character + +[ + (number) + (bytes) + (time) +] @number + +[ + (kex) + (mac) + (cipher) + (key_sig) +] @parameter + +[ + ; generic + "yes" "no" + "ask" "auto" + "none" "any" + ; ControlMaster + "autoask" + ; FingerprintHash + "md5" "sha256" + ; PubkeyAuthentication + "unbound" "host-bound" + ; RequestTTY + "force" + ; SessionType + "subsystem" "default" + ; StrictHostKeyChecking + "accept-new" "off" + ; Tunnel + "point-to-point" "ethernet" + (ipqos) + (verbosity) + (facility) + (authentication) +] @constant.builtin + +(uri) @text.uri + +; Keywords + +[ "Host" "Match" ] @keyword + +(parameter keyword: _ @keyword) + +(host_declaration argument: _ @namespace) + +(match_declaration + (condition criteria: _ @attribute)) + +"all" @attribute + +; Misc + +[ + "SSH_AUTH_SOCK" + (variable) +] @constant + +(comment) @comment @spell + +(ERROR) @error + +; Punctuation + +[ "${" "}" ] @punctuation.special + +[ "\"" "," ":" "@" ] @punctuation.delimiter + +[ "=" "!" "+" "-" "^" ] @operator + +[ "*" "?" ] @character.special diff --git a/queries/ssh_config/indents.scm b/queries/ssh_config/indents.scm new file mode 100644 index 000000000..0dd1eb6ca --- /dev/null +++ b/queries/ssh_config/indents.scm @@ -0,0 +1,7 @@ +[ + (host_declaration) + (match_declaration) +] @indent.begin + +; incomplete declarations +(ERROR . [ "Host" "Match" ]) @indent.begin diff --git a/queries/ssh_config/injections.scm b/queries/ssh_config/injections.scm new file mode 100644 index 000000000..b71988471 --- /dev/null +++ b/queries/ssh_config/injections.scm @@ -0,0 +1,17 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((condition + criteria: "exec" + argument: (string) @injection.content) + (#set! injection.language "bash")) + +((parameter + keyword: [ + "KnownHostsCommand" + "LocalCommand" + "RemoteCommand" + "ProxyCommand" + ] + argument: (string) @injection.content) + (#set! injection.language "bash")) |
