aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/command_typos.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-04 18:48:22 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-04 18:48:22 +1300
commit63087e57b8b1aa030b431b86f3be533ee20f07dc (patch)
treed9c129817e6e9722bdd8c559dc2f341991b68040 /vim/plugin/command_typos.vim
parentMerge branch 'hotfix/v0.6.1' (diff)
parentUpdate dotfiles(7) manual from README.md (diff)
downloaddotfiles-a24ca4fd5b9d7d954475a311d9ae402949884286.tar.gz (sig)
dotfiles-a24ca4fd5b9d7d954475a311d9ae402949884286.zip
Merge branch 'release/v0.7.0'v0.7.0
* release/v0.7.0: (21 commits) Update dotfiles(7) manual from README.md Bump version number Add heading for Vim plugins subsection Update README to mention Vim plugins Rename toggle plugin again, use commands not funcs Add short documentation for new custom plugins Use same comment boilerplate for custom plugins Check 'eval' feature for loading command_typos.vim Wrap detect_background.vim func call in 'silent!' Rename and refactor option toggle plugin Don't suggest mappings in Vim plugin comments Move Vim background detection logic into plugin Specify an install-vim-autoload target Spin 'fo' toggle out into new flag toggler plugin Spin copyable linebreak config into new plugin Spin stable join config out into new plugin Use <Plug> prefix, make space strip configurable Rename a misnamed variable in big_file.vim Rename bigfile plugin to big_file Move trailing space strip config into plugin ...
Diffstat (limited to 'vim/plugin/command_typos.vim')
-rw-r--r--vim/plugin/command_typos.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/vim/plugin/command_typos.vim b/vim/plugin/command_typos.vim
new file mode 100644
index 00000000..32d194fb
--- /dev/null
+++ b/vim/plugin/command_typos.vim
@@ -0,0 +1,19 @@
+"
+" 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 has('eval') && has('user_commands')
+ command! -bang -complete=file -nargs=? E e<bang> <args>
+ command! -bang -complete=file -nargs=? W w<bang> <args>
+ command! -bang -complete=file -nargs=? WQ wq<bang> <args>
+ command! -bang -complete=file -nargs=? Wq wq<bang> <args>
+ command! -bang Q q<bang>
+ command! -bang Qa qa<bang>
+ command! -bang QA qa<bang>
+ command! -bang Wa wa<bang>
+ command! -bang WA wa<bang>
+endif