fzf changes and nerd tree updates

nvim
KeeganForelight 2 years ago
parent ac77126f7f
commit 1bd30f8f27

47
vimrc

@ -46,11 +46,15 @@ let g:airline_symbols.dirty = ''
let NERDTreeHighlightCursorLine=1
let NERDTreeQuitOnOpen=1
autocmd StdinReadPre * let s:std_in=1
" auto open on empty
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" prevent replacing the buffer
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" nerdtree binds
nnoremap <silent> <leader>n :NERDTree<CR>
nnoremap <silent> <leader>t :NERDTreeToggle<CR>
nnoremap <silent> <leader>t :NERDTreeMirror<CR>:NERDTreeToggle<CR>
" nnoremap <C-f> :NERDTreeFocus<CR> going to conflict with fzf and I dont use
" this anyway
"
@ -62,24 +66,36 @@ let g:vimtex_quickfix_mode=0
" fzf settings
set rtp+=~/.fzf
" let g:fzf_preview_window = ['right:50%', 'ctrl-/']
" let g:fzf_buffers_jump = 1
" " Customize fzf colors to match your color scheme
" " " - fzf#wrap translates this to a set of `--color` options
" TMUX support
if exists('$TMUX')
let g:fzf_layout = { 'tmux': '-p60%,70%' }
else
let g:fzf_layout = { 'window': { 'width': 0.6, 'height': 0.7} }
let g:fzf_layout = { 'window': { 'width': 0.6, 'height' : 0.7 }}
endif
" " fzf functions and keybinds
" command! -bang -nargs=? -complete=dir Find
" \ call fzf#vim#files(<q-args>, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), <bang>0)
nnoremap <silent> <leader>f :FZF<CR>
nnoremap <silent> <leader>F :FZF $HOME<CR>
" nnoremap <silent> <leader>g :GFiles<CR>
" fzf default find
command! -bang -nargs=? -complete=dir Files
\ call fzf#run(fzf#wrap(
\ { 'source': 'find * -type f',
\ 'dir': <q-args>,
\ 'options': [
\ '--layout=reverse',
\ '--info=inline',
\ '--preview', 'bat --color=always {}']},
\ <bang>0))
" git support via filtering
command! -bang -nargs=? -complete=dir GFiles
\ call fzf#run(fzf#wrap(
\ { 'source': 'git ls-files',
\ 'dir': <q-args>,
\ 'options': [
\ '--layout=reverse',
\ '--info=inline',
\ '--preview', 'bat --color=always {}']},
\ <bang>0))
nnoremap <silent> <leader>f :Files<cr>
nnoremap <silent> <leader>g :GFiles<CR>
" nnoremap <silent> <leader>s :GFiles?<CR>
" tweaking timeout to quit instatnly via esc
@ -96,4 +112,5 @@ inoremap <left> <NOP>
inoremap <right> <NOP>
" jq formating
noremap <silent> gj :%!gojq .<cr>
" noremap <silent> gj :%!gojq .<cr>
" not worth the hassle of randomly formatting my text

@ -157,6 +157,6 @@ alias nalgene="$HOME/bin/water 32"
export FZF_DEFAULT_OPTS='--layout=reverse --border'
alias bat="batcat"
#alias bat="batcat" Only needed on ubuntu/debian
alias tt="$HOME/bin/timetracker"

Loading…
Cancel
Save