Skip to content

Commit

Permalink
FZF changes + autochdir
Browse files Browse the repository at this point in the history
  • Loading branch information
DawidJanczak committed Jan 6, 2017
1 parent 00eabef commit be74d73
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .vimrc
Expand Up @@ -78,7 +78,6 @@ Plug 'mtscout6/vim-cjsx'
Plug 'elixir-lang/vim-elixir'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" Plug '/usr/bin/fzf' | Plug 'junegunn/fzf.vim'

call plug#end()

Expand Down Expand Up @@ -163,6 +162,9 @@ set directory=~/tmp//
set tags+=./tags,tags;
set tags+=./gems.tags,gems.tags;

" lcd to current file's directory
set autochdir

" ==================================================
" ===== Search/replace section =====================
" ==================================================
Expand Down Expand Up @@ -269,6 +271,13 @@ nnoremap <leader>r ggO<esc>S#!/usr/bin/env ruby<cr><esc>^Dj
" binding.pry
nnoremap <leader>pry Orequire 'pry'; binding.pry<cr><esc>
" ctrl+p to open Files
function! s:find_git_root()
return system('git rev-parse --show-toplevel 2> /dev/null')[:-2]
endfunction
command! ProjectFiles execute 'Files' s:find_git_root()
nnoremap <silent> <C-p> :ProjectFiles <cr>
" ==================================================
" ===== Plugin settings ============================
" ==================================================
Expand Down Expand Up @@ -351,9 +360,6 @@ if has("autocmd")
au FileType go setlocal ts=2 sts=2 sw=2 noexpandtab
au FileType python setlocal ts=2 sts=2 sw=2 expandtab

" Set local working directory to current buffer file's directory
au bufenter * if expand('%:p') !~ '://' | :lchdir %:p:h | endif

" Auto source .vimrc file when saved
au bufwritepost .vimrc source $MYVIMRC

Expand Down

0 comments on commit be74d73

Please sign in to comment.