summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2022-05-05 14:26:43 -0500
committerMitsuo Tokumori <[email protected]>2022-05-05 14:26:43 -0500
commit90f39c31e9f19bf51f0ceb9e21373dede01a4581 (patch)
tree767e3f88ba94e26db05685bab636b6aabd6a61cf /vim
parent57e7ad1f6d8fa823155ca414bba82ca2d497504f (diff)
parentaf0561f1d902d0fb84412ca6c301152ec44407c1 (diff)
downloaddotfiles-90f39c31e9f19bf51f0ceb9e21373dede01a4581.tar.gz
dotfiles-90f39c31e9f19bf51f0ceb9e21373dede01a4581.tar.bz2
dotfiles-90f39c31e9f19bf51f0ceb9e21373dede01a4581.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc25
1 files changed, 16 insertions, 9 deletions
diff --git a/vim/vimrc b/vim/vimrc
index bfa4e2b..42fcc69 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -16,10 +16,13 @@
" Variables
" ----------------------------------------------------------------------
-set undodir=~/.vim/undo
-set viewdir=~/.vim/view
-set directory=~/.vim/swap
-set viminfofile=~/.vim/viminfo
+" Get the first directory from the list in $VIMRUNTIMEPATH
+let $VIMFILES=split(&rtp,",")[0]
+set undodir=$VIMFILES/undo
+set viminfofile=$VIMFILES/viminfo
+set viewdir=$VIMFILES/view
+set directory=$VIMFILES/swap
+set viminfofile=$VIMFILES/viminfo
" Useful
@@ -142,8 +145,8 @@ set more " Enable more-prompt for listings that don't fit in
" Mappings
" ----------------------------------------------------------------------
" F1 is help, F11 is full screen (terminal emulator)
-map <F5> :source ~/.vim/vimrc<CR>
-map <S-F5> :e ~/.vim/vimrc<CR>
+map <F5> :source $VIMFILES/vimrc<CR>
+map <S-F5> :e $VIMFILES/vimrc<CR>
map <F7> :tabp<CR>
map <F8> :tabn<CR>
map <F9> :w<CR>:make<CR>
@@ -183,6 +186,9 @@ vmap gt :s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g<CR><C-L>
" output.)
" :%!jq .
+" NERDTree plugin
+nnoremap <C-t> :NERDTreeToggle<CR>
+
" Yanking and pasting
" ----------------------------------------------------------------------
@@ -214,7 +220,7 @@ set fileencoding=utf-8
" Functions
" ----------------------------------------------------------------------
" TODO: maybe replace with $runtimepath
-source ~/.vim/fun.vim
+source $VIMFILES/fun.vim
" Views and Sessions (Window layout and Line folding)
@@ -236,7 +242,7 @@ au BufWinEnter *.cpp silent loadview
" Snippets
" ----------------------------------------------------------------------
" I deleted the file accidently
-"nnoremap ,ch :-1r ~/.vim/snippets/cheader.c<CR>
+"nnoremap ,ch :-1r $VIMFILES/snippets/cheader.c<CR>
" File Browsing
@@ -278,7 +284,8 @@ inoremap <C-A> <Esc>diWi<C-R>=<C-R>"<CR>
"call plug#end()
" Other plugins
-"source ~/.vim/plugins/IndexedSearch.vim
+" I used to use IndexedSearch plugin. Functionality was incorporated into Vim
+" since Vim 8.1.1270.
set shortmess-=S