~gpanders/dotfiles

ref: 5629911cfe9a2fc4e566bab14373aec451244000 dotfiles/vim/.vim/plugin/fzy.vim -rw-r--r-- 924 bytes
5629911cGreg Anders Fix bash syntax error in 'note' command 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
" fzy
" Author: Greg Anders <greg@gpanders.com>
" Date: 2019-10-02

if exists('g:loaded_fzy') || !executable('fzy')
    finish
endif
let g:loaded_fzy = 1

let s:save_cpo = &cpo
set cpo&vim

if executable('fd')
    let g:fzy_find_files_cmd = 'fd --type f'
elseif executable('rg')
    let g:fzy_find_files_cmd = 'rg --files'
elseif executable('ag')
    let g:fzy_find_files_cmd = 'ag -g '''''
elseif executable('find')
    let g:fzy_find_files_cmd = 'find . -type f'
endif

augroup plugin.fzy
    autocmd!
    " If in a git repo use git ls-files
    autocmd BufReadPost *
                \ if get(systemlist('git rev-parse --is-inside-work-tree'), 0, '') ==# 'true' |
                \   let b:fzy_find_files_cmd = 'git ls-files -co --exclude-standard' |
                \ endif
augroup END

nnoremap <silent> <C-P> :call fzy#files()<CR>
nnoremap <silent> <Space>t :call fzy#tags()<CR>

let &cpo = s:save_cpo
unlet s:save_cpo