I’m programming in vim and I’m having one little problem. My vim is multiple times splitted in both vertical and horizontal directions, and I want to activate word-wrap like set wrap when i switch from one window to another with ctrl-w/W, also i want to unwrap like set nowrap on focused one. I have no idea how to do this and I was never good at writing scripts for vim. Any ideas ?
I’m programming in vim and I’m having one little problem. My vim is multiple
Share
I’m not sure of what you want to archieve, but maybe you could add
to your .vimrc. This will trigger a
set nowrapon a window you enter and aset wrapon a window you leave. From the tests I ran,WinEnterandWinLeaveare triggered when you switch between several split windows.Alternatively, you can replace the
*by a*.txtif you just want these command to be issued only on buffers containing a txt file for instance.