add more fzf goodies

feature/improve-speed
bretello 2021-09-26 17:32:11 +02:00
parent 38f7bf2c60
commit 6a1bba6bbd
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
6 changed files with 24 additions and 7 deletions

View File

@ -92,6 +92,10 @@ alias pvim='poetry run vim'
alias pshell='poetry shell' alias pshell='poetry shell'
alias venv='source .venv/bin/activate' alias venv='source .venv/bin/activate'
# Run fzf with file preview
alias pf="fzf --preview='BAT_STYLE='header,changes' bat --color=always {}' --bind shift-up:preview-page-up,shift-down:preview-page-down"
alias fgitlog="git log --oneline | fzf --multi --preview 'git -p show --color=always {+1}"
# dotfiles user aliases # dotfiles user aliases
if [[ -f ~/.dotfiles_aliases ]]; then if [[ -f ~/.dotfiles_aliases ]]; then
source $HOME/.dotfiles_aliases source $HOME/.dotfiles_aliases

View File

@ -14,7 +14,7 @@ robbyrussell/oh-my-zsh path:plugins/pyenv
robbyrussell/oh-my-zsh path:plugins/pylint robbyrussell/oh-my-zsh path:plugins/pylint
robbyrussell/oh-my-zsh path:plugins/sudo robbyrussell/oh-my-zsh path:plugins/sudo
robbyrussell/oh-my-zsh path:plugins/vi-mode robbyrussell/oh-my-zsh path:plugins/vi-mode
robbyrussell/oh-my-zsh path:plugins/zsh-navigation-tools robbyrussell/oh-my-zsh path:plugins/fzf
robbyrussell/oh-my-zsh path:plugins/zsh_reload robbyrussell/oh-my-zsh path:plugins/zsh_reload
zdharma/fast-syntax-highlighting zdharma/fast-syntax-highlighting
zsh-users/zsh-autosuggestions zsh-users/zsh-autosuggestions

View File

@ -177,3 +177,7 @@ let g:ackprg = 'rg --vimgrep --no-heading'
"" Quickpeek "" Quickpeek
" Automatically open the quickpeek window " Automatically open the quickpeek window
let g:quickpeek_auto = v:true let g:quickpeek_auto = v:true
"" Fzf
let g:fzf_layout = { 'down': '~40%' }"

View File

@ -40,8 +40,15 @@ Plug 'https://github.com/maxbrunsfeld/vim-yankstack'
" Mark indentation level " Mark indentation level
Plug 'https://github.com/nathanaelkane/vim-indent-guides' Plug 'https://github.com/nathanaelkane/vim-indent-guides'
" Quickpeek " Meson + Ninja
Plug 'https://github.com/AndrewRadev/quickpeek.vim' Plug 'https://github.com/igankevich/mesonic'
if g:uname == "Darwin"
" mac
Plug '/usr/local/opt/fzf'
elseif g:uname == "Linux"
Plug '/usr/bin/fzf'
end
" snipmate " snipmate
Plug 'https://github.com/MarcWeber/vim-addon-mw-utils' Plug 'https://github.com/MarcWeber/vim-addon-mw-utils'

View File

@ -92,7 +92,8 @@ map <leader>nn :NERDTreeToggle<CR>
"" CtrlP "" CtrlP
" Quickly find and open a recently opened file " Quickly find and open a recently opened file
map <leader>o :CtrlPBuffer<CR> map <leader>o :CtrlPBuffer<CR>
map <leader>j :CtrlP<CR> map <leader>j :call fzf#run({'sink': 'edit', 'options': '--preview="BAT_STYLE=header,changes bat --color=always {}"', 'down': '40%'}) <CR>
map <leader>f :CtrlPMRUFiles<CR> map <leader>f :CtrlPMRUFiles<CR>
map <leader>T :CtrlPBufTag<CR> map <leader>T :CtrlPBufTag<CR>
map <leader>t :CtrlPTag<CR> map <leader>t :CtrlPTag<CR>
@ -111,10 +112,9 @@ nmap <leader>za :Goyo 80%x85%<CR>
nmap <leader>zz :Goyo<CR> nmap <leader>zz :Goyo<CR>
""Misc stuff ""Misc stuff
let s:uname = system('uname | tr -d "\n"') " Get platform name (stripping the trailing newline) if g:uname == "Darwin"
if s:uname == "Darwin"
"" Mac specific stuff "" Mac specific stuff
elseif s:uname == "Linux" elseif g:uname == "Linux"
"" Linux specific stuff "" Linux specific stuff
function! s:WaylandYank() function! s:WaylandYank()
if v:event['regname'] == '+' || (v:event['regname'] == 'w' && s:plus_to_w) if v:event['regname'] == '+' || (v:event['regname'] == 'w' && s:plus_to_w)

View File

@ -1,4 +1,6 @@
" Install all plugins " Install all plugins
let g:uname = system('uname | tr -d "\n"') " Get platform name (stripping the trailing newline)
source $DOTFILES/vim/plugs.vim source $DOTFILES/vim/plugs.vim
" Sanity " Sanity