aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-11 11:50:21 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-11 11:50:21 +1200
commit448423e4f8237f7ed3bace88327f1a6422584b04 (patch)
treebde2ef0eef9c2aa27160c4d468e238539c58888d
parentMention the sources of a few mapping commands (diff)
downloaddotfiles-448423e4f8237f7ed3bace88327f1a6422584b04.tar.gz
dotfiles-448423e4f8237f7ed3bace88327f1a6422584b04.zip
Allow -bar in custom commands
-rw-r--r--vim/plugin/put_date.vim2
-rw-r--r--vim/plugin/utc.vim2
-rw-r--r--vim/vimrc6
3 files changed, 5 insertions, 5 deletions
diff --git a/vim/plugin/put_date.vim b/vim/plugin/put_date.vim
index 29cf886e..0828abe4 100644
--- a/vim/plugin/put_date.vim
+++ b/vim/plugin/put_date.vim
@@ -7,5 +7,5 @@ let loaded_put_date = 1
" RFC-2822 date string, using the system strftime() implementation. Allow it
" to accept a range which defaults to the current line.
"
-command! -range PutDate
+command! -bar -range PutDate
\ <line1>put =strftime('%a, %d %b %Y %T %z')
diff --git a/vim/plugin/utc.vim b/vim/plugin/utc.vim
index 39eebad8..8fb84890 100644
--- a/vim/plugin/utc.vim
+++ b/vim/plugin/utc.vim
@@ -27,5 +27,5 @@ endfunction
" The :UTC command itself completes another command name, and accepts one
" required argument, which it passes in quoted form to the helper function.
"
-command! -complete=command -nargs=1 UTC
+command! -bar -complete=command -nargs=1 UTC
\ call s:UTC(<q-args>)
diff --git a/vim/vimrc b/vim/vimrc
index e0baed6c..94af80f6 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -142,7 +142,7 @@ function! s:ReloadFileType() abort
doautocmd filetypedetect BufRead
endif
endfunction
-command! ReloadFileType
+command! -bar ReloadFileType
\ call s:ReloadFileType()
" We'll also define a :ReloadVimrc command. This may seem like overkill at
@@ -162,7 +162,7 @@ command! ReloadFileType
" from running the :source command with a :noautocmd wrapper. This is
" a defensive measure to avoid infinite recursion.
"
-command! ReloadVimrc
+command! -bar ReloadVimrc
\ noautocmd source $MYVIMRC | ReloadFileType
" Reset and define a group of automatic command hooks specific to matters
@@ -222,7 +222,7 @@ endfunction
" names as candidates, and specify that there must be only one argument, which
" we'll provide as a quoted parameter to the function.
"
-command! -complete=dir -nargs=1 Establish
+command! -bar -complete=dir -nargs=1 Establish
\ call s:Establish(<q-args>)
" Now that we have a clean means to create directories if they don't already