Skip to main content
7 votes
Accepted

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

I'm not aware of any Vim feature or even plugin that does that; in fact, up until recently it would be rather hard to display it like that, but with Vim 8.2's popup windows it wouldn't be too hard; ...
Martin Tournoij's user avatar
7 votes
Accepted

Open ctrl+] in a new split?

This will do it: CTRL-W ] *CTRL-W_]* *CTRL-W_CTRL-]* CTRL-W CTRL-] Split current window in two. Use identifier under cursor as a tag and jump to it in the new upper ...
Geremia's user avatar
  • 966
6 votes

Jump back to the position I started a search

I do this by first creating a mark - for example, create a mark named "a" with ma in command mode – then search or move around the file however you want. Then go back to your mark with 'a.
Kaan's user avatar
  • 341
4 votes

Prevent jumping when pattern matching

This will do for the * search, I'm not sure how to do that for /. nnoremap <silent> * :let @/= '\<' . expand('<cword>') . '\>' <bar> set hls <cr> @/ is the search ...
Biggybi's user avatar
  • 2,770
4 votes

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

You are looking for Choosewin, sadly it's not being actively developed anymore, but for the simplest use cases it works great.
Tae's user avatar
  • 2,155
3 votes

Jump back to the position I started a search

Two options I can think of off the top of my head: :[v]split, then search in only one window :nnoremap / mz/; then `z should take you back. Only works for one search at a time (i.e. new searches ...
D. Ben Knoble's user avatar
  • 27.7k
2 votes

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

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,...
Biggybi's user avatar
  • 2,770
2 votes

Jump back to the position I started a search

let's suppose I'm at the beginning of line 10 Then the easiest way back is 10G or :10. It's not that useless if you have line numbers on and your memory is not bad either. Also, sometimes the ...
Matt's user avatar
  • 21.6k
2 votes

Substituting without jumping

Custom operator would be a much better choice than a map, as you can use it with motion, it's very flexible. Lots of people use surround operator provided by tpope/vim-surround, it's bound to ys in ...
dedowsdi's user avatar
  • 6,358
2 votes
Accepted

Jump to (or get position of) any kind of parent brace

This functionality is provided by standard "matchit" plugin (if running Vim make sure you've enabled it with packadd matchit). Press [% to get to the previous unmatched bracket. Don't forget ...
Matt's user avatar
  • 21.6k
2 votes

Have to hit "Enter" after searching or I lose the pattern

One possible solution is to enable the x cpoption, which makes <Esc> execute a command (rather than cancel it) when in command-line mode. set cpoptions+=x See :help cpo-x and :help c_Esc for ...
filbranden's user avatar
  • 29.9k
2 votes
Accepted

Please explain/provide example of difference between gd and 1gd commands?

It was designed to work with C as help states, plus description explains how it works: First Vim searches for the start of the current function, just like "[[". If ...
Maxim Kim's user avatar
  • 13.9k
1 vote
Accepted

How to make mappings for "jump to after next occurrence of character" / "jump to the before previous occurrence of character"?

To jump to the character after you could do: nnoremap <expr> <C-f> 'f'.nr2char(getchar()).'l' To jump before the character you could do: nnoremap <expr> <C-S-f> 'F'.nr2char(...
Vivian De Smedt's user avatar
1 vote
Accepted

Difference between backtick and single quote for marks

It is the first paragraph that gives you the correct understanding. The start of the Mark section (few lines before the lines you quote) is: Jumping to a mark can be done in two ways: 1. With ` (...
Vivian De Smedt's user avatar
1 vote
Accepted

How to jump between markdown code chunk fence?

I would use the matchit plugin that comes in modern version of Vim. You can install it with: packadd! matchit Or from GitHub and vim-plug with: Plug 'chrisbra/matchit' To match the ``` fence you ...
Vivian De Smedt's user avatar
1 vote

How to use <c-i><c-o> in terminal mode to jump to/from next/previous cursor position?

Looking at the source code, it looks like there is no way other than :h keepjump to avoid adding to jumplist (which you can do: most of the movements can be done through :h :norm, and when in terminal ...
3N4N's user avatar
  • 5,934
1 vote

Jump to (or get position of) any kind of parent brace

You can always use call searchpair('<', '', '>', 'bW') To search for arbitrary pairings.
D. Ben Knoble's user avatar
  • 27.7k
1 vote
Accepted

How can I alter the window to which ctrl+w, ctrl+p will jump to?

One option is for you to save what the previous window was before the windo command. Then, later, jump to that window before jumping to your target window. function! MyFunction() let ...
filbranden's user avatar
  • 29.9k
1 vote
Accepted

How to jump to the first character of the first line of the next/previous block of text?

You can use a search and include \ns to match end of lines. Two of them in a row would match a blank line. You can then use \s*\S to find the first non-blank character of a line (and ensure you're ...
filbranden's user avatar
  • 29.9k
1 vote

Does Vim have functionality similar to tmux's `display-panes` command for selecting (goto) a specific window by number?

I found a plugin that does exactly this. I have been using for a whole hour now, so I feel comfortable recommending it to the world. https://github.com/t9md/vim-choosewin In particular, I've been ...
Lucio's user avatar
  • 11
1 vote
Accepted

Substituting without jumping

There's a much simpler solution to your specific problem of surrounding the current selection with \view; and ; delimiters. Type: c\view;;EscP c — change the visual selection: this deletes the ...
Rich's user avatar
  • 32.6k

Only top scored, non community-wiki answers of a minimum length are eligible