1

I know there is a shortcut to open a new blank split window horizontally. Namely, ctrl-w + n.

But is there a shortcut to do the same thing vertically? More precisely, I want a shortcut for :vs ene.

I can't seem to find one inside help. Does anyone know if such a shortcut exists or how I would go about mapping it myself considering I need to use :?

1 Answer 1

2

There's nothing special here, if you don't find a shortcut of your liking for a command just create your own with a simple Normal mode mapping. For example:

:nmap <Leader>v :vs ene<CR>

Assuming your Leader key is backslash then you can just type \ followed quickly by v and you'll get your vertical split.

You can, of course, choose any key combination you want but using Leader is a good idea as it will not likely conflict with other Vim functionality. (And Leader has other benefits...including the ability to change Leader without changing existing mappings.)

If this is all a bit foreign to you I encourage you to look at Vim help for key mappings (:h mapping) and the Leader key (:h <Leader>)

1
  • 1
    Could map <C-w>V, as that's unused. Aug 27, 2017 at 7:37

Your Answer

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

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