2022-07-07 18:50:31 +00:00
|
|
|
"
|
|
|
|
|
" Runs a shell command in the neovim terminal. This will open up a buffered
|
|
|
|
|
" terminal in a split at the bottom
|
|
|
|
|
"
|
|
|
|
|
" a:command
|
|
|
|
|
" The command you want the run in the terminal
|
|
|
|
|
"
|
|
|
|
|
function! s:aa_run(command)
|
|
|
|
|
if strlen($TMUX) > 0
|
|
|
|
|
if (&columns > 180)
|
|
|
|
|
let l:split = '-h'
|
|
|
|
|
else
|
|
|
|
|
let l:split = '-v'
|
|
|
|
|
endif
|
|
|
|
|
|
2024-05-19 18:18:46 +00:00
|
|
|
execute 'silent !tmux split-window ' . l:split . ' && tmux send-keys "' . a:command . '" C-m'
|
2022-07-07 18:50:31 +00:00
|
|
|
return
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if has('nvim')
|
|
|
|
|
if (&columns > 180)
|
2022-12-03 16:14:29 +00:00
|
|
|
execute 'VTerm ' . a:command
|
2022-07-07 18:50:31 +00:00
|
|
|
else
|
2022-12-03 16:14:29 +00:00
|
|
|
execute 'HTerm ' . a:command
|
2022-07-07 18:50:31 +00:00
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
command! -nargs=* -complete=shellcmd Run call s:aa_run(<q-args>)
|