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; ...
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 ...
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.
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 ...
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.
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 ...
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,...
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 ...
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 ...
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 ...
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 ...
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 ...
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(...
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 ` (...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
jump × 20search × 4
key-bindings × 3
vim-windows × 3
terminal × 2
autocompletion × 2
cursor-movement × 2
mark × 2
jumplist × 2
vimrc × 1
vimscript × 1
autocmd × 1
substitute × 1
normal-mode × 1
highlight × 1
cursor × 1
filetype-markdown × 1
line-numbers × 1
filetype-c++ × 1
tmux × 1
plugin-ale × 1
mouse × 1
find × 1
delimiter-matching × 1
lsp × 1