aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/command_typos.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:26:41 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:26:41 +1300
commitd1d039f3444f85b6c6e53a7ac69e6588c2e78fba (patch)
treee11c11a7d116045489e7e43fa8d8c2ec71236278 /vim/plugin/command_typos.vim
parentMerge branch 'feature/vim61-backport' into develop (diff)
parentAdd short-circuit boilerplate to plugins (diff)
downloaddotfiles-d1d039f3444f85b6c6e53a7ac69e6588c2e78fba.tar.gz
dotfiles-d1d039f3444f85b6c6e53a7ac69e6588c2e78fba.zip
Merge branch 'feature/plugin-shor...' into develop
* feature/plugin-short-circuit: Add short-circuit boilerplate to plugins Simplify shell linting code with single vars
Diffstat (limited to 'vim/plugin/command_typos.vim')
-rw-r--r--vim/plugin/command_typos.vim63
1 files changed, 34 insertions, 29 deletions
diff --git a/vim/plugin/command_typos.vim b/vim/plugin/command_typos.vim
index 6f46b115..16ba654d 100644
--- a/vim/plugin/command_typos.vim
+++ b/vim/plugin/command_typos.vim
@@ -6,33 +6,38 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if has('eval') && has('user_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>
+if exists('g:loaded_command_typos')
+ \ || !has('user_commands')
+ \ || &compatible
+ 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>