Wednesday, December 14, 2022

Re: How to quickly move to a specific buffer?

On 12/13/22 20:09, Steve Litt wrote:
>Hi all,
>
>I typically use :bn and :bp to move between buffers, but I have five
>buffers open on my current project, which requires a heck of a lot of
>keystrokes to move to a specific buffer. So I'd like a command to bring
>up a list of buffers so I can chose a specific one.
>
>I've looked up :h buffers and can't find anything. Is there a way I
>could do this?
>
>Theoretically I could use the gvim menu system to do this, but it
>involves taking my hands off home position to use the arrow keys, and
>also, Alt+b is a difficult hotkey, so I'd much rather have some sort of
>Vim command to do it.

Do you want to do it in a barebone vim (i.e) no plugin way, or you are
opt to use plugin to do that?

Might be a bit offtopic here, I use neovim, so to find a buffer I use
"Telescope buffers". As what I remembered, LeaderF, Coc.nvim, and
fzf.vim might be the alternatives in vim.

And if you want to do it in the cmdline, then ":ls" to show all buffers
and then":b xxx" might be the only viable solution. The default vim's
completion system works not that good, it is neither case-insensitive
nor fuzzable (it works similar to the default bash?). I used nvim-cmp as
my auto-completion framework which also works in cmdline, so when I type
":b xxx" an auto-completion popup invokes and I can just complete it
with fuzzy matching. What first comes in my mind of the alternative of
nvim-cmp in vim is coc.nvim, but there are definetely other
alternatives.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/MW4PR14MB532784D6147EA9230DC8BF95E7E09%40MW4PR14MB5327.namprd14.prod.outlook.com.

No comments: