Replace vim-picker with telescope
This commit is contained in:
parent
e7c411ec77
commit
891a610718
49
init.vim
49
init.vim
@ -92,11 +92,14 @@
|
|||||||
" Fuzzy finding
|
" Fuzzy finding
|
||||||
" Plug 'jhawthorn/fzy' " Install this systemwide (or configure a manual
|
" Plug 'jhawthorn/fzy' " Install this systemwide (or configure a manual
|
||||||
" location. See below)
|
" location. See below)
|
||||||
Plug 'srstevenson/vim-picker'
|
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
Plug 'jesseleite/vim-agriculture'
|
Plug 'jesseleite/vim-agriculture'
|
||||||
|
|
||||||
|
" vim-telescope (and dependencies)
|
||||||
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
|
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
|
||||||
|
|
||||||
" line indentation guides
|
" line indentation guides
|
||||||
Plug 'Yggdroot/indentLine'
|
Plug 'Yggdroot/indentLine'
|
||||||
|
|
||||||
@ -487,46 +490,28 @@ if !(has('win32') || has('win64'))
|
|||||||
" nnoremap ¬ :PickerEdit ~/jobxx/<cr>
|
" nnoremap ¬ :PickerEdit ~/jobxx/<cr>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! CallPickerEdit()
|
function! FuzzyFileFinder()
|
||||||
let l:IsInGitRepo = system('git rev-parse --is-inside-work-tree')
|
let l:IsInGitRepo = system('git rev-parse --is-inside-work-tree')
|
||||||
if l:IsInGitRepo =~ 'true'
|
if l:IsInGitRepo =~ 'true'
|
||||||
let l:GitRepoDir = system('git rev-parse --show-toplevel')
|
let l:GitRepoDir = system('git rev-parse --show-toplevel')
|
||||||
execute 'PickerEdit ' . l:GitRepoDir
|
execute 'Telescope find_files cwd=' . l:GitRepoDir->fnameescape()
|
||||||
else
|
else
|
||||||
execute 'PickerEdit ' . glob('~/')
|
execute 'Telescope find_files cwd=' . glob('~/')->fnameescape()
|
||||||
" TODO: Verify if this works
|
|
||||||
" if $USER =~ '^knyff$'
|
|
||||||
" " TODO: Make PickerEdit work on windows
|
|
||||||
" execute 'PickerEdit C:\User\' . $USER
|
|
||||||
" PickerEdit C:\User\knyff\
|
|
||||||
" else
|
|
||||||
" PickerEdit ~/
|
|
||||||
" endif
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! CallPickerPDF()
|
nnoremap ¬ :call FuzzyFileFinder()<cr>
|
||||||
let l:IsInGitRepo = system('git rev-parse --is-inside-work-tree')
|
|
||||||
if l:IsInGitRepo =~ 'true'
|
function! OpenPDFInsteadOfBuffer()
|
||||||
" TODO: Make this work
|
echo expand('%')->fnameescape()
|
||||||
" let l:CurrBufNr = bufnr('%')
|
call system('zathura ' . expand('%')->fnameescape() . ' &')
|
||||||
let l:GitRepoDir = system('git rev-parse --show-toplevel')
|
bd
|
||||||
call picker#File('git ls-files --cached --exclude-standard --others', 'te zathura', l:GitRepoDir)
|
|
||||||
" execute 'b '.l:CurrBufNr
|
|
||||||
else
|
|
||||||
" let l:OldBufNr = bufnr('%')
|
|
||||||
" echo bufnr('%')
|
|
||||||
execute 'tabedit'
|
|
||||||
call picker#File('find ' . glob('~/') . ' -type f', 'te zathura')
|
|
||||||
" let l:CurrBufNr = bufnr('%')
|
|
||||||
" echo bufnr('%')
|
|
||||||
" execute 'tabclose'
|
|
||||||
" execute 'b '.l:CurrBufNr
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap ¬ :call CallPickerEdit()<cr>
|
augroup OpenExternalFiles
|
||||||
nnoremap ¿ :call CallPickerPDF()<cr>
|
au!
|
||||||
|
au FileType pdf call OpenPDFInsteadOfBuffer()
|
||||||
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" NeoMake {{{
|
" NeoMake {{{
|
||||||
|
Loading…
Reference in New Issue
Block a user