├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── autoload └── tmuxify.vim ├── doc └── tmuxify.txt └── plugin └── tmuxify.vim /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !*/ 3 | 4 | !.gitignore 5 | !CONTRIBUTING.md 6 | !README.md 7 | !autoload/tmuxify.vim 8 | !doc/tmuxify.txt 9 | !plugin/tmuxify.vim 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | CONTRIBUTING 2 | ============ 3 | 4 | If you intend to contribute to this project, please keep some simple rules in 5 | mind: 6 | 7 | - one commit per feature/fix 8 | - the short commit message shouldn't be longer than 50 characters 9 | - the short commit message should start with an uppercase character 10 | - use the imperative for the short commit message 11 | - don't finish the short commit message with a '.' 12 | - don't use github-specific syntax to close an issue (I'll do that, when 13 | merging into master) 14 | - it's always a good idea to have a look at 'git log' to get an idea how to 15 | format one's own commits 16 | - if you have questions about a certain patch or feature requests, just open 17 | a Github issue 18 | 19 | Examples 20 | -------- 21 | 22 | ``` 23 | Bad: "fixed loop to start from 0 instead of 1" 24 | Good: "Avoid off-by-one issue in skiplist loop" 25 | 26 | Bad: "fixed typo" 27 | Good: "Docs: typo" 28 | ``` 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-tmuxify 2 | 3 | This is a shiny Vim plugin for handling tmux panes from within Vim! 4 | 5 | Features: 6 | 7 | - create/kill associated panes 8 | - associate tmuxify to already existing panes 9 | - send visually highlighted lines to the associated pane 10 | - send to pane by prompting for input 11 | - send to pane by setting a run command for the current filetype 12 | - once set, run commands are remembered, but can easily be reset 13 | - all the plugin configuration happens in one dictionary that holds filetypes as 14 | keys and run commands as values 15 | 16 | __NOTE__: This plugin needs tmux 1.6 with a certain patch level. You're safe 17 | with versions 1.7+. 18 | 19 | ## Feedback, please! 20 | 21 | If you use any of my plugins, star it on github. This is a great way of getting 22 | feedback! Same for issues or feature requests. 23 | 24 | Thank you for flying mhi airlines. Get the Vim on! 25 | 26 | ## Installation 27 | 28 | If you have no preferred installation method, I suggest using tpope's pathogen: 29 | 30 | 1. git clone https://github.com/tpope/vim-pathogen ~/.vim/bundle/vim-pathogen 31 | 1. mkdir -p ~/.vim/autoload && cd ~/.vim/autoload 32 | 1. ln -s ../bundle/vim-pathogen/autoload/pathogen.vim 33 | 34 | Afterwards, installing tmuxify is as easy as pie: 35 | 36 | 2. git clone https://github.com/mhinz/vim-tmuxify ~/.vim/bundle/vim-tmuxify 37 | 2. start Vim 38 | 2. :Helptags 39 | 2. :h tmuxify 40 | 41 | ## Options 42 | 43 | Put these variables into your vimrc for great enjoyment. The shown examples 44 | are also the default values. 45 | 46 | ```vim 47 | let g:tmuxify_custom_command = 'tmux split-window -d' 48 | ``` 49 | 50 | Use this option if you want to overwrite that default command for creating a new 51 | pane. 52 | 53 | _(Examples are given in `:h tmuxify-options`)_ 54 | 55 | ```vim 56 | let g:tmuxify_map_prefix = 'm' 57 | ``` 58 | 59 | What to start mappings with. Set it to `''` to disable mappings. 60 | 61 | ```vim 62 | let g:tmuxify_run = {} 63 | ``` 64 | 65 | Set run commands for specific filetypes. '%' will be replaced by the full path 66 | to the current buffer. 67 | 68 | Example: 69 | 70 | ```vim 71 | let g:tmuxify_run = { 72 | \ 'sh': 'bash %', 73 | \ 'go': 'go build %', 74 | \} 75 | ``` 76 | 77 | ## Mappings 78 | 79 | ```vim 80 | mn 81 | ``` 82 | 83 | Executes TxCreate. Creates a new pane and associates with it. 84 | 85 | ```vim 86 | mq 87 | ``` 88 | 89 | Executes TxKill. Closes the associated pane. 90 | 91 | ```vim 92 | ms 93 | ``` 94 | 95 | Executes TxSend. Prompts for input and sends it to the associated pane. This 96 | mapping also works on visual selections. 97 | 98 | ```vim 99 | mr 100 | ``` 101 | 102 | Executes TxSendKey. Prompts for input and sends it to the associated pane as keys. 103 | 104 | ```vim 105 | mk 106 | ``` 107 | 108 | Executes TxRun. Prompts for input if there is no entry in g:tmuxify_run for 109 | the current filetype. '%' will be replaced by the full path to the current 110 | buffer. 111 | 112 | ```vim 113 | mt 114 | ``` 115 | 116 | Executes TxSetRunCmd. Change the run command for the current filetype. 117 | 118 | ```vim 119 | mp 120 | ``` 121 | 122 | Executes TxSetPane. Associate an already existing pane with tmuxify. Note: You 123 | can use tab completion here. 124 | 125 | ```vim 126 | mc 127 | ``` 128 | 129 | Executes TxClear. Sends ctrl+l to the associated pane. 130 | 131 | ```vim 132 | mb 133 | ``` 134 | 135 | Executes TxSigInt. Sends ctrl+c to the associated pane. 136 | 137 | ## Documentation 138 | 139 | `:h tmuxify` 140 | 141 | ## Author 142 | 143 | Marco Hinz `` 144 | 145 | [James Baumgarten](http://github.com/jebaum) (current maintainer) 146 | 147 | ## License 148 | 149 | Copyright © Marco Hinz. Distributed under the same terms as Vim itself. See 150 | `:help license`. 151 | -------------------------------------------------------------------------------- /autoload/tmuxify.vim: -------------------------------------------------------------------------------- 1 | " Plugin: https://github.com/mhinz/vim-tmuxify 2 | " Description: Plugin for handling tmux panes like a boss. 3 | " Maintainer: Marco Hinz 4 | " Version: 1.1 5 | 6 | if exists('g:autoloaded_tmuxify') || &compatible || !executable('tmux') || !executable('awk') 7 | finish 8 | endif 9 | let g:autoloaded_tmuxify = 1 10 | 11 | " s:SID() {{{1 12 | function s:SID() abort 13 | return matchstr(expand(''), '\zs\d\+\ze_SID$') 14 | endfun 15 | 16 | " s:complete_sessions() {{{1 17 | function! s:complete_sessions(...) abort 18 | return system('tmux list-sessions -F "#S"') 19 | endfunction 20 | 21 | " s:complete_windows() {{{1 22 | function! s:complete_windows(...) abort 23 | return system('tmux list-windows -F "#I" -t '. b:session) 24 | endfunction 25 | 26 | " s:complete_panes() {{{1 27 | function! s:complete_panes(...) abort 28 | return system('tmux list-panes -F "#P" -t '. b:session .':'. b:window) 29 | endfunction 30 | 31 | function! s:complete_descriptor(...) abort 32 | return system('tmux list-panes -aF "#S:#I.#P"') 33 | endfunction 34 | 35 | " s:get_pane_descriptor_from_id() {{{1 36 | function! s:get_pane_descriptor_from_id(pane_id) abort 37 | if exists('*systemlist') 38 | let descriptor_list = systemlist("tmux list-panes -a -F '#D #S #I #P' | awk 'substr($1, 2) == ". a:pane_id ." { print $2, $3, $4 }'") 39 | else 40 | let descriptor_list = split(system("tmux list-panes -a -F '#D #S #I #P' | awk 'substr($1, 2) == ". a:pane_id ." { print $2, $3, $4 }'"), '\n') 41 | endif 42 | if empty(descriptor_list) || descriptor_list[0] == 'failed to connect to server: Connection refused' 43 | return '' 44 | else 45 | " there should only ever be one item in descriptor_list, since it was filtered for matching the unique pane_id 46 | let [session, window, pane] = split(descriptor_list[0],' ') 47 | return session . ':' . window . '.' . pane 48 | endif 49 | endfunction 50 | 51 | " tmuxify#pane_create() {{{1 52 | function! tmuxify#pane_create(bang, ...) abort 53 | if empty(a:bang) 54 | let scope = "b:" 55 | else 56 | let scope = "g:" 57 | endif 58 | 59 | if !exists('$TMUX') 60 | echomsg 'tmuxify: This Vim is not running in a tmux session!' 61 | return 62 | elseif exists(scope . 'pane_id') 63 | execute 'let pane_id = ' . scope . 'pane_id' 64 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 65 | if !empty(pane_descriptor) 66 | echomsg "tmuxify: I'm already associated with pane ". pane_descriptor .'!' 67 | return 68 | endif 69 | endif 70 | 71 | " capture the pane_id, as well as session, window, and pane index information 72 | " pane_id is unique, pane_index will change if the pane is moved 73 | let [ pane_id, session, window, pane ] = map(split(system(get(g:, 'tmuxify_custom_command', 'tmux split-window -d') . " -PF '#D #S #I #P' | awk '{id=$1; session=$2; window=$3; pane=$4} END { print substr(id, 2), session, window, pane }'"), ' '), 'str2nr(v:val)') 74 | if v:shell_error 75 | echoerr 'tmuxify: A certain version of tmux 1.6 or higher is needed. Consider updating to 1.7+.' 76 | endif 77 | 78 | if exists('a:1') 79 | call tmuxify#pane_send(a:bang, a:1) 80 | endif 81 | 82 | execute 'let ' . scope . 'pane_id = pane_id' 83 | execute 'let ' . scope . 'session = session' 84 | execute 'let ' . scope . 'window = window' 85 | execute 'let ' . scope . 'pane = pane' 86 | return 1 87 | endfunction 88 | 89 | " tmuxify#pane_kill() {{{1 90 | function! tmuxify#pane_kill(bang) abort 91 | if empty(a:bang) 92 | let scope = "b:" 93 | else 94 | let scope = "g:" 95 | endif 96 | 97 | if !exists(scope . 'pane_id') 98 | echomsg "tmuxify: I'm not associated with any pane! Run :TxCreate, or check whether you're using bang commands consistently." 99 | return 100 | endif 101 | 102 | execute 'let pane_id = ' scope . 'pane_id' 103 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 104 | if empty(pane_descriptor) 105 | echomsg 'tmuxify: The associated pane was already closed! Run :TxCreate.' 106 | else 107 | call system('tmux kill-pane -t '. pane_descriptor) 108 | endif 109 | 110 | execute 'unlet ' . scope . 'pane_id' 111 | endfunction 112 | 113 | " tmuxify#pane_set() {{{1 114 | function! tmuxify#pane_set(bang, ...) abort 115 | if empty(a:bang) 116 | let scope = "b:" 117 | else 118 | let scope = "g:" 119 | endif 120 | 121 | if a:0 == 1 122 | if a:1[0] == '%' 123 | let descriptor_string = s:get_pane_descriptor_from_id(strpart(a:1, 1)) 124 | if descriptor_string == '' 125 | echo 'tmuxify: Invalid Pane ID!' 126 | return 127 | endif 128 | let [session, window, pane] = split(descriptor_string, '\W') 129 | else 130 | let [session, window, pane] = split(a:1, '\W') 131 | endif 132 | else 133 | let descriptor = input('Session:Window.Pane> ', '', 'custom,'. s:SID() .'_complete_descriptor') 134 | let [session, window, pane] = split(descriptor, '\W') 135 | endif 136 | 137 | execute "let " . scope . "session = session" 138 | execute "let " . scope . "window = window" 139 | execute "let " . scope . "pane = pane" 140 | 141 | let pane_id = system("tmux list-panes -a -F '#D #S #I #P' | awk '$2 == \"". session ."\" && $3 == \"". window ."\" && $4 == \"". pane ."\" {print substr($1, 2)}'") 142 | if empty(pane_id) 143 | redraw | echomsg 'tmuxify: There is no pane '. pane .'!' 144 | return 145 | endif 146 | 147 | execute "let " . scope . "pane_id = str2nr(pane_id)" 148 | endfunction 149 | 150 | " tmuxify#pane_run() {{{1 151 | function! tmuxify#pane_run(bang, ...) abort 152 | if empty(a:bang) 153 | let scope = "b:" 154 | else 155 | let scope = "g:" 156 | endif 157 | 158 | if !exists(scope . 'pane_id') && !tmuxify#pane_create(a:bang) 159 | return 160 | endif 161 | 162 | let ft = !empty(&ft) ? &ft : ' ' 163 | 164 | if exists('a:1') 165 | let action = a:1 166 | elseif exists('g:tmuxify_run') && has_key(g:tmuxify_run, ft) && !empty(g:tmuxify_run[ft]) 167 | let action = g:tmuxify_run[ft] 168 | else 169 | let action = input('TxRun> ') 170 | endif 171 | 172 | if !exists('g:tmuxify_run') 173 | let g:tmuxify_run = {} 174 | endif 175 | let g:tmuxify_run[ft] = action 176 | 177 | call tmuxify#pane_send(a:bang, substitute(g:tmuxify_run[ft], '%', resolve(expand('%:p')), '')) 178 | endfunction 179 | 180 | " tmuxify#pane_send() {{{1 181 | function! tmuxify#pane_send(bang, ...) abort 182 | if empty(a:bang) 183 | let scope = "b:" 184 | else 185 | let scope = "g:" 186 | endif 187 | 188 | if !exists(scope . 'pane_id') && !tmuxify#pane_create(a:bang) 189 | return 190 | endif 191 | 192 | execute 'let pane_id = ' . scope . 'pane_id' 193 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 194 | if empty(pane_descriptor) 195 | echomsg 'tmuxify: The associated pane was already closed! Run :TxCreate.' 196 | return 197 | endif 198 | 199 | if exists('a:1') 200 | for line in split(a:1, '\n') 201 | call system('tmux send-keys -t '. pane_descriptor .' -l '. shellescape(s:fixstr(line)) .' && tmux send-keys -t '. pane_descriptor .' C-m') 202 | if v:shell_error 203 | echoerr 'tmuxify: A certain version of tmux 1.6 or higher is needed. Consider updating to 1.7+.' 204 | endif 205 | endfor 206 | else 207 | call system('tmux send-keys -t '. pane_descriptor .' '. shellescape(s:fixstr(input('TxSend> '))) .' C-m') 208 | endif 209 | endfunction 210 | 211 | function! s:fixstr(line) 212 | let line = substitute(a:line, '\t', ' ', 'g') 213 | return line[-1:] == ';' ? line[:-2] . '\;' : line 214 | endfunction 215 | 216 | " tmuxify#pane_send_raw() {{{1 217 | function! tmuxify#pane_send_raw(cmd, bang) abort 218 | if empty(a:bang) 219 | let scope = "b:" 220 | else 221 | let scope = "g:" 222 | endif 223 | 224 | if !exists(scope . 'pane_id') && !tmuxify#pane_create(a:bang) 225 | return 226 | endif 227 | 228 | execute 'let pane_id = ' scope . 'pane_id' 229 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 230 | if empty(pane_descriptor) 231 | echomsg 'tmuxify: The associated pane was already closed! Run :TxCreate.' 232 | return 233 | endif 234 | 235 | if empty(a:cmd) 236 | let keys = input('TxSendKey> ') 237 | else 238 | let keys = a:cmd 239 | endif 240 | 241 | call system('tmux send-keys -t '. pane_descriptor ." '". keys . "'") 242 | endfunction 243 | 244 | " tmuxify#set_run_command_for_filetype() {{{1 245 | function! tmuxify#set_run_command_for_filetype(...) abort 246 | if !exists('g:tmuxify_run') 247 | let g:tmuxify_run = {} 248 | endif 249 | 250 | let ft = !empty(&ft) ? &ft : ' ' 251 | let g:tmuxify_run[ft] = exists('a:1') ? a:1 : input('TxSet('. ft .')> ') 252 | endfunction 253 | 254 | " tmuxify#get_associated_pane() {{{1 255 | function! tmuxify#get_associated_pane(...) abort 256 | if (a:0 == 0) 257 | let scope = "b:" 258 | else 259 | let scope = "g:" 260 | endif 261 | 262 | if !exists(scope . 'pane_id') 263 | return -1 264 | endif 265 | 266 | execute 'let pane_id = ' . scope . 'pane_id' 267 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 268 | return empty(pane_descriptor) ? -1 : pane_descriptor 269 | endfunction 270 | 271 | " tmuxify#pane_command() {{{1 272 | function! tmuxify#pane_command(bang, ...) abort 273 | if empty(a:bang) 274 | let scope = "b:" 275 | else 276 | let scope = "g:" 277 | endif 278 | 279 | if !exists(scope . 'pane_id') 280 | echomsg "tmuxify: I'm not associated with any pane! Run :TxCreate, or check whether you're using bang commands consistently." 281 | return 282 | endif 283 | 284 | execute 'let pane_id = ' scope . 'pane_id' 285 | let pane_descriptor = s:get_pane_descriptor_from_id(pane_id) 286 | if empty(pane_descriptor) 287 | echomsg 'tmuxify: The associated pane was already closed! Run :TxCreate.' 288 | return 289 | endif 290 | 291 | call system('tmux ' . a:1 . ' -t '. pane_descriptor) 292 | endfunction 293 | 294 | " vim: et sw=2 sts=2 tw=80 295 | -------------------------------------------------------------------------------- /doc/tmuxify.txt: -------------------------------------------------------------------------------- 1 | *tmuxify.txt* Handling panes like a boss. 2 | *tmuxify* 3 | __ ___ 4 | /\ \__ __ /'___\ 5 | \ \ ,_\ ___ ___ __ __ __ _/\_\/\ \__/ __ __ 6 | \ \ \/ /' __` __`\/\ \/\ \/\ \/'\/\ \ \ ,__\/\ \/\ \ 7 | \ \ \_/\ \/\ \/\ \ \ \_\ \/> \ 10 | /\___/ 11 | \/__/ 12 | by Marco Hinz~ 13 | 14 | Twitter: https://twitter.com/_mhinz_ 15 | Github: http://github.com/mhinz 16 | IRC: mhi^ (Freenode) 17 | > 18 | If you use any of my plugins, please star them on github. It's a great way 19 | of getting feedback and gives me the kick to put more time into their 20 | development. 21 | 22 | If you encounter any bugs or have feature requests, just open an issue 23 | report on Github. 24 | 25 | Thank you for flying mhi^ airlines. Get the Vim on! 26 | 27 | ============================================================================== 28 | TOC *tmuxify-contents* 29 | 30 | INTRO .......................... |tmuxify-intro| 31 | OPTIONS ........................ |tmuxify-options| 32 | MAPPINGS ....................... |tmuxify-mappings| 33 | 34 | ============================================================================== 35 | INTRO *tmuxify-intro* 36 | 37 | tmuxify is a plugin for handling tmux panes: 38 | 39 | - create/kill associated panes 40 | 41 | - associate tmuxify to already existing panes 42 | 43 | - send visually highlighted lines to the associated pane 44 | 45 | - send to pane by prompting for input 46 | 47 | - send to pane by setting a run command for the current filetype 48 | 49 | - once set, run commands are remembered, but can easily be reset 50 | 51 | - all the plugin configuration happens in one dictionary that holds 52 | filetypes as keys and run commands as values 53 | 54 | ============================================================================== 55 | OPTIONS *tmuxify-options* 56 | 57 | Put these variables into your vimrc for great enjoyment. The shown examples 58 | are also the default values. 59 | 60 | ------------------------------------------------------------------------------ 61 | > 62 | let g:tmuxify_custom_command = 'tmux split-window -d' 63 | < 64 | Use this option if you want to overwrite that default command for creating a 65 | new pane. 66 | 67 | Examples:~ 68 | 69 | Horizontal split / height is 20% of screen size: 70 | > 71 | let g:tmuxify_custom_command = 'tmux split-window -p 20' 72 | < 73 | Horizontal split / don't switch to pane / height of 10 lines: 74 | > 75 | let g:tmuxify_custom_command = 'tmux split-window -d -l 10' 76 | < 77 | Vertical split / width of 20 columns: 78 | > 79 | let g:tmuxify_custom_command = 'tmux split-window -v -l 20' 80 | < 81 | ------------------------------------------------------------------------------ 82 | > 83 | let g:tmuxify_map_prefix = 'm' 84 | < 85 | What to start mappings with. Set it to '' to disable mappings. 86 | 87 | > 88 | let g:tmuxify_global_maps = 0 89 | < 90 | Whether default mappings should use global tmux panes or buffer specific ones. 91 | Default is 0, which uses buffer specific maps. 92 | 93 | ------------------------------------------------------------------------------ 94 | > 95 | let g:tmuxify_run = {} 96 | < 97 | Set run commands for specific filetypes. '%' will be replaced by the full path 98 | to the current buffer. 99 | 100 | Example:~ 101 | > 102 | let g:tmuxify_run = { 103 | \ 'sh': 'bash %', 104 | \ 'go': 'go build %', 105 | \} 106 | < 107 | ============================================================================== 108 | MAPPINGS *tmuxify-mappings* 109 | 110 | This plugin comes with a bunch for normal mode mappings. 111 | NOTE: The following commands, with the exception of TxSetRunCmd, can be used 112 | with a bang operator (e.g., :TxCreate!) in order to work with a 'global' pane, 113 | which is shared among all buffers in an instance of vim. Without a bang, all 114 | associated tmux panes will be buffer specific. 115 | 116 | ------------------------------------------------------------------------------ 117 | > 118 | mn 119 | < 120 | Executes :TxCreate. Creates a new pane and associates with it. 121 | 122 | ------------------------------------------------------------------------------ 123 | > 124 | mq 125 | < 126 | Executes :TxKill. Closes the associated pane. 127 | 128 | ------------------------------------------------------------------------------ 129 | > 130 | ms 131 | < 132 | Executes :TxSend. Prompts for input and sends it to the associated pane. This 133 | mapping also works on visual selections. 134 | 135 | ------------------------------------------------------------------------------ 136 | > 137 | mk 138 | < 139 | Executes :TxSendKey. Prompts for input and sends it to the associated pane as 140 | keys. 141 | 142 | ------------------------------------------------------------------------------ 143 | > 144 | mr 145 | < 146 | Executes :TxRun. Prompts for input if there is no entry in g:tmuxify_run for 147 | the current filetype. '%' will be replaced by the full path to the current 148 | buffer. 149 | 150 | ------------------------------------------------------------------------------ 151 | > 152 | mt 153 | < 154 | Executes :TxSetRunCmd. Change the run command for the current filetype. 155 | 156 | ------------------------------------------------------------------------------ 157 | > 158 | mp 159 | < 160 | Executes :TxSetPane. Associate an already existing pane with tmuxify. 161 | 162 | NOTE: You can use tab completion here. 163 | 164 | ------------------------------------------------------------------------------ 165 | > 166 | mc 167 | < 168 | Executes :TxClear. Sends ctrl+l to the associated pane. 169 | 170 | ------------------------------------------------------------------------------ 171 | > 172 | mb 173 | < 174 | Executes :TxSigInt. Sends ctrl+c to the associated pane. 175 | 176 | ============================================================================== 177 | vim: tw=78 178 | -------------------------------------------------------------------------------- /plugin/tmuxify.vim: -------------------------------------------------------------------------------- 1 | " Plugin: https://github.com/mhinz/vim-tmuxify 2 | " Description: Plugin for handling tmux panes like a boss. 3 | " Maintainer: Marco Hinz 4 | " Version: 1.1 5 | 6 | if exists('g:loaded_tmuxify') || &cp 7 | finish 8 | endif 9 | let g:loaded_tmuxify = 1 10 | 11 | let global = get(g:, 'tmuxify_global_maps', 0) ? '!' : '' 12 | let s:map_prefix = get(g:, 'tmuxify_map_prefix', 'm') 13 | 14 | " commands {{{1 15 | command! -nargs=0 -bar -bang TxClear call tmuxify#pane_send_raw('C-l', ) 16 | command! -nargs=0 -bar -bang TxKill call tmuxify#pane_kill() 17 | command! -nargs=? -bar -bang TxSetPane call tmuxify#pane_set(, ) 18 | command! -nargs=0 -bar -bang TxSigInt call tmuxify#pane_send_raw('C-c', ) 19 | command! -nargs=? -bar -bang TxCreate call tmuxify#pane_create(, ) 20 | command! -nargs=? -bar -bang TxRun call tmuxify#pane_run(, ) 21 | command! -nargs=? -bar -bang TxSend call tmuxify#pane_send(, ) 22 | command! -nargs=? -bar -bang TxSendKey call tmuxify#pane_send_raw(, ) 23 | command! -nargs=? -bar TxSetRunCmd call tmuxify#set_run_command_for_filetype() 24 | 25 | " mappings {{{1 26 | if s:map_prefix !=# "" 27 | execute 'nnoremap ' s:map_prefix .'b :TxSigInt' . global . '' 28 | execute 'nnoremap ' s:map_prefix .'c :TxClear' . global . '' 29 | execute 'nnoremap ' s:map_prefix .'n :TxCreate' . global . '' 30 | execute 'nnoremap ' s:map_prefix .'p :TxSetPane' . global . '' 31 | execute 'nnoremap ' s:map_prefix .'q :TxKill' . global . '' 32 | execute 'nnoremap ' s:map_prefix .'r :TxRun' . global . '' 33 | execute 'nnoremap ' s:map_prefix .'s :TxSend' . global . '' 34 | execute 'nnoremap ' s:map_prefix .'k :TxSendKey' . global . '' 35 | execute 'nnoremap ' s:map_prefix .'t :TxSetRunCmd' 36 | 37 | execute 'xnoremap ' s:map_prefix .'s "my:TxSend' . global . '(@m)' 38 | endif 39 | --------------------------------------------------------------------------------