├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── grammars └── fish.cson ├── package.json ├── settings └── language-fish-shell.cson └── snippets └── language-fish-shell.cson /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Once you've made your great commits: 4 | 5 | 1. [Fork][forking] the repository 6 | 2. Create a feature branch 7 | 3. Write your code (and tests please) 8 | 4. Push to your branch's origin 9 | 5. Create a [Pull Request][pull requests] from your branch 10 | 6. That's it! 11 | 12 | [forking]: http://help.github.com/forking/ 13 | [pull requests]: http://help.github.com/pull-requests/ 14 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 David Celis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # language-fish-shell package 2 | 3 | Atom snippets and syntax highlighting for Fish, the friendly interactive shell. Originally converted from [fish.tmBundle][fish-tm-bundle]. 4 | 5 | ![Screenshot](https://i.cloudup.com/jB340iQs7D-1200x1200.png) 6 | 7 | [fish-tm-bundle]: https://github.com/l15n/fish-tmbundle 8 | -------------------------------------------------------------------------------- /grammars/fish.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [ 2 | 'fish' 3 | ] 4 | 'firstLineMatch': '^#!.*(fish)' 5 | 'foldingStartMarker': '^\\s*(function|while|if|switch|for)\\s.*$' 6 | 'foldingStopMarker': '^\\s*end\\s*$' 7 | 'name': 'Shell Script (Fish)' 8 | 'patterns': [ 9 | { 10 | 'begin': '"' 11 | 'beginCaptures': 12 | '0': 13 | 'name': 'punctuation.definition.string.begin.fish' 14 | 'comment': 'Double quoted string' 15 | 'end': '"' 16 | 'endCaptures': 17 | '0': 18 | 'name': 'punctuation.definition.string.end.fish' 19 | 'name': 'string.quoted.double.fish' 20 | 'patterns': [ 21 | { 22 | 'match': '\\\\\\"|\\\\\\$|\\\\\\\\' 23 | 'name': 'constant.character.escape.fish' 24 | } 25 | { 26 | 'include': '#variable' 27 | } 28 | ] 29 | } 30 | { 31 | 'begin': '\'' 32 | 'beginCaptures': 33 | '0': 34 | 'name': 'punctuation.definition.string.begin.fish' 35 | 'comment': 'Single quoted string' 36 | 'end': '\'' 37 | 'endCaptures': 38 | '0': 39 | 'name': 'punctuation.definition.string.end.fish' 40 | 'name': 'string.quoted.single.fish' 41 | 'patterns': [ 42 | { 43 | 'match': '\\\\\'|\\\\\\\\' 44 | 'name': 'constant.character.escape.fish' 45 | } 46 | ] 47 | } 48 | { 49 | 'captures': 50 | '1': 51 | 'name': 'punctuation.definition.comment.fish' 52 | 'comment': 'Line comment' 53 | 'match': '(?|\\^|>>|\\^\\^)(&[012\\-])?| # Redirection of stdout/stderr\n\t\t\t[012](<|>|>>)(&[012\\-])? # Redirect input/output of file descriptors\n\t\t\t)' 72 | 'name': 'keyword.operator.redirect.fish' 73 | } 74 | { 75 | 'match': '&' 76 | 'name': 'keyword.operator.background.fish' 77 | } 78 | { 79 | 'match': '\\*\\*|\\*|\\?' 80 | 'name': 'keyword.operator.glob.fish' 81 | } 82 | { 83 | 'captures': 84 | '1': 85 | 'name': 'constant.other.option.fish' 86 | 'comment': 'Command short/long options' 87 | 'match': '\\s(-{1,2}[a-zA-Z_\\-0-9]+|-\\w)\\b' 88 | } 89 | { 90 | 'comment': 'Builtin shellscript functions' 91 | 'match': '(?x)\\b(\n\t\t\t_|__fish_append|__fish_bind_test1|__fish_bind_test2|__fish_commandline_test|\n\t\t\t__fish_complete_ant_targets|__fish_complete_bittorrent|__fish_complete_cd|\n\t\t\t__fish_complete_command|__fish_complete_directories|__fish_complete_file_url|\n\t\t\t__fish_complete_groups|__fish_complete_ls|__fish_complete_man|\n\t\t\t__fish_complete_mime|__fish_complete_pids|__fish_complete_ssh|\n\t\t\t__fish_complete_subcommand|__fish_complete_subcommand_root|\n\t\t\t__fish_complete_suffix|__fish_complete_tar|__fish_complete_tex|\n\t\t\t__fish_complete_unrar|__fish_complete_users|__fish_complete_vi|\n\t\t\t__fish_config_interactive|__fish_contains_opt|__fish_crux_packages|\n\t\t\t__fish_describe_command|__fish_filter_ant_targets|__fish_filter_mime|\n\t\t\t__fish_gnu_complete|__fish_is_first_token|__fish_list_current_token|\n\t\t\t__fish_move_last|__fish_no_arguments|__fish_not_contain_opt|__fish_paginate|\n\t\t\t__fish_ports_dirs|__fish_print_addresses|__fish_print_encodings|\n\t\t\t__fish_print_filesystems|__fish_print_function_prototypes|__fish_print_help|\n\t\t\t__fish_print_hostnames|__fish_print_interfaces|__fish_print_make_targets|\n\t\t\t__fish_print_packages|__fish_print_users|__fish_prt_no_subcommand|\n\t\t\t__fish_prt_packages|__fish_prt_ports|__fish_prt_use_package|\n\t\t\t__fish_prt_use_port|__fish_reload_key_bindings|__fish_repaint|\n\t\t\t__fish_repaint_root|__fish_seen_subcommand_from|__fish_test_arg|\n\t\t\t__fish_use_subcommand|__fish_winch_handler|alias|cd|delete-or-exit|dirh|\n\t\t\tdirs|down-or-search|eval|fish_default_key_bindings|fish_on_exit|\n\t\t\tfish_prompt|fish_right_prompt|fish_sigtrap_handler|funced|funcsave|grep|help|isatty|la|ll|\n\t\t\tls|math|N_|nextd|nextd-or-forward-word|open|popd|prevd|\n\t\t\tprevd-or-backward-word|prompt_pwd|psub|pushd|pwd|setenv|sgrep|trap|type|\n\t\t\tumask|up-or-search|vared\n\t\t\t)\\b' 92 | 'name': 'support.function.script.fish' 93 | } 94 | { 95 | 'comment': 'Builtin commands listed by builtin -n' 96 | 'match': '(?x)\\b(\n\t\t\t\\s\\.\\s|and|begin|bg|bind|block|break|breakpoint|builtin|case|cd|command|\n\t\t\tcommandline|complete|contains|continue|count|else|emit|end|exec|exit|\n\t\t\tfg|for|function|functions|if|jobs|not|or|random|read|return|set|\n\t\t\tsource|status|switch|ulimit|while\n\t\t\t)\\b' 97 | 'name': 'support.function.builtin.fish' 98 | } 99 | { 100 | 'comment': 'Standard UNIX utilities as specified in IEEE Std 1003.1 (2004 edition)' 101 | 'match': '(?x)\\b(\n\t\t\tadmin|alias|ar|asa|at|awk|basename|batch|bc|bg|break|c99|cal|cat|\n\t\t\tcd|cflow|chgrp|chmod|chown|cksum|cmp|colon|comm|command|compress|\n\t\t\tcontinue|cp|crontab|csplit|ctags|cut|cxref|date|dd|delta|df|diff|\n\t\t\tdirname|dot|du|echo|ed|env|eval|ex|exec|exit|expand|export|expr|\n\t\t\tfalse|fc|fg|file|find|fold|fort77|fuser|gencat|get|getconf|getopts|\n\t\t\tgrep|hash|head|iconv|id|ipcrm|ipcs|jobs|join|kill|lex|link|ln|\n\t\t\tlocale|localedef|logger|logname|lp|ls|m4|mailx|make|man|mesg|mkdir|\n\t\t\tmkfifo|more|mv|newgrp|nice|nl|nm|nohup|od|paste|patch|pathchk|pax|\n\t\t\tpr|printf|prs|ps|pwd|qalter|qdel|qhold|qmove|qmsg|qrerun|qrls|\n\t\t\tqselect|qsig|qstat|qsub|read|readonly|renice|return|rm|rmdel|rmdir|\n\t\t\tsact|sccs|sed|set|sh|shift|sleep|sort|split|strings|string|strip|stty|tabs|\n\t\t\ttail|talk|tee|test|time|times|touch|tput|tr|trap|true|tsort|tty|\n\t\t\ttype|ulimit|umask|unalias|uname|uncompress|unexpand|unget|uniq|unlink|\n\t\t\tunset|uucp|uudecode|uuencode|uustat|uux|val|vi|wait|wc|what|who|\n\t\t\twrite|xargs|yacc|zcat\n\t\t\t)\\b' 102 | 'name': 'support.function.unix.fish' 103 | } 104 | { 105 | 'include': '#variable' 106 | } 107 | { 108 | 'include': '#escape' 109 | } 110 | ] 111 | 'repository': 112 | 'escape': 113 | 'patterns': [ 114 | { 115 | 'comment': 'Single character character escape sequences' 116 | 'match': '\\\\(a|b|e|f|n|r|t|v|\\s|\\$|\\\\|\\*|\\?|~|\\%|#|\\(|\\)|{|}|\\[|\\]|<|>|\\^|\'|")' 117 | 'name': 'constant.character.escape.single.fish' 118 | } 119 | { 120 | 'comment': 'Escapes the ascii character with the specified value (hexadecimal)' 121 | 'match': '\\\\x[0-9a-fA-F]{2}' 122 | 'name': 'constant.character.escape.hex-ascii.fish' 123 | } 124 | { 125 | 'comment': 'Escapes a byte of data with the specified value (hexadecimal). \n\t\t\t\t\tIf you are using a mutibyte encoding, this can be used to enter invalid strings. \n\t\t\t\t\tOnly use this if you know what you are doing.' 126 | 'match': '\\\\X[0-9a-fA-F]{2}' 127 | 'name': 'constant.character.escape.hex-byte.fish' 128 | } 129 | { 130 | 'comment': 'Escapes the ascii character with the specified value (octal)' 131 | 'match': '\\\\[0-9]{3}' 132 | 'name': 'constant.character.escape.octal.fish' 133 | } 134 | { 135 | 'comment': 'Escapes the 16-bit unicode character with the specified value (hexadecimal)' 136 | 'match': '\\\\u[0-9a-fA-F]{4}' 137 | 'name': 'constant.character.escape.unicode-16-bit.fish' 138 | } 139 | { 140 | 'comment': 'Escapes the 32-bit unicode character with the specified value (hexadecimal)' 141 | 'match': '\\\\U[0-9a-fA-F]{8}' 142 | 'name': 'constant.character.escape.unicode-32-bit.fish' 143 | } 144 | { 145 | 'comment': 'Escapes the control sequence generated by pressing the control key and the specified letter' 146 | 'match': '\\\\c[a-zA-Z]' 147 | 'name': 'constant.character.escape.control.fish' 148 | } 149 | ] 150 | 'variable': 151 | 'patterns': [ 152 | { 153 | 'captures': 154 | '1': 155 | 'name': 'punctuation.definition.variable.fish' 156 | 'match': '(?x)(\\$)(BROWSER|CDPATH|fish_greeting|LANG|LC_ALL|LC_COLLATE|\n\t\t\t\t\t\t\t\t\tLC_CTYPE|LC_MESSAGES|LC_MONETARY|LC_NUMERIC|LC_TIME|PATH|\n\t\t\t\t\t\t\t\t\tumask|fish_color_command|fish_color_comment|fish_color_cwd|fish_color_cwd_root|\n\t\t\t\t\t\t\t\t\tfish_color_error|fish_color_escape|fish_color_history_current|\n\t\t\t\t\t\t\t\t\tfish_color_match|fish_color_normal|fish_color_operator|fish_color_quote|\n\t\t\t\t\t\t\t\t\tfish_color_redirection|fish_color_search_match|fish_color_valid_path|\n\t\t\t\t\t\t\t\t\tfish_complete_path|fish_function_path|fish_greeting|fish_key_bindings|\n\t\t\t\t\t\t\t\t\tfish_pager_color_completion|fish_pager_color_description|\n\t\t\t\t\t\t\t\t\tfish_pager_color_prefix|fish_pager_color_progress)' 157 | 'name': 'variable.other.special.fish' 158 | } 159 | { 160 | 'captures': 161 | '1': 162 | 'name': 'punctuation.definition.variable.fish' 163 | 'match': '(\\$)_{2,}(fish|FISH)[a-zA-Z_][a-zA-Z0-9_]*' 164 | 'name': 'variable.other.fish.fish' 165 | } 166 | { 167 | 'captures': 168 | '1': 169 | 'name': 'punctuation.definition.variable.fish' 170 | 'match': '(\\$)(_|argv|history|HOME|PWD|status|USER)' 171 | 'name': 'variable.other.fixed.fish' 172 | } 173 | { 174 | 'captures': 175 | '1': 176 | 'name': 'punctuation.definition.variable.fish' 177 | 'match': '(\\$)[a-zA-Z_][a-zA-Z0-9_]*' 178 | 'name': 'variable.other.normal.fish' 179 | } 180 | ] 181 | 'scopeName': 'source.fish' 182 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "language-fish-shell", 3 | "version": "1.1.0", 4 | "description": "Snippets and syntax highlighting for Fish, the friendly interactive shell.", 5 | "repository": "https://github.com/davidcelis/language-fish-shell", 6 | "license": "MIT", 7 | "engines": { 8 | "atom": ">1.10.0" 9 | }, 10 | "dependencies": {} 11 | } 12 | -------------------------------------------------------------------------------- /settings/language-fish-shell.cson: -------------------------------------------------------------------------------- 1 | '.source.fish': 2 | 'editor': 3 | 'commentStart': '# ' 4 | 'increaseIndentPattern': '^\\s*(function|begin|while|if|else|switch|for|case)' 5 | 'decreaseIndentPattern': '^\\s*(case|else|end)' 6 | -------------------------------------------------------------------------------- /snippets/language-fish-shell.cson: -------------------------------------------------------------------------------- 1 | '.source.fish': 2 | 'begin ... end': 3 | 'prefix': 'begin' 4 | 'body': 'begin\n\t$0\nend' 5 | 'case ...': 6 | 'prefix': 'case' 7 | 'body': 'case ${1:condition}\n\t$0' 8 | 'complete (old-style options)': 9 | 'prefix': 'com' 10 | 'body': 'complete -c ${1:command}${2: -n \'${3:condition}\'}${4: -s ${5:short_option}} ${6: -o ${7:oldstyle_long_option}}${8: -a ${9:OPTION_ARGUMENTS}}${10: --description \'${11:description}\'}\n$0' 11 | 'complete (option with argument)': 12 | 'prefix': 'com' 13 | 'body': 'complete -x -c ${1:command}${2: -n \'${3:condition}\'}${4: -s ${5:short_option}} ${6: -l ${7:long_option}}${8: -a ${9:OPTION_ARGUMENTS}}${10: --description \'${11:description}\'}\n$0' 14 | 'complete': 15 | 'prefix': 'com' 16 | 'body': 'complete -c ${1:command}${2: -n \'${3:condition}\'}${4: -s ${5:short_option}} ${6: -l ${7:long_option}}${8: -a ${9:OPTION_ARGUMENTS}}${10: --description \'${11:description}\'}\n$0' 17 | 'for ... in ... end': 18 | 'prefix': 'for' 19 | 'body': 'for ${1:element} in #{2:array}\n\t$0\nend' 20 | 'function (on job exit)': 21 | 'prefix': 'funj' 22 | 'body': 'function -j ${1:PID} ${2:event_handler_name}${3: -d "${4:description}"}\n\t$0\nend' 23 | 'function (on process exit)': 24 | 'prefix': 'funp' 25 | 'body': 'function -p ${1:PID} ${2:event_handler_name}${3: -d "${4:description}"}\n\t$0\t\nend' 26 | 'function (on signal)': 27 | 'prefix': 'funs' 28 | 'body': 'function -s ${1:SIGSPEC} ${2:event_handler_name}${3: -d "${4:description}"}\t$0\t\nend' 29 | 'function (on variable)': 30 | 'prefix': 'funv' 31 | 'body': 'function -v ${1:VARIABLE_NAME} ${2:event_handler_name}${3: -d "${4:description}"}\n\t$0\t\nend' 32 | 'function ... end': 33 | 'prefix': 'fun' 34 | 'body': 'function ${1:function_name}${2: -d "${3:description}"}\n\t$0\nend' 35 | 'if ... else ... end': 36 | 'prefix': 'if' 37 | 'body': 'if ${1:condition}\n\t$2\nelse\n\t$3\nend' 38 | 'if ... end': 39 | 'prefix': 'if' 40 | 'body': 'if ${1:condition}\n\t$0\nend' 41 | 'switch ... case ... end': 42 | 'prefix': 'sw' 43 | 'body': 'switch \\$${1:variable}\n\tcase ${2:condition}\n\t\t${0:commands}\nend' 44 | 'while ... end': 45 | 'prefix': 'while' 46 | 'body': 'while ${1:condition}\n\t$0\nend' 47 | --------------------------------------------------------------------------------