├── .editorconfig ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── grammars └── tmux.cson ├── package.json ├── settings └── language-tmux.cson └── spec └── tmux-spec.coffee /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | notifications: 4 | email: 5 | on_success: never 6 | on_failure: change 7 | 8 | script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh' 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.0 - First Release 2 | * Initial release 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Taylon Silmer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/tmux-plugins/language-tmux.svg?branch=master)](https://travis-ci.org/taylon/language-tmux) 2 | 3 | > [Atom](https://atom.io) language package for [Tmux](http://tmux.github.io/) config file 4 | 5 | ## Install 6 | 7 | ```bash 8 | $ apm install language-tmux 9 | ``` 10 | 11 | Or Settings ➔ Packages ➔ Search for `language-tmux` 12 | 13 | ## License 14 | 15 | MIT © [Taylon Silmer](https://github.com/taylon) 16 | -------------------------------------------------------------------------------- /grammars/tmux.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': [ 2 | '.tmux.conf' 3 | ] 4 | 'name': 'tmux' 5 | 'patterns': [ 6 | 7 | # Comments 8 | { 9 | 'match': '(#).*$\\n?' 10 | 'captures': 11 | '1': 12 | 'name': 'punctuation.definition.comment.tmux' 13 | 'name': 'comment.line.number-sign.tmux' 14 | } 15 | 16 | # Single quoted strings 17 | { 18 | 'begin': "'" 19 | 'beginCaptures': 20 | '0': 21 | 'name': 'punctuation.definition.string.begin.tmux' 22 | 'end': "'" 23 | 'endCaptures': 24 | '0': 25 | 'name': 'punctuation.definition.string.end.tmux' 26 | 'name': 'string.quoted.single.tmux' 27 | } 28 | 29 | # Double quoted strings 30 | { 31 | 'begin': '"' 32 | 'beginCaptures': 33 | '0': 34 | 'name': 'punctuation.definition.string.begin.tmux' 35 | 'end': '"' 36 | 'endCaptures': 37 | '0': 38 | 'name': 'punctuation.definition.string.end.tmux' 39 | 'name': 'string.quoted.double.tmux' 40 | } 41 | 42 | # Switches 43 | { 44 | 'match': '\\b(on|off)\\b' 45 | 'name': 'constant.language.tmux' 46 | } 47 | 48 | # Options 49 | { 50 | 'match': '\\b(attach-session|bind-key|break-pane|capture-pane|choose-buffer|choose-client|choose-list|choose-session|choose-tree|choose-window|clear-history|clock-mode|command-prompt|confirm-before|copy-mode|delete-buffer|detach-client|display-message|display-panes|find-window|has-session|if-shell|join-pane|kill-pane|kill-server|kill-session|kill-window|last-pane|last-window|link-window|list-buffers|list-clients|list-commands|list-keys|list-panes|list-sessions|list-windows|load-buffer|lock-client|lock-server|lock-session|move-pane|move-window|new-session|new-window|next-layout|next-window|paste-buffer|pipe-pane|previous-layout|previous-window|refresh-client|rename-session|rename-window|resize-pane|respawn-pane|respawn-window|rotate-window|run-shell|save-buffer|select-layout|select-pane|select-window|send-keys|send-prefix|server-info|set-buffer|set-environment|set-option|set-window-option|show-buffer|show-environment|show-messages|show-options|show-window-options|source-file|split-window|start-server|suspend-client|swap-pane|swap-window|switch-client|unbind-key|unlink-window)\\b' 51 | 'name': 'support.function.tmux' 52 | } 53 | 54 | { 55 | 'match': '\\b(buffer-limit|escape-time|exit-unattached|quiet|set-clipboard|base-index|bell-action|bell-on-alert|default-command|default-path|default-shell|default-terminal|destroy-unattached|detach-on-destroy|display-panes-active-colour|display-panes-colour|display-panes-time|display-time|history-limit|lock-after-time|lock-command|lock-server|message-attr|message-bg|message-command-attr|message-command-bg|message-command-fg|message-fg|message-limit|mouse-resize-pane|mouse-select-pane|mouse-select-window|mouse-utf8|pane-active-border-bg|pane-active-border-fg|pane-border-bg|pane-border-fg|prefix|prefix2|renumber-windows|repeat-time|set-remain-on-exit|set-titles|set-titles-string|status-attr|status-bg|status-fg|status-interval|status-justify|status-keys|status-left|status-left-attr|status-left-bg|status-left-fg|status-left-length|status-position|status-right|status-right-attr|status-right-bg|status-right-fg|status-right-length|status-utf8|status|terminal-overrides|update-environment|visual-activity|visual-bell|visual-content|visual-silence|word-separators)\\b' 56 | 'name': 'support.constant.tmux' 57 | } 58 | 59 | { 60 | 'match': '\\b(aggressive-resize|allow-rename|alternate-screen|automatic-rename|c0-change-trigger|c0-change-interval|clock-mode-colour|clock-mode-style|force-height|force-width|layout-history-limit|main-pane-height|main-pane-width|mode-attr|mode-bg|mode-fg|mode-keys|mode-mouse|monitor-activity|monitor-content|monitor-silence|other-pane-height|other-pane-width|pane-base-index|remain-on-exit|synchronize-panes|utf8|window-status-activity-attr|window-status-activity-bg|window-status-activity-fg|window-status-bell-attr|window-status-bell-bg|window-status-bell-fg|window-status-content-attr|window-status-content-bg|window-status-content-fg|window-status-attr|window-status-bg|window-status-current-attr|window-status-current-bg|window-status-current-fg|window-status-current-format|window-status-fg|window-status-format|window-status-separator|wrap-search|xterm-keys)\\b' 61 | 'name': 'entity.name.tag.tmux' 62 | } 63 | 64 | # Functions 65 | { 66 | 'match': '\\b(unbind|bind|setw|set)\\b' 67 | 'name': 'support.function.tmux' 68 | } 69 | 70 | ] 71 | 72 | 'scopeName': 'source.tmux' 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "language-tmux", 3 | "version": "0.4.0", 4 | "description": "Atom language support for Tmux", 5 | "repository": "https://github.com/tmux-plugins/language-tmux", 6 | "license": "MIT", 7 | "engines": { 8 | "atom": ">=0.174.0 <2.0.0" 9 | }, 10 | "keywords": [ 11 | "shell", 12 | "tmux", 13 | "language", 14 | "terminal" 15 | ], 16 | "author": "Taylon Silmer (https://github.com/taylon)", 17 | "dependencies": {} 18 | } 19 | -------------------------------------------------------------------------------- /settings/language-tmux.cson: -------------------------------------------------------------------------------- 1 | '.source.tmux': 2 | 'editor': 3 | 'commentStart': '# ' 4 | -------------------------------------------------------------------------------- /spec/tmux-spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'Tmux grammar', -> 2 | grammar = null 3 | 4 | beforeEach -> 5 | waitsForPromise -> 6 | atom.packages.activatePackage('language-tmux') 7 | 8 | runs -> 9 | grammar = atom.grammars.grammarForScopeName('source.tmux') 10 | 11 | it 'parses the grammar', -> 12 | expect(grammar).toBeTruthy() 13 | expect(grammar.scopeName).toBe 'source.tmux' 14 | 15 | it 'parses comments', -> 16 | {tokens} = grammar.tokenizeLine('# My comment') 17 | 18 | expect(tokens[0]).toEqual value: '#', scopes: ['source.tmux', 'comment.line.number-sign.tmux', 'punctuation.definition.comment.tmux'] 19 | expect(tokens[1]).toEqual value: ' My comment', scopes: ['source.tmux', 'comment.line.number-sign.tmux'] 20 | 21 | it 'parses both single and double quoted strings', -> 22 | {tokens} = grammar.tokenizeLine("'My single quoted string'") 23 | 24 | expect(tokens[0]).toEqual value: "'", scopes: ['source.tmux', 'string.quoted.single.tmux', 'punctuation.definition.string.begin.tmux'] 25 | expect(tokens[1]).toEqual value: 'My single quoted string', scopes: ['source.tmux', 'string.quoted.single.tmux'] 26 | expect(tokens[2]).toEqual value: "'", scopes: ['source.tmux', 'string.quoted.single.tmux', 'punctuation.definition.string.end.tmux'] 27 | 28 | {tokens} = grammar.tokenizeLine('"My double quoted string"') 29 | 30 | expect(tokens[0]).toEqual value: '"', scopes: ['source.tmux', 'string.quoted.double.tmux', 'punctuation.definition.string.begin.tmux'] 31 | expect(tokens[1]).toEqual value: 'My double quoted string', scopes: ['source.tmux', 'string.quoted.double.tmux'] 32 | expect(tokens[2]).toEqual value: '"', scopes: ['source.tmux', 'string.quoted.double.tmux', 'punctuation.definition.string.end.tmux'] 33 | 34 | it 'parses switches', -> 35 | {tokens} = grammar.tokenizeLine('set -g mouse-select-pane on') 36 | 37 | expect(tokens[4]).toEqual value: 'on', scopes: ['source.tmux', 'constant.language.tmux'] 38 | 39 | it 'parses options', -> 40 | {tokens} = grammar.tokenizeLine('set -g status-justify centre') 41 | expect(tokens[2]).toEqual value: 'status-justify', scopes: ['source.tmux', 'support.constant.tmux'] 42 | 43 | {tokens} = grammar.tokenizeLine('setw -g mode-mouse on') 44 | expect(tokens[2]).toEqual value: 'mode-mouse', scopes: ['source.tmux', 'entity.name.tag.tmux'] 45 | 46 | {tokens} = grammar.tokenizeLine('bind - split-window -v') 47 | expect(tokens[2]).toEqual value: 'split-window', scopes: ['source.tmux', 'support.function.tmux'] 48 | 49 | it 'parses functions', -> 50 | {tokens} = grammar.tokenizeLine('setw -g pane-base-index 1') 51 | expect(tokens[0]).toEqual value: 'setw', scopes: ['source.tmux', 'support.function.tmux'] 52 | --------------------------------------------------------------------------------