romeovs
romeovs

Reputation: 5953

Vim: is there a command to switch windows

I need a : command to switch windows because I'm using it in a function. so <C-W>W won't do.

Upvotes: 19

Views: 5501

Answers (2)

Truub
Truub

Reputation: 107

I had a problem with using normal <C-w>w in a function as well.

My problem was that I ran it within execute where you need to escape the first angle bracket, resulting in execute("normal \<C-w>w"). Hope this still helps some people understand it.

For more help use :help normal and :help execute in Vim

Upvotes: 1

romeovs
romeovs

Reputation: 5953

Using:

wincmd k

I got what I needed

Upvotes: 28

Related Questions