From 0011ebad6e1f4b7de1ebb84a9ba6c352aa0b919d Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Wed, 5 Apr 2017 14:37:57 +0200 Subject: [PATCH] FZF fuzzy completion Vim Signed-off-by: Tomas Slusny --- .gitmodules | 3 --- README.md | 2 -- vim/.vim/bundle/tmux-complete.vim | 1 - vim/.vimrc | 18 ++++++++++++++++++ zsh/.zsh/bundle/ix.plugin.zsh | 2 +- 5 files changed, 19 insertions(+), 7 deletions(-) delete mode 160000 vim/.vim/bundle/tmux-complete.vim diff --git a/.gitmodules b/.gitmodules index f4b9acfa..8f554f68 100644 --- a/.gitmodules +++ b/.gitmodules @@ -95,9 +95,6 @@ [submodule "vim/.vim/bundle/committia.vim"] path = vim/.vim/bundle/committia.vim url = https://github.com/rhysd/committia.vim -[submodule "vim/.vim/bundle/tmux-complete.vim"] - path = vim/.vim/bundle/tmux-complete.vim - url = https://github.com/wellle/tmux-complete.vim [submodule "vim/.vim/bundle/editorconfig-vim"] path = vim/.vim/bundle/editorconfig-vim url = https://github.com/editorconfig/editorconfig-vim diff --git a/README.md b/README.md index 017b3d5e..7953f63f 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,6 @@ To add your own Vim, Tmux or Zsh plugin you can just clone it to proper insert mode completions with Tab * [syntastic](https://github.com/scrooloose/syntastic): Syntax checking hacks for vim - * [tmux-complete.vim](https://github.com/wellle/tmux-complete.vim): Vim plugin - for insert mode completion of words in adjacent tmux panes * [tsuquyomi](https://github.com/Quramy/tsuquyomi): A Vim plugin for TypeScript * [ultisnips](https://github.com/SirVer/ultisnips): The ultimate snippet solution for Vim diff --git a/vim/.vim/bundle/tmux-complete.vim b/vim/.vim/bundle/tmux-complete.vim deleted file mode 160000 index e74076df..00000000 --- a/vim/.vim/bundle/tmux-complete.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e74076df2b6ec443f4b52fda96b4f5e8c87d1814 diff --git a/vim/.vimrc b/vim/.vimrc index 5013ca66..7c806747 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -357,6 +357,7 @@ command! -bar Session :call Session() " VimWiki let g:vimwiki_list = [{'path': '~/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}] let g:vimwiki_global_ext=0 +let g:vimwiki_table_mappings = 0 " EditorConfig let g:EditorConfig_core_mode = 'external_command' " Speed up editorconfig plugin @@ -393,6 +394,23 @@ nmap mT :TestSuite nmap mtt :TestNearest " FZF {{{ + +" Fuzzy completion +function! FzfCompletionPop(findstart, base) + if !a:findstart + " let b:SuperTabChain = ( &omnifunc, &tmuxcomplete#complete, "" ) + " let res = SuperTabCodeComplete(a:findstart, a:base) + let l:res = function(&omnifunc)(a:findstart, a:base) + call fzf#complete(l:res) + endif + + return '' +endfunction +set completefunc=FzfCompletionPop +imap (fzf-complete-word) +imap (fzf-complete-path) +imap (fzf-complete-line) + " rg command suffix, [options] function! VRg_raw(command_suffix, ...) return call('fzf#vim#grep', extend(['rg --no-heading --column --color always '.a:command_suffix, 1], a:000)) diff --git a/zsh/.zsh/bundle/ix.plugin.zsh b/zsh/.zsh/bundle/ix.plugin.zsh index f87aec63..f736ede0 100644 --- a/zsh/.zsh/bundle/ix.plugin.zsh +++ b/zsh/.zsh/bundle/ix.plugin.zsh @@ -29,5 +29,5 @@ ix() { } echo "^C to cancel, ^D to send." } - curl $opts -F f:1='<-' $* ix.io/$id + curl --http1.0 $opts -F f:1='<-' $* ix.io/$id }