cloudhead / neovim-fuzzy Goto Github PK
View Code? Open in Web Editor NEWMinimalistic fuzzy file finding for neovim
License: BSD 3-Clause "New" or "Revised" License
Minimalistic fuzzy file finding for neovim
License: BSD 3-Clause "New" or "Revised" License
Is it possible to use FuzzyOpen
to open files in a split or a tab?
Thanks!
:tab drop file
In this buffer when you run :FuzzyOpen
it matches on filenames in open buffers, not all the files in git. If you switch to any other buffer it will behave normally, but switch back to the "bugged" buffer and it won't work.
However if you :tab drop
from a buffer with an open file then :FuzzyOpen
will work fine.
Could be a bug with neovim.
Add a command to fuzzy search in opened buffers. I usually open all the files I need but navigating through them is not fun, it would be cool if I could :FuzzyBuffer
and switch to buffer I need.
I installed fzy on my desktop and moved over the init.vim file to my laptop but I could not figure out why it would not load the plugin. I checked vim-plug, my neovim installation and reinstalled my plugins several times. I decided to look at the plugin and I saw
if exists("g:loaded_fuzzy") || &cp || !executable('fzy') || !has('nvim')
finish
endif
Perhaps a warning would be better? Silently not registering the plugin isn't very good UX
with fzf.vim, I was able to add this:
function! s:with_git_root()
let root = systemlist('git rev-parse --show-toplevel')[0]
return v:shell_error ? {} : {'dir': root}
endfunction
command! -nargs=* FzfGit call fzf#vim#ag(<q-args>, extend(s:with_git_root(), g:fzf#vim#default_layout))
map <C-s> :FzfGit
which meant that control-s would do a search of the contents of all the git files, and then I could fuzzy find the list, and then hit enter and open the found file. what's the best way to do this with neovim-fuzzy?
Hi I installed this on Ubuntu and it works great - on my mac though - whenever I use :FuzzyOpen it starts the search from the root directory - rather than my current directory. It's possible it's something in my setup but I can't think what - my init.vim is the same for both machines.
when trying to run :FuzzyOpen
, on OSX(OSX El Capitan, iTerm2 3.0.9, zsh 5.2, fzy 0.7, neovim 0.1.4), and centos(centos 7.0.1406, iTerm2 3.0.9, zsh 5.0.8, fzy 0.7, neovim 0.1.4):
Error detected while processing function <SNR>104_fuzzy_open[36]..<SNR>104_fuzzy:
line 42:
E117: Unknown function: win_getid
E15: Invalid expression: win_getid()
Press ENTER or type command to continue
Opening a file is now changing the cwd of vim or fzy such that subsequent uses of FuzzyOpen only search the folder the last file was found in.
Someone's leaving colors in the output, and it looks as if nvim can't open the file because of that:
I tried adding --nocolor
to https://github.com/cloudhead/neovim-fuzzy/blob/master/plugin/neovim-fuzzy.vim#L12, but it didn't help...
With this configuration in the vim config:
let g:fuzzy_opencmd = 'tab drop'
After opening one file via :FuzzyOpen
then run :FuzzyOpen
again in the buffer that was just opened then fzy
matches on the files open in vim buffers and not the files in the git repository as usual
Or at least there should be an option to let you select whether filenames are also matched.
I often use the grep feature of my old plugin to grab the files that have included another file, with the way :FuzzyGrep currently works it obfuscates the results I want.
Thank you for this great plugin! fzy accepts an option to pre-populate a query:
-q, --query=QUERY
Use QUERY as the initial search query.
It would be really useful if neovim-fuzzy exposed a function that would pass this value to fzy. My use case, for example, is that I want to write a simple plugin to open FuzzyOpen with a modified version of the current buffer's filename pre-populated (e.g. to quickly jump to a test file or some other similarly named file).
I started on an implementation of this, but I wasn't sure the right public interface to expose. Here's what I have so far: https://github.com/schreifels/neovim-fuzzy/commit/2e98b3351769d6d67b21b55c56075d07b4b9be53
Let me know your thoughts. Thanks!
It seems to ignore hidden files by default. How can we make it also include hidden results? - Joe
Hi, if the file is already open in another window and/or tab, is there a way to automatically go to that window instead of opening the file again? It would be a behaviour like :sbuffer.
Thanks!
Hi @cloudhead, amazing plugin. I was only looking for a files fuzzy finder but now I'm also impressed by the :FuzzyGrep
UX. I just miss the :cn
and :cp
commands. Would it be possible to populate the quick fix list with the :FuzzyGrep
results?
Thanks beforehand.
Is possible to ignore files or folders? can be an example added to the readme?
When I bring up the finder, how can I enable finding "hidden" files? For example, if I have a file named .config
, it currently doesn't appear in my search results if I search for "config". Is there a way to enable this?
Right now, this plugin seems to only find files within pwd
. I write a lot of Django projects that have a structure like this:
apps/
app1/
app2/
settings.py
urls.py
templates/
base.html
app1/
app2/
...
If I cd into apps/app1
and open a file for editing, I can't hit CTRL+P to find/open base.html
, for example, because base.html
doesn't live under apps/app1
. ctrlp.vim searches for all files within the project root by default (I guess it detects all files within the current Python environment?). Is there a way for this plugin to do the same?
Since the update to neovim v0.2, using ag for file listing in neovim-fuzzy produces a Vim(call):E5060: unknown flag 'w'
.
See:
https://github.com/neovim/neovim/pull/6427/files#diff-deb695d507653839019814f54242d47bR17430
The culprit lies here:
https://github.com/cloudhead/neovim-fuzzy/blob/master/plugin/neovim-fuzzy.vim#L73
Changing this line to call writefile(a:ignorelist, ignorefile, 's')
fixes the issue.
This happens when fuzzy_opencmd
is set to tabe
(or tab drop
or any other command that opens the result in a new tab).
e.g. say I am in a project called project
inside subdirectory subdir
which contains two files, file1
and file2
.
When I open the first file with neovim-fuzzy, say file1
then the file1
tab corrrectly has project/subdir
as its cwd
. Now if I open a second file while the file1 tab is focussed, say file2
then the new tab with file2
in it has the correct cwd
of project/subdir
but the file1
tab now has a cwd
of project
.
Then if I were to open a third file with neovim-fuzzy
, while looking at the file2
tab, now that tab will also have a cwd
of the project root. It always sets the cwd
of the "current" tab to the project root.
Whenever I call FuzzyOpen in a directory that's under a git repository, it yields an error:
Error detected while processing function <SNR>70_fuzzy_open:
line 2:
E344: Can't find directory "^[[1 q/home/afnan/dev/gfx_research/sampleview" in cdpath
E472: Command failed
This seems to only occur in git repositories, or subfolders under a git repository. FuzzyGrep is not affected. If this is relevant, I'm running Linux 4.19.11.
I get this error. really cant remember what i did :'( Trying to figure out why. help much appreciated!
:FuzzyOpen
E79: Cannot expand wildcards
Error detected while processing function 23_fuzzy_open:
line 2:
E344: Can't find directory "stty: stdin isn't a terminal" in cdpath
E472: Command failed
Press ENTER or type command to continue
" -------
" Python
" -------
let g:python3_host_prog = '/Users/u606/.pyenv/versions/neovim3/bin/python'
let g:python_host_prog = '/Users/u606/.pyenv/versions/neovim2/bin/python'
" ----
" Set
" ----
set nocursorline
set encoding=utf8
set nocp " 'compatible' is not set
set number
set shiftwidth=2
set expandtab
autocmd Filetype ruby setlocal tabstop=2
autocmd Filetype rb setlocal tabstop=2
let g:ackprg = 'ag --nogroup --nocolor --column'
" -------
" PLUGINS
" -------
call plug#begin('~/.config/nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'w0rp/ale'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'carlitux/deoplete-ternjs', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'othree/jspc.vim', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'mxw/vim-jsx'
Plug 'cloudhead/neovim-fuzzy'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Plug 'neomake/neomake' "| Plug 'dojoteef/neomake-autolint'
Plug 'mhartington/oceanic-next'
Plug 'ervandew/supertab'
Plug 'ternjs/tern_for_vim', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'SirVer/ultisnips'
Plug 'tpope/vim-cucumber'
Plug 'tpope/vim-fugitive'
" Plug 'ryanoasis/vim-devicons'
Plug 'tpope/vim-surround'
Plug 'honza/vim-snippets'
Plug 'benmills/vimux'
" Plug 'terryma/vim-multiple-cursors'
" Plug '~/.config/nvim/scripts/ColDevicons'
call plug#end()
"
" ----------------------
" PLUGIN CONFIGURATIONS
" ----------------------
" ---------
" DevIcons
" ---------
let g:WebDevIconsUnicodeDecorateFileNodesDefaultSymbol='๐ฉ '
if exists('g:loaded_webdevicons')
""" call webdevicons#refresh()
endif
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:DevIconsEnableFoldersOpenClose = 1
let g:webdevicons_gui_glyph_fix = 1
" ---------
" Deoplete
" ---------
" let g:deoplete#enable_at_startup = 1
let g:deoplete#omni#functions = {}
let g:deoplete#omni#functions.javascript = [
\ 'tern#Complete',
\ 'jspc#omni'
]
" ---------
" Nerd Tree
" ---------
nnoremap :NERDTreeToggle
"autocmd vimenter * NERDTree "// Open the tree by default
let NERDTreeShowHidden=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" ---------
" Neomake
" ---------
"jcall neomake#configure#automake('n')
" -----------
" UltiSnips
" -----------
let g:UltiSnipsExpandTrigger=""
let g:UltiSnipsJumpForwardTrigger=""
let g:UltiSnipsJumpBackwardTrigger=""
let g:UltiSnipsEditSplit="vertical"
" ---------
" AUTOCMD
" ---------
autocmd BufNewFile,BufRead *.sharedrc set syntax=perl
" Jump to the main window.
autocmd VimEnter * wincmd p
" ----------
" REMAPS
" ----------
nnoremap :FuzzyOpen
noremap s :w
filetype plugin indent on
" --------
" Airline
" --------
let g:airline_powerline_fonts = 1
syntax on
set termguicolors
" Visual Mode Orange Background, Black Text
hi Visual guifg=#000000 guibg=#FD971F
" Default Colors for CursorLine
highlight CursorLine guibg=#3E3D32
highlight Cursor guibg=#A6E22E;
" Change Color when entering Insert Mode
autocmd InsertEnter * highlight CursorLine guibg=#323D3E
autocmd InsertEnter * highlight Cursor guibg=#00AAFF;
" Revert Color to default when leaving Insert Mode
autocmd InsertLeave * highlight CursorLine guibg=#3E3D32
autocmd InsertLeave * highlight Cursor guibg=#A6E22E;
colorscheme monokai
syntax enable
Hello, fantastic plugin! Tried it for the first time today and I think it's brilliant (have previously used a lot of different file finders, most recently using fzf
.)
One thing I've always used with my file finders is a buffer finder. It would be awesome if fuzzy supported buffer search too.
Keep up the great work!
Error when run FuzzyOpen in neovim:
Error detected while processing function 36_fuzzy_open:
line 22:
Vim(let):E118: Too many arguments for function: 263
Env:
OS: Ubuntu 16.04.1 LTS
NVIM: 0.2.0-dev
How can I open a file in a new tab instead of replacing the currently open file tab?
It seems like one of the last commits introduced a little bug: Some times FuzzyOpen
doesn't show any terminal buffer and I need to manually look for them using :b
(ewww). I say they disappear because usually they show at least once.
Disclaimer: I am completely new to all of this.
Ubuntu 17.04, ag 1.0.2, fzy 0.9, nvim v0.2.1-dev
FuzzyGrep works
FuzzyOpen prints out
Error detected while processing function <SNR>9_fuzzy_open:
line 24:
Vim(call):E5060: Unknow flag: w
my best guess is writefile call
I don't have hg installed, and whenever I try to fuzzy search it gives an error (every time), and after I hit enter it works fine. I found solution to the problem, that is to manually set g:fuzzy_rootcmds
to only have the programs you have on the system (for me it's git).
I get an error message saying --path-to-ignore
is not a valid argument.
Changing to --path-to-agignore
seems to fix the issue.
I'm running ag version 0.31.0.
Why do they even show up!?
I get following error when trying to use this plugin:
Error detected while processing function <SNR>17_fuzzy:
line 47:
E117: Unknown function: win_getid
E15: Invalid expression: win_getid()
Neovim version: 0.1.4
Terminal: Gnome Terminal
$TERM: xterm-256color
system: Fedora 23
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.