open ctrl.p files in same buffer

This commit is contained in:
Michael Campagnaro 2012-11-20 15:55:14 -05:00
parent 2e2bd3b3bb
commit 0266419cb8

16
.vimrc
View File

@ -19,10 +19,10 @@ map <leader>fh :CtrlP app/helpers<cr>
map <leader>fl :CtrlP lib<cr> map <leader>fl :CtrlP lib<cr>
map <leader>fp :CtrlP public<cr> map <leader>fp :CtrlP public<cr>
map <leader>fs :CtrlP app/stylesheets<cr> map <leader>fs :CtrlP app/stylesheets<cr>
let g:ctrlp_prompt_mappings = { "let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'], " \ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'], " \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ } " \ }
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" BASIC EDITING CONFIGURATION " BASIC EDITING CONFIGURATION
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -320,7 +320,7 @@ endfunction
" From http://vim.wikia.com/wiki/Move_current_window_between_tabs " From http://vim.wikia.com/wiki/Move_current_window_between_tabs
" Moves a window from one tab to another. " Moves a window from one tab to another.
function MoveToPrevTab() function! MoveToPrevTab()
"there is only one window "there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1 if tabpagenr('$') == 1 && winnr('$') == 1
return return
@ -340,9 +340,9 @@ function MoveToPrevTab()
endif endif
"opening current buffer in new window "opening current buffer in new window
exe "b".l:cur_buf exe "b".l:cur_buf
endfunc endfunction
function MoveToNextTab() function! MoveToNextTab()
"there is only one window "there is only one window
if tabpagenr('$') == 1 && winnr('$') == 1 if tabpagenr('$') == 1 && winnr('$') == 1
return return
@ -362,7 +362,7 @@ function MoveToNextTab()
endif endif
"opening current buffer in new window "opening current buffer in new window
exe "b".l:cur_buf exe "b".l:cur_buf
endfunc endfunction
map <C-m> :call MoveToNextTab()<CR><C-w>H map <C-m> :call MoveToNextTab()<CR><C-w>H
map <C-n> :call MoveToPrevTab()<CR><C-w>H map <C-n> :call MoveToPrevTab()<CR><C-w>H