edit_command_buffer: Add line:col support for Sublime Text

This commit is contained in:
George Christou 2020-04-27 23:40:46 +01:00 committed by Johannes Altmanninger
parent 06658cd13b
commit 2bc4228d42

View File

@ -41,18 +41,21 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
set col (math $offset + 1) set col (math $offset + 1)
set -l basename (string match -r '[^/]*$' -- $editor[1]) set -l basename (string match -r '[^/]*$' -- $editor[1])
if contains $basename vi vim nvim switch $basename
set -a editor +$line +"norm $col|" $f case vi vim nvim
else if contains $basename emacs emacsclient gedit kak set -a editor +$line +"norm $col|" $f
set -a editor +$line:$col $f case emacs emacsclient gedit kak
else if contains $basename nano set -a editor +$line:$col $f
set -a editor +$line,$col $f case nano
else if contains $basename joe ee set -a editor +$line,$col $f
set -a editor +$line $f case joe ee
else if contains $basename code code-oss set -a editor +$line $f
set -a editor --goto $f:$line:$col --wait case code code-oss
else set -a editor --goto $f:$line:$col --wait
set -a editor $f case subl
set -a editor $f:$line:$col --wait
case '*'
set -a editor $f
end end
__fish_disable_bracketed_paste __fish_disable_bracketed_paste