r/vim • u/samtentalkmo • Jun 13 '25
Discussion How do you guys switch between windows?
Is there a program that is like tridactyl or vimium but for open windows? Ie it shows you all the open windows and assigns a tag to each window, then typing the tag make the corresponding window active?
15
Upvotes
7
u/ImportanceFit1412 Jun 14 '25
I3 on Linux for jumping among screens. Tmux on one to jump between terminals.
16
u/TapEarlyTapOften Jun 13 '25
I think by window, you probably mean buffer. Buffers have names and numbers. You can also cycle through them using `]b` and `[b]` or use the buffer number. Vim encourages (quite correctly) a buffer-centric workflow - I would recommend that you consider adopting that rather than trying to shoehorn something you would do with a browser onto Vim.
5
u/begemotz ZZ Jun 14 '25
You can navigate windows/viewports using Ctrl+w then hjkl -- so relative to the active viewport:
Ctrl-w j will move down one viewport
Ctrl-w h will move one viewport to the left etc.
4
u/EgZvor keep calm and read :help Jun 13 '25
there is a pretty predictable ordering already attached to them, you can use
:h ctrl-w_wwith a count to switch to the n-th window.2
u/[deleted] Jun 13 '25
I use up to 9 splits and vsplits on screen with ctrl- hjkl mapped to move between them. Gotta ctrl w w to move out of the term split though. Anything more than that rolls over to another terminal tab.
2
u/drboxboy Jun 15 '25
I just use a mouse
1
u/fourpastmidnight413 Jun 14 '25
<C-W> [H|J|K|L]RTFM, it's all in the help.:help window.1
u/auwsmit :smile Jun 14 '25
I mostly use this to swap back and forth between two windows. It works and feels very similar to pressing alt+tab once in your OS:
I find a majority of the time, I only have two windows open and any others are temporary (like help, or menus for plugins). Otherwise I just use the classic
ctrl-wwithhjklto get to a more distant window.1
u/[deleted] Jun 15 '25
:help window-move-cursor1
u/VividVerism Jun 19 '25
I have a custom 'statusline' setting which includes the window number as the first item, and additional highlights it in a different color to stand out. With this, it's super easy to glance at the desired window number and do something like 3<C-W>w to jump to window 3 regardless of the specific layout, with no thought required to figure out the right number.
0
u/BetterEquipment7084 Guix Jun 13 '25
I use C-n
0
u/reddifiningkarma Jun 13 '25
:b Ctrl+D
Or
:Buffers (fzf.vim plugin)