Skip to content

Instantly share code, notes, and snippets.

@humus
Last active July 23, 2016 19:54
Show Gist options
  • Save humus/8b77857433121114a0506c44d5e39120 to your computer and use it in GitHub Desktop.
Save humus/8b77857433121114a0506c44d5e39120 to your computer and use it in GitHub Desktop.
nnoremap ygl :<C-u><C-r>=getline('.')<cr><cr>
nnoremap <silent> <C-p> :call CtrlPWhatTodoWhenCtrlpIsCalled()<cr>
nnoremap <silent> <C-n> :CtrlPMRU<cr>
fun! CtrlPWhatTodoWhenCtrlpIsCalled() "{{{
let actual_dir = getcwd()
let dir = projectroot#get()
if dir != ''
CtrlPMixed
elseif expand('%:t') == ''
CtrlPMRU
else
execute 'CtrlP ' . expand('%:p:h')
endif
endfunction "}}}
let g:filesep=!has('win32') ? '/' : '\'
noremap! %% <C-r>=expand('%:h') . g:filesep<cr>
let g:ctrlp_map = '&lt;F13&gt;'
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment