diff --git a/vim/vim.symlink/plugin/pick.vim b/vim/vim.symlink/plugin/pick.vim deleted file mode 100644 index a28472f..0000000 --- a/vim/vim.symlink/plugin/pick.vim +++ /dev/null @@ -1,60 +0,0 @@ -if !exists("g:pick_executable") - let g:pick_executable = "pick" -endif - -function! PickCommand(choice_command, pick_args, vim_command) - try - let selection = system(a:choice_command . " | " . g:pick_executable . " " . a:pick_args) - redraw! - if v:shell_error == 0 - try - exec a:vim_command . " " . selection - catch /E325/ - endtry - endif - catch /Vim:Interrupt/ - " Swallow the ^C so that the redraw below happens; otherwise there will be - " leftovers from pick on the screen - redraw! - endtry -endfunction - -function! PickFile() - call PickCommand(s:FileListCommand(), "", ":edit") -endfunction - -function! PickFileVerticalSplit() - call PickCommand(s:FileListCommand(), "", ":vsplit") -endfunction - -function! PickFileSplit() - call PickCommand(s:FileListCommand(), "", ":split") -endfunction - -function! PickFileTab() - call PickCommand(s:FileListCommand(), "", ":tabedit") -endfunction - -function! PickBuffer() - call PickCommand(s:BufferListCommand(), "", ":buffer") -endfunction - -function! PickTag() - call PickCommand(s:TagCommand(), "", ":tag") -endfunction - -function! s:FileListCommand() - return "find * -type f -o -type l" -endfunction - -function! s:BufferListCommand() - let bufnrs = filter(range(1, bufnr("$")), 'buflisted(v:val)') - let buffers = map(bufnrs, 'bufname(v:val)') - return 'echo "' . join(buffers, "\n") . '"' -endfunction - -function! s:TagCommand() - let l:tag_files = join(split(&tags, ","), " ") - - return "cat " . l:tag_files . " 2> /dev/null | awk -F$'\t' '{print $1}' | sort -u | grep -v '^!'" -endfunction diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index 7975382..b3beaad 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -69,70 +69,6 @@ set virtualedit=block " I am always adding /g. No longer, suckers! set gdefault -" Find files -" -" My fuzzy file finder has changed, but the commands I use to interact -" with it have not. These have the advantage of being close together on -" my keyboard, as well as vaguely mnemonic. - -let g:pick_executable = "pick" -let g:pick_index_file = ".pick_index" - -function! PickCommand(choice_command, pick_args, vim_command) - try - let selection = system(a:choice_command . " | " . g:pick_executable . " " . a:pick_args) - redraw! - if v:shell_error == 0 - try - exec a:vim_command . " " . selection - catch /E325/ - endtry - endif - catch /Vim:Interrupt/ - " Swallow the ^C so that the redraw below happens; otherwise there will be - " leftovers from pick on the screen - redraw! - endtry -endfunction - -function! s:FileListCommand() - if filereadable(g:pick_index_file) == 0 - echo "Rebuilding" - call system("find * -type f -o -type l > " . g:pick_index_file) - endif - - let l:choice_command = "cat " . g:pick_index_file - - return l:choice_command -endfunction - -function! s:BufferListCommand() - let bufnrs = filter(range(1, bufnr("$")), 'buflisted(v:val)') - let buffers = map(bufnrs, 'bufname(v:val)') - return 'echo "' . join(buffers, "\n") . '"' -endfunction - -function! PickBuffer() - call PickCommand(s:BufferListCommand(), "", ":buffer") -endfunction - -function! PickFile() - call PickCommand(s:FileListCommand(), "", ":edit") -endfunction - -function! PickFileVerticalSplit() - call PickCommand(s:FileListCommand(), "", ":vsplit") -endfunction - -function! RefreshPickIndex() - call system("rm " . g:pick_index_file) -endfunction - -nnoremap t :call PickFile() -nnoremap b :call PickBuffer() -nnoremap n :call PickFileVerticalSplit() -nnoremap :call RefreshPickIndex() - " Navigate to test, and back " Find test counterpart.