diff --git a/vimrc b/vimrc index c793341..63c47b0 100644 --- a/vimrc +++ b/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! \w" | execute 'buffer'.buf | endif " nerdtree binds nnoremap n :NERDTree -nnoremap t :NERDTreeToggle +nnoremap t :NERDTreeMirror:NERDTreeToggle " nnoremap :NERDTreeFocus 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(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) -nnoremap f :FZF -nnoremap F :FZF $HOME -" nnoremap g :GFiles +" fzf default find +command! -bang -nargs=? -complete=dir Files + \ call fzf#run(fzf#wrap( + \ { 'source': 'find * -type f', + \ 'dir': , + \ 'options': [ + \ '--layout=reverse', + \ '--info=inline', + \ '--preview', 'bat --color=always {}']}, + \ 0)) + +" git support via filtering +command! -bang -nargs=? -complete=dir GFiles + \ call fzf#run(fzf#wrap( + \ { 'source': 'git ls-files', + \ 'dir': , + \ 'options': [ + \ '--layout=reverse', + \ '--info=inline', + \ '--preview', 'bat --color=always {}']}, + \ 0)) + +nnoremap f :Files +nnoremap g :GFiles " nnoremap s :GFiles? " tweaking timeout to quit instatnly via esc @@ -96,4 +112,5 @@ inoremap inoremap " jq formating -noremap gj :%!gojq . +" noremap gj :%!gojq . +" not worth the hassle of randomly formatting my text diff --git a/zshrc b/zshrc index e590d66..5562d6d 100644 --- a/zshrc +++ b/zshrc @@ -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"