Skip to main content
Commonmark migration
Source Link

#With vim only

With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the buffer in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have two more splits 'bar' and 'baz', :sbuffer az will switch to the 'baz' split.

You can have a mapping to make it easier: nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open split.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the buffer in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have two more splits 'bar' and 'baz', :sbuffer az will switch to the 'baz' split.

You can have a mapping to make it easier: nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open split.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the buffer in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have two more splits 'bar' and 'baz', :sbuffer az will switch to the 'baz' split.

You can have a mapping to make it easier: nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open split.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

grammar
Source Link
Biggybi
  • 2.8k
  • 10
  • 30

#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the filebuffer in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have tootwo more splits 'bar' and 'baz', :sbuffer az will switch to the 'baz' split.

You can have a mapping to make it easier  : nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open splitssplit.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the file in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have too more splits 'bar' and 'baz', :sbuffer az will switch to 'baz' split.

You can have a mapping to make it easier  : nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open splits.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the buffer in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have two more splits 'bar' and 'baz', :sbuffer az will switch to the 'baz' split.

You can have a mapping to make it easier: nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open split.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

edited body
Source Link
Biggybi
  • 2.8k
  • 10
  • 30

#Only with#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the file in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have too more splits 'bar' and 'baz', :sbuffer az will switch to 'baz' split.

You can have a mapping to make it easier : nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open splits.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

#Only with vim

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the file in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have too more splits 'bar' and 'baz', :sbuffer az will switch to 'baz' split.

You can have a mapping to make it easier : nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open splits.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

#With vim only

There's a few options to make navigation between files less tedious in vanilla vim.

First, you probably want to have set switchbuf=useopen in your vimrc (:h 'switchbuf') to reuse a split, instead of opening the file in the current split.

If you have the buffer number in 'statusline' (i.e %n), you can then easily switch to a split by number with :sbuffer buffnumber.

This will also work if you give a unique pattern from the name. If you are in the split 'foo' and have too more splits 'bar' and 'baz', :sbuffer az will switch to 'baz' split.

You can have a mapping to make it easier : nnoremap <leader>b :sbuffer (there's a space at the end).

Also, those mappings help switch to different splits (:h windows):

  • <c-w>t -> top left split
  • <c-w>b -> bottom right split
  • <c-w>p -> last used split

#With FZF

Besides, could use fzf.vim plugin (requires fzf) and its :Buffers command.

Similarly to switchbuf=useopen, you'll want let g:fzf_buffers_jump = 1 in your vimrc to reuse an open splits.

The command will show a list of buffers which you can strip down with fuzzy search, and navigate with <c-j> and <c-k>

<Enter> will then switch to the split if already open, or else use the current one. <c-v>, <c-x> or <c-t> will open the buffer in a new vertical split, horizontal split or tab.

You could have a mapping to launch :Buffers like nnoremap <leader>b :Buffers<cr>.

deleted 1 character in body
Source Link
Biggybi
  • 2.8k
  • 10
  • 30
Loading
added 181 characters in body
Source Link
Biggybi
  • 2.8k
  • 10
  • 30
Loading
Source Link
Biggybi
  • 2.8k
  • 10
  • 30
Loading