Skip to content

Instantly share code, notes, and snippets.

@ubermajestix
Created July 24, 2014 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubermajestix/4927250160a743088676 to your computer and use it in GitHub Desktop.
Save ubermajestix/4927250160a743088676 to your computer and use it in GitHub Desktop.
" ctags, ctrlp, NERDTree refresh
function Refresh()
echo "refreshing tags and files..."
silent !if [ -d .git ]; then git ls-files -c -o --exclude-standard | ctags -L -; else ctags -R; fi
if exists(":CtrlPClearAllCaches") == 2
CtrlPClearAllCaches
endif
if exists("t:NERDTreeBufName")
let nr = bufwinnr(t:NERDTreeBufName)
if nr != -1
exe nr . "wincmd w"
exe substitute(mapcheck("R"), "<CR>", "", "")
wincmd p
endif
endif
endfunction
map <silent> <Leader>r :call Refresh()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment