aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/command_typos.vim
blob: afc04ed3a96223fdabd5d5c717178c9a7dd6a71d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"
" command_typos.vim: Tolerate typos like :Wq, :Q, or :Qa and do what I mean,
" including any arguments or modifiers; I fat-finger these commands a lot
" because I type them so rapidly, and they don't correspond to any other
" commands I use
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('g:loaded_command_typos') || &compatible || !has('user_commands')
  finish
endif
let g:loaded_command_typos = 1

" Define commands
command -bang -complete=file -nargs=?
      \ E
      \ edit<bang> <args>
command -bang -complete=file -nargs=?
      \ W
      \ write<bang> <args>
command -bang -complete=file -nargs=?
      \ WQ
      \ wq<bang> <args>
command -bang -complete=file -nargs=?
      \ Wq
      \ wq<bang> <args>
command -bang
      \ Q
      \ quit<bang>
command -bang
      \ Qa
      \ qall<bang>
command -bang
      \ QA
      \ qall<bang>
command -bang
      \ Wa
      \ wall<bang>
command -bang
      \ WA
      \ wa<bang>