antoinemadec / coc-fzf Goto Github PK
View Code? Open in Web Editor NEWfzf :heart: coc.nvim
fzf :heart: coc.nvim
Newest nightly nvim, fzf, coc. Newest bat.
Arch linux, alacritty.
When calling coc-definition, e.g. through the example binding gd, the definition is not brought up in a floating window and instead jumps to the definition file like usual.
This doesn't occur with any other option, e.g. coc-references.
Hello.
I noticed that you just rollout some breaking changes. Basically my keymaps stopped working, not big deal, but took a bit to figure it out.
I don't have much experience with vim so, is there a mechanism to notify this breaking changes when you update? Do you plan to introduce more breaking changes?
thanks and regards
I hit the following error when exiting CocFzfList commands
as well as some other sources, but not all:\
Error detected while processing function coc_fzf#lists#fzf_run[10]..coc_fzf#commands#fzf_run[11]..fzf#run[63]..<SNR>18_callback:
line 21:
Vim(let):E684: list index out of range: 0
Error detected while processing function coc_fzf#lists#fzf_run[10]..coc_fzf#commands#fzf_run:
line 11:
E171: Missing :endif
Error detected while processing function coc_fzf#lists#fzf_run:
line 10:
E171: Missing :endif
MWE vimrc:
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/fzf', {'dir': '~/.fzf','do': './install --all'}
Plug 'junegunn/fzf.vim' " needed for previews
Plug 'antoinemadec/coc-fzf'
call plug#end()
nnoremap <silent> <space>c :<C-u>CocFzfList commands<CR>
Steps to repro:
Vim version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 21 2020 16:11:23)
Included patches: 1-814
Compiled by Arch Linux
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm +tcl/dyn
-autoservername +folding +multi_byte +termguicolors
+balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
+browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl/dyn +title
+clientserver +job +persistent_undo +toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall +python/dyn +visual
+conceal +linebreak +python3/dyn +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua/dyn +ruby/dyn +wildmenu
+dialog_con_gui +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent +X11
+dnd +mouse +sound -xfontset
-ebcdic +mouseshape +spell +xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval +mouse_gpm +statusline +xsmp_interact
+ex_extra -mouse_jsbterm -sun_workshop +xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.32/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
echo $FZF_DEFAULT_OPTS
:(nothing)
bat --version
:bat 0.15.4
yes
(n)vim --version
:(n)vim --version output
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
An additional position appears in the jump list when use coc-reference.
When i use coc-reference(gr), i select an item from the float window that pops up and jump to the reference position.
The beginning of the referenced file appears in the jump list and i can't go back via once CTRL-O.
This is the screeshot:
When i disable coc-fzf, no additional position apperas. And the screenshot(also expected) is:
" minimal vimrc
set nocompatible
filetype plugin indent on
syntax on
set hidden
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
Plug '~/.fzf'
Plug 'junegunn/fzf.vim'
Plug 'antoinemadec/coc-fzf'
call plug#end()
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
No additional position in jump list and i could jump back via once CTRL-O.
Thanks in advance.
The default CocList supports quickfix action for commands like <Plug>(coc-references)
. It adds the selected entries to vim's quickfix list so that users can inspect multiple references one by one. So it would be great if coc-fzf can handle multiple selection in a similar way.
I think the good starting point is s:ag_handler
used in fzf#vim#grep
.
Steps to reproduce:
:CocFzfList
Actual result:
Selected list is shown but in normal mode.
Expected result:
Terminal mode is used by default.
Solution: use this
call call(fname, arg_list)
Describe the solution you'd like
Sorry if this has already been implemented. CocList extensions
allows performing different actions on extensions. At the time of writing there are toggle, configure, open, disable, enable, lock, readme, reload, fix and uninstall. Is it possible to have these functions in coc-fzf as well? Currently it seems that coc-fzf is only able to toggle the selected extension if it's enabled.
Describe alternatives you've considered
Use CocList.
First, thanks for this!
I installed the plugin but it seems to be using the python interpreter for the current virtualenv I am in as opposed to using the python interpreter I set on python3_host_prog
(on neovim).
I installed the python neovim
module on the interpreter set by python3_host_prog
.
Also checked get_workspace_symbols
and saw #!/usr/bin/env python3
.
just like fzf-preview, it shows all reference in fzf float window
Would it make sense to support a way to search through all coc actions / commands you can do with coc?
Hello,
Thanks for this plugin. It is a life saver.
My normal use case would be to just trigger the main list, and navigate from there. However, the base command CocFzfList is ambiguous because it's name is a substring of all the others. Would it be possible to rename it so this is not the case?
Thanks!
I'm not getting a preview window when I run CocFzfList diagnostics
. Hitting "?" just types a "?" normally into the fuzzy finder; it doesn't make a preview window appear.
I have junegunn/fzf.vim
installed, and I do get a preview window when I use its commands, so I don't think I have any kind of global FZF configuration that's disabling it.
Hello, your plugin is great, I like it very much. I have a new feature request, Is it possible to add CocList
function, thank you.
Two things:
1- can be addressed with a tedious list of actions like: go 1 line down at the same col, insert next yank line etc. Don't forget to use keepjumps
2- can be addressed with nvim_paste()
... or at least with the last used element at the top.
CocList
seems to do this, keeping the previously selected element under the cursor when opening a list again, it's quite handy.
As the title. Currently it always shows the beginning of the files.
Print clean error when workspace symbols provider is not found, like in CocList:
[coc.nvim]Error on "CocList symbols": Workspace symbols provider not found for current document
if a unsupported command is given (e.g. :CocFzfList foo), we should a better message (e.g. [coc.nvim] List dd not found like :CocList does) than throwing lines of unhandled stacktraces.
The preview for the locations
list is awesome, it would be super if one could toggle a preview for diagnostic messages too. I had in mind the preview showing the full diagnostic message with line breaks and all, but I suppose also previewing the location would be nice to have too.
Hello! First, thanks for this package, is awesome
When using CocFzfList outline
and going to a definition, I can jump back but not forward, I think when going to the definition the jumps is not stored?
I tested with CocList outline
and the behaviour is correct, jumping back and forth after selecting an option
EDIT: I wanted to take a GIF for demonstration and did :clearjumps
and while I was testing, I saw that there are no jumps being stored, so can't go back or forward, which is not the case for just using :CocList outline
Present in CocList
but not in CocFzfList
are:
For some reason coc-fzf#common#fzf_selector_save
sometimes is being called when I am in neoterm. I don't understand why but it only happens sometimes and only stops after I restart neovim.
The only key that errors is the <CR>
, enter in my case.
I would like to use coc-fzf as the only interface to fzf.
Do you plan to support fzf.vim's :Files
, :Buffers
and other commands?
https://github.com/junegunn/fzf.vim#commands
In short, it means adding a :CocFzfList files
, :CocFzfList buffers
command or something like that.
Yanking this:
str="foo\nbar"
Will paste this if using CocFzfList yank
:
str="foo
bar"
Escaping the /n
of the original yank lines should fix this.
First of all, thanks for this super plugin, it was easy to set up and overall makes me very happy~
As a consequence of this it is not possible to navigate to the location of these diagnostic messages
Opening the file which contains the diagnostic via CocList
seems to make the filenames appear subsequently in CocFzfList
I'm happy to debug this a little if told where to start.
Below are two screenshots demonstrating the differing output of CocList
and CocFzfList
.
It would be nice to (in the presence of large, multi-line messages) be able to have a preview of the whole error message. A bonus would be to also display the diagnostic location in the file as is currently done.
I'm happy to be assigned this issue, although I can't promise when I'll get round to it.
Hi,
:CocFzfListCommands
are a counterpart of :CocList commands
and:CocFzfListDiagnostics
are of :CocList diagnostics
, etc.I personally these command names are quite verbose and cannot type them easily. Why not :CocFzf {commands, diagnostics}
, etc.? One can use their own command aliases or mappings, but wanted to see if it is something you may want to support officially.
Hi @antoinemadec
when i run command :CocFzfList symbols i got error
/Users/samhv/.config/nvim/plugged/coc-fzf/script/get_workspace_symbols.py /var/folders/7p/xqgf0dgs61q2c7g61bs3dc500000gn/T/nvimW3zUBj/0 3 4 'a'
Traceback (most recent call last):
File "/Users/samhv/.config/nvim/plugged/coc-fzf/script/get_workspace_symbols.py", line 52, in <module>
'getWorkspaceSymbols', args.query, int(args.bufnr))
File "/Users/samhv/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 299, in call
return self.request('nvim_call_function', name, args, **kwargs)
File "/Users/samhv/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
res = self._session.request(name, *args, **kwargs)
File "/Users/samhv/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 104, in request
raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:Error invoking 'CocAction' on channel 3 (coc):
Method "CocAction" not exists with coc.nvim
For Version
vim version: NVIM v0.4.3
node version: v14.2.0
coc.nvim version: 0.0.78
term: iTerm.app
platform: darwin
Python version: 3.7.7
pynvim version: 0.4.1
please help :(
I'm a developer of fzf-preview.vim.
I've recently been working on coc extensions as coc-fzf-preview.
I'm implementing Diagnostics and References for coc, can I refer to the coc-fzf syntax highlight?
If it's OK, I'd like to implement it and then link to the README.
It would be nice to get some feedback when loading an empty list, to distinguish "no diagnostics" from "my plugins are broken and this keybinding isn't working"
I think a simple echo "no diagnostics"
(swap "diagnostics" for whatever the list type is) should do.
This is a FZF issue and only happens when using:
Use FZF floating windows:
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
See: junegunn/fzf#2093
echo $FZF_DEFAULT_OPTS
: --layout=reverse --info=inlinebat --version
: bat 0.15.4(n)vim --version
:NVIM v0.5.0-634-g161cdba1e
Error on request (listDescriptions): Vim(return):Error invoking 'listDescriptions' on channel 3 (coc):
action "listDescriptions" not registered
Error detected while processing function coc_fzf#lists#fzf_run[1]..coc_fzf#common#get_list_sources:
line 1:
E712: Argument of map() must be a List or Dictionary
E712: Argument of extend() must be a List or Dictionary
" minimal vimrc
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'junegunn/fzf.vim'
\ | Plug 'junegunn/fzf', { 'do': {-> fzf#install()} }
\ | Plug 'tpope/vim-fugitive'
\ | Plug 'antoinemadec/coc-fzf'
if g:HasPlug('coc-fzf')
nnoremap <silent> <space>A :<C-u>CocFzfList diagnostics<CR>
nnoremap <silent> <space>a :<C-u>CocFzfList diagnostics --current-buf<CR>
nnoremap <silent> <space>c :<C-u>CocFzfList commands<CR>
nnoremap <silent> <space>e :<C-u>CocFzfList extensions<CR>
nnoremap <silent> <space>l :<C-u>CocFzfList<CR>
" nnoremap <silent> <space>l :<C-u>CocFzfList location<CR>
nnoremap <silent> <space>o :<C-u>CocFzfList outline<CR>
nnoremap <silent> <space>O :<C-u>CocFzfList symbols<CR>
nnoremap <silent> <space>s :<C-u>CocFzfList services<CR>
nnoremap <silent> <space>p :<C-u>CocFzfListResume<CR>
endif
:e myfile.py
A clear and concise description of what you expected to happen.
hello!
when running :CocFzfList symbols
and start writing a query, I get the following error:
[Command failed: python3 /home/mpostma/.config/nvim/plugged/coc-fzf/script/get_workspace_symbols.py /tmp/nvimUXWUTd/0 3 3 'f']
Any idea how to fix this ?
Is there any plans to add support for coc-bookmark plugin?
When I use the preview window in the diagnostic window I just see the error message
fork/exec /nix/store/jirzjbbpl4j2kl2f01cfnrralxr5aw7a-bash-interactive-4.4-p23/bin/bash: invalid argument
There are a couple of messages
but no smoking gun
"term://.//27510:( /nix/store/47xbab83hlcgslkxd3scmfvvj4axfsw7-vimplugin-coc-fzf-2020-03-06/share/vim-plugins/coc-fzf/script/get_lists.sh )|'fzf' '--multi' '--expect=ctrl-v,ctrl-x,ctrl-t' '--ansi' '--prompt=Coc Lists> ' '--layout=reve
rse-list' --no-height > /run/user/1000/nvimaRXPaQ/5;#FZF" line 25 of 25 --100%-- col 14
"term://.//27546:cat '/run/user/1000/nvimaRXPaQ/7'|'fzf' '--multi' '--expect=ctrl-v,ctrl-x,ctrl-t' '--ansi' '--prompt=Coc Diagnostics> ' '--layout=reverse-list' '--preview-window' 'up:50%' '--preview' ''\''/nix/store/x4dq0vy0mcfqrnhx2
pn48411k5bk67py-vimplugin-fzf-vim-2020-01-14/share/vim-plugins/fzf-vim/bin/preview.sh'\'' {}' '--bind' '?:toggle-preview' --no-height > /run/user/1000/nvimaRXPaQ/6;#FZF" line 25 of 25 --100%-- col 1
I am using the latest coc-fzf and fzf-vim
hello, I write let g:coc_fzf_preview='up:50%'
, but the preview window is still in the right.
This plugin does have issues with Vim:
gr
(needs to do :e to re-trigger highlights)gr
where the floating window seems to be empty and then opens in a tabSome of those issues might be related to other plugin (fzf, fzf.vim or coc.nvim).
For now, the easy fix is to use Neovim instead of Vim ๐
Is there a way to run :CocFzfList symbols
over the current word my cursor is on? If there was functionality to do something like CocFzfList symbols {mySymbol}
I could use expand('cword')
. But it looks like I have to enter the floating modal first via :CocFzfList symbols
then type the name of the symbol I'm searching.
This is a great plugin! I've hit one snag: if I run CocList -I symbols
and select a function, I'm taken to the beginning of the function definition, which is where I want to go. CocFzfList symbols
takes me to the end of the function body instead. This seems like a bug, although maybe there's just a configuration option I don't know about. I'm testing with TypeScript code using coc-tsserver
, in case that's helpful.
The character position of the syntax highlighting in the floating window is always offset by 1 character.
The error is shown in the above picture, who can fix it, thanks
Hi @asermax ,
Could you please also add the block/line/char info in CocFzfList yank
in order to match CocList yank
?
You can get the info from the yank file:
Do not hesitate to ask me any question ๐
Thanks,
Antoine
echo $FZF_DEFAULT_OPTS
:bat --version
: 0.15.4(n)vim --version
:NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/config -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/src -I/usr/local/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/deps-build/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/src/nvim/auto -I/tmp/neovim-20191107-85913-1wbgqz6/neovim-0.4.3/build/include
Compiled by [email protected]
Features: +acl +iconv +tui
When I try to open any CocFzfList, I get the following error:
It used to work previously but I'm not sure when it stopped working.
call plug#begin('~/.vim/plugins')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'}
Plug 'junegunn/fzf.vim'
Plug 'antoinemadec/coc-fzf', {'do': 'yarn install --frozen-lockfile && yarn run build'}
call plug#end()
nnoremap <silent><nowait> <space>c :<C-u>CocFzfList commands<cr>
The list of commands appearing in a FZF list.
when used
:CocInstall coc-fzf
I have this error message
[coc.nvim] Error on install coc-fzf: Error: Invalid response from https://registry.npmjs.org/coc-fzf: 404
It'd be nice if support was added for https://github.com/neoclide/coc-snippets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.