# HG changeset patch # User Meredith Howard # Date 1503465296 14400 # Node ID 8e07c29f26726c7a6b563698c1933ad9a50708e9 # Parent e5aec7abb8b59e56bd3536bf2dd6e4c965e5cdce fix viewdoc abbrevs and cabbrevs in general diff --git a/.vim/autoload/vimrc.vim b/.vim/autoload/vimrc.vim --- a/.vim/autoload/vimrc.vim +++ b/.vim/autoload/vimrc.vim @@ -1,3 +1,6 @@ +func! vimrc#CommandAlias(abbrev, expand) abort + execute printf('cnoreabbrev %s (getcmdtype()==":" && getcmdpos()==1) ? "%s" : "%s"', a:abbrev, a:expand, a:abbrev) +endfunc func! vimrc#AutoFmtToggle() abort if &formatoptions =~ 'a' diff --git a/.vimrc b/.vimrc --- a/.vimrc +++ b/.vimrc @@ -49,7 +49,8 @@ let s:filename = expand('') Plugin 'powerman/vim-plugin-viewdoc' Plugin 'powerman/vim-plugin-AnsiEsc' - let g:no_viewdoc_maps = 1 + let g:no_viewdoc_maps = 1 + let g:no_viewdoc_abbrev = 1 try execute 'source ' . s:filename . '.local-pre' @@ -127,8 +128,18 @@ if exists("g:loaded_mucomplete") set shortmess+=c endif -cabbr Q q -cabbr W w +" Command Aliases {{{ +command! -nargs=+ CAlias call vimrc#CommandAlias() +CAlias Q q +CAlias W w + +" make these default to one window/buffer too +CAlias doc ViewDoc! +CAlias help ViewDocHelp! +CAlias man ViewDocMan! +CAlias perldoc ViewDocPerl! +"}}} + "}}} " General settings {{{