Update .vimrc
This commit is contained in:
		
							parent
							
								
									f44006fa82
								
							
						
					
					
						commit
						349f52b6bf
					
				
							
								
								
									
										31
									
								
								.vimrc
								
								
								
								
							
							
						
						
									
										31
									
								
								.vimrc
								
								
								
								
							| 
						 | 
				
			
			@ -41,34 +41,3 @@ set smartindent
 | 
			
		|||
set tabstop=4
 | 
			
		||||
set shiftwidth=4
 | 
			
		||||
 | 
			
		||||
" ctrlp with plugins
 | 
			
		||||
" see https://ctrlpvim.github.io/ctrlp.vim/
 | 
			
		||||
" set runtimepath^=~/.vim/bundle/ctrlp.vim
 | 
			
		||||
 | 
			
		||||
" add git root to path
 | 
			
		||||
function! AddGitRootToVimPath()
 | 
			
		||||
  if executable('git')
 | 
			
		||||
    let l:git_root = system('git -C ' . expand('%:p:h') . ' rev-parse --show-toplevel 2>/dev/null')
 | 
			
		||||
    if v:shell_error == 0
 | 
			
		||||
      let l:git_root = substitute(l:git_root, '\n', '', 'g')
 | 
			
		||||
      execute 'set path+=' . l:git_root . '/**'
 | 
			
		||||
    endif
 | 
			
		||||
  endif
 | 
			
		||||
endfunction
 | 
			
		||||
 | 
			
		||||
autocmd BufEnter * call AddGitRootToVimPath()
 | 
			
		||||
 | 
			
		||||
" homemade ctrl-p
 | 
			
		||||
set path+=**
 | 
			
		||||
set wildmenu
 | 
			
		||||
set wildmode=longest:full,full
 | 
			
		||||
set wildoptions=pum,fuzzy
 | 
			
		||||
set wildignore+=*.o,*.a,*.class,*.pyc,*/node_modules/*,*/dist/*
 | 
			
		||||
nnoremap <C-p> :tabfind<Space>*
 | 
			
		||||
 | 
			
		||||
" ctrl-j for terminal
 | 
			
		||||
nnoremap <C-j> :below terminal ++rows=10<CR>
 | 
			
		||||
 | 
			
		||||
" ctrl-k-b for explorer
 | 
			
		||||
nnoremap <C-k><C-b> :30Vex<CR>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue