# HG changeset patch # User Meredith Howard # Date 1549565650 21600 # Node ID 60df63f038731e067452dc3b01c3c5f7c9176a56 # Parent 63d9df64906ecf41334972dc25ce4a97ea580d31 I don't really use these except for the cd shortcuts diff --git a/.vim/autoload/vimrc.vim b/.vim/autoload/vimrc.vim --- a/.vim/autoload/vimrc.vim +++ b/.vim/autoload/vimrc.vim @@ -30,3 +30,20 @@ func! vimrc#AutoSessionConfig() abort exec 'UniteSessionLoad ' . tolower(v:servername) endif endfunc + +func! vimrc#Gcd() abort + let root = system('git rev-parse --show-toplevel 2>/dev/null')[:-2] + if ! v:shell_error + exec 'cd ' . root + endif + pwd +endfunc + +func! vimrc#Hgcd() abort + let root = system('hg root 2>/dev/null')[:-2] + if ! v:shell_error + exec 'cd ' . root + endif + pwd +endfunc + diff --git a/.vimrc b/.vimrc --- a/.vimrc +++ b/.vimrc @@ -41,9 +41,6 @@ let s:filename = expand('') Plug 'vimwiki/vimwiki' - Plug 'tpope/vim-fugitive' - Plug 'ludovicchabant/vim-lawrencium' - Plug 'Shougo/vinarise.vim' Plug 'asciidoc/vim-asciidoc' Plug 'vim-perl/vim-perl' @@ -126,11 +123,17 @@ noremap tm :Tabularize methods a :call vimrc#AutoFmtToggle() -" Command Aliases {{{ +" Commands & Aliases {{{ command! -nargs=+ CAlias call vimrc#CommandAlias() +command! Gcd call vimrc#Gcd() +command! Hgcd call vimrc#Hgcd() + CAlias Q q CAlias W w +CAlias gcd Gcd +CAlias hgcd Hgcd + " make these default to one window/buffer too CAlias doc ViewDoc! CAlias help ViewDocHelp!