diff options
author | Teddy Wing | 2020-09-24 20:29:17 +0200 |
---|---|---|
committer | Teddy Wing | 2020-09-28 20:55:52 +0200 |
commit | 44b3924298992c374b4ed4b11d900c072ae8264b (patch) | |
tree | d72030af04ae3915144e7f4f9872ad5f5d8ff054 /vimrc | |
parent | fcf6c84515e745ff581684bd8390ffa6e478abe4 (diff) | |
download | dotvim-44b3924298992c374b4ed4b11d900c072ae8264b.tar.bz2 |
vimrc: Add `<leader>db` mapping to open files with TBuffer using Pick
I've been using my `TBuffer` command recently, but don't like how I have
to type out parts of the file name interspersed with "*"s, and press
`<Tab>` to ensure I'm getting the right file in case there are multiple
matches.
Make it easier to use `TBuffer` by allowing fuzzy finding with Pick.
This allows us to filter the list of buffers, choosing one to pass to
`TBuffer`.
Used the buffer list because the function is readily available, and
because there's no easy way to get a list of all buffer names in all
tabs. I'd probably have to map over `gettabinfo()`, and get the buffer
name for each window. Or manually filter the `:tabs` output.
Chose `db` because `dt` is taken for opening a file in a new tab, and
the word "tab" ends in "b". Now that I think about it, though, this
command deals with buffers, so it probably makes more sense to put it
under the "b" namespace.
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -467,6 +467,9 @@ " 2020.09.22: " * Add i_^r^f mapping to insert the current filename. " +" 2020.09.24: +" * Add <leader>db to open buffers with Pick and :TBuffer. +" " Pathogen @@ -636,6 +639,8 @@ nnoremap <leader>bs :call PickCommand(PickBufferListCommand(), "", ":split")<cr> nnoremap <leader>bv :call PickCommand(PickBufferListCommand(), "", ":vsplit")<cr> nnoremap <leader>bt :call PickCommand(PickBufferListCommand(), "", ":tabedit")<cr> nnoremap <leader>d] :call PickTag()<cr> +nnoremap <leader>db + \ :call PickCommand(PickBufferListCommand(), '', ':TBuffer')<cr> " PreserveNoEOL |