1

I am trying to view many files in a loop. I need a keybinding to close Gvim window. Possible choices in apt-get of Ubuntu 16.04

 Command 'gvim' from package 'vim' (main)
 Command 'gvim' from package 'vim-gtk3' (universe)
 Command 'gvim' from package 'vim-gnome' (main)
 Command 'gvim' from package 'vim-athena' (universe)
 Command 'gvim' from package 'vim-nox-py2' (universe)
 Command 'gvim' from package 'vim-gtk-py2' (universe)
 Command 'gvim' from package 'vim-nox' (universe)
 Command 'gvim' from package 'vim-gtk3-py2' (universe)
 Command 'gvim' from package 'vim-gnome-py2' (universe)
 Command 'gvim' from package 'vim-tiny' (main)
 Command 'gvim' from package 'vim-gtk' (universe)
 Command 'gvim' from package 'vim-athena-py2' (universe)

I have tried

  • vim-gtk3, no CTRL-W to close the window

I would like to get Neovim with such a feature.


Is there any GVim with window-closure by CTRL-W?

1 Answer 1

2

You can create a map in your vimrc to give CTRL+W the action you are looking for.

:nnoreamp <C-W> :q<cr>

If you want it to force quit then

:nnoremap <C-W> :q!<cr>
3
  • 5
    If you do that, though, you will lose access to the rich set of windows commands that begin with Ctrl-W. See :help CTRL-W and :help windows.
    – garyjohn
    Commented May 4, 2016 at 17:46
  • Is there any other suggestion for such a closure command? I noticed that <C-W> is bad. For Linux support. Commented May 13, 2016 at 8:32
  • In normal mode pressing ZZ will "Save and Quit" while ZQ will quit without saving. Both are very quick, no need for a chord to press.
    – jecxjo
    Commented May 13, 2016 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.