aboutsummaryrefslogtreecommitdiff
path: root/vimrc.dot.link
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-20 14:41:06 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-09-20 14:41:06 -0300
commitd727c42ee8733b31e63e8ee8214bef9fe179e550 (patch)
treec627c419282e43cc40acc75dda1651077d2cbf42 /vimrc.dot.link
parent5c9463e9fe617459995ab9c3e6509622cd134a90 (diff)
downloadvim-d727c42ee8733b31e63e8ee8214bef9fe179e550.tar.gz
vim-d727c42ee8733b31e63e8ee8214bef9fe179e550.tar.bz2
Easier way to open project tabs with nerdtree
Diffstat (limited to 'vimrc.dot.link')
-rw-r--r--vimrc.dot.link16
1 files changed, 11 insertions, 5 deletions
diff --git a/vimrc.dot.link b/vimrc.dot.link
index 4f59ced..3255ed9 100644
--- a/vimrc.dot.link
+++ b/vimrc.dot.link
@@ -98,21 +98,27 @@ map m :q! <CR>
" NERDTree section
" Thanks to http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc
+" Open NERDTree when vim starts
"autocmd VimEnter * NERDTree
"autocmd VimEnter * wincmd p
autocmd FileType nerdtree set relativenumber
autocmd FileType taglist set relativenumber
-" Shortcut to open tree from bookmark
-cnoreabbrev NF NERDTreeFromBookmark
+function TabNew(bookmark)
+ execute ":tabnew"
+ execute ":NERDTreeFromBookmark " a:bookmark
+endfunction
function OpenNERDTree()
execute ":NERDTree"
- endfunction
- command -nargs=0 OpenNERDTree :call OpenNERDTree()
+endfunction
- nmap <ESC>t :OpenNERDTree<CR>
+" Shortcuts
+cnoreabbrev O NERDTreeFromBookmark
+command -nargs=1 -complete=customlist,nerdtree#completeBookmarks T :call TabNew(<f-args>)
+command -nargs=0 OpenNERDTree :call OpenNERDTree()
+nmap <ESC>t :OpenNERDTree<CR>
" See http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv
vmap <C-c> "+yi