Closed alfred-sa closed 3 years ago
I'd rather not have the clutter of another option. I think you can probably achieve what you want by putting this in ~/.vim/after/plugin/command-t.vim
:
function! CustomGotoOrOpen(command_and_args) abort
let l:command_and_args = split(a:command_and_args, '\v^\w+ \zs')
let l:command = l:command_and_args[0]
let l:file = l:command_and_args[1]
execute l:command . l:file
endfunction
command! -nargs=+ CommandTOpen call CustomGotoOrOpen(<q-args>)
(ie. just overwrite the function) — In light testing, that works for me. If you wanted to have this toggle on or off at runtime, you could add an if
in there.
What do you think?
Well if it is not a common use case, feel free to ignore my rp. I will stick on my fork and rebase, I prefer to have this one line diff, it is easier to manage for me.
Thanks
Ok. And if demand for this shows up in the form of other requests we can resurrect it.
Hello,
In my workflow, I wanted to disable the "goto or open" behaviour of command-t, so I proprose a new configuration option "g:CommandTDontGoto", off by default of course.
Set to "on", the behaviour will be to always open, so one can have multiple windows with the same buffer (which I often happen to have as I use a lot of tabs and jumps).