1

Is there a way to make vim ignore case on commands?

For example, I want vim to recognize :vex as :Vex.

Appreciate any pointers!

Tomas Romero
  • 8,418
  • 11
  • 50
  • 72
  • Related post: [vim change :x function to delete buffer instead of save & quit](http://stackoverflow.com/q/7513380/438329) – Peter Rincker Jan 14 '15 at 15:20

2 Answers2

1

There is no simple option, and a simplistic mapping (as in @romainl's answer, even when only applied to command-line mode) suffers from problems like noticeable delay or inadvertent application in other contexts.

I would recommend to use the cmdalias.vim plugin, which handles this quite well:

:Alias vex Vex
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • 2
    If you wish to do this w/o the plugin: `cnoreabbrev Vex getcmdtype() == ":" && getcmdline() == 'Vex' ? 'vex' : 'Vex'` – Peter Rincker Jan 14 '15 at 15:24
0

You can find this simple solution out of the box:

nnoremap :vex :Vex
romainl
  • 186,200
  • 21
  • 280
  • 313