Vim plugin for easy window navigation I've been thinking about it for a while and, after asking a question on vi.stackexchange, I decided to write a small plugin myself and put it on GitHub; basically it offers a mapping to activate a kind of &quot;window movement&quot; mode where Vim waits for inputs that it appends to Ctrl+w, so that one does not have to press this combination before every window-related movement or action; hitting Esc exits this mode.
It's mostly just one main function and one mapping, so I will copy them below.

The mapping plus some things I copied from scratch.vim which seemed reasonable:

&quot; plugin/winzoz.vim

if (exists('g:winzoz_disable') &amp;&amp; g:winzoz_disable) || &amp;compatible
  finish
endif

nnoremap &lt;silent&gt; &lt;Plug&gt;(go-zoz-navigation) :call winzoz#goZoZ()&lt;cr&gt;

if !exists('g:winzoz_no_mappings')
  nmap &lt;silent&gt; &lt;leader&gt;w &lt;Plug&gt;(go-zoz-navigation)
endif


The function with the logic (plus a helper function for coloring the command line while the functionality is active)

&quot; autoload/winzoz.vim

function! winzoz#goZoZ()
  redrawstatus!
  echohl Search
  echo s:make_status_line()
  echohl None
  let l:key = ''
  while l:key !=? &quot;\&lt;Esc&gt;&quot;
    let l:key = nr2char(getchar())
    execute &quot;normal! \&lt;c-w&gt;&quot; . l:key
    redrawstatus!
  endw
  echo ''
  redrawstatus!
endfunction

&quot; drawing function
function! s:make_status_line()
  let l:text = 'Go WinZoZ'
  let l:text .= repeat(' ', (&amp;columns - len(l:text))/2)
  return repeat(' ', &amp;columns - len(l:text) - 1) .  l:text
endfunction

I'd like some feedback in general, but also on the following points.

As regards the logic, I'm not checking that the input is correct (with a :try-:catch-:finally), because I'm not inventing any functionality, but only forwarding the keys to the already existing functionality of Ctrl+w+whatever.
I'm using echohl Search + echo to print a colored command line to make apparent when the mode is active; is this a good way of doing it?

Regarding this part, I had to make a trick (the - 1 in the second to last line of code above) in order to have one character left for the blinking cursor. I really don't like this, but I don't know what else I could do...


There are some Ctrl+w-commands that take two key strokes, but my plugin cannot deal with them :( ... I'll fix when I have time.
Do you like it?
Do you think it could be useful?

(I also plan to add some documentation to it, fwiw :/ )
As requested on vi.SE, here is my little view.
First, I see a great quality in most patterns you have used: autoload plugin, plug-mappings, and so on. Good work!
If I really had to nit-pick, it would be that:

I find l: prefix to be cumbersome and useless in many situations
I like to annotate my functions with abort in order to simplify error messages in case I'd introduce errors in future versions. abort should have been the default, but unfortunately, this is not the case.
&quot;\&lt;Esc&gt;&quot; and &quot;\&lt;ESC&gt;&quot; and &quot;\&lt;eSc&gt;&quot; are the same character, using a case-insensitive comparator doesn't really make any sense. !=# would make more sense. I have an old habit, personally I simply use != ^^'

Regarding your question regarding finally, it could make sense to make sure to reset the highlighting used with :echo in case make_status_line() could fail. I don't see any other place where it could make sense.
Regarding catch around &lt;c-w&gt; + {key}, it would depend on the user experience you want to provide. Use your plugin for some time, make some mistakes, and see how you'd like to see your plugin react.
Regarding the highlight color, in my plugin I use StatusLineNC as it's similar to what :substitute/pat/txt/c seems to use. In another plugin, I use Question.

Do you think it could be useful?

Well. I know I could do without it. And yet a few times, I've been bothered by the number of times I had to hit &lt;c-w&gt;&lt;down&gt;. In the end I use the mouse. So... Why not. I'd have to make sure though that I never use &lt;c-w&gt; in a non-nore mapping.