Note: For now I have stopped using this plugin personally, in favour of a local and simpler implementation using a shell script. I will continue to consider pull reqs for this repo, but otherwise please do not expect much change. If anyone is interested in taking it over, please contact me.
--
This is a vim plugin which allows you to quickly open files from a variety of sources using fzf as a file selector. It is similar in spirit to fzf-z, but operates on files, not directories, and is a vim plugin, not a zsh plugin.
Requires Vim 8+ or NeoVim for pop-up window support.
Ensure you have the fzf vim plugin installed first.
Then, install this plugin like any other vim plugin.
Once installed, you need to configure a key to open the list, like this:
nnoremap <silent> <Leader>e :FileSelectorDisplay<CR>
Currently it uses three sources:
-
The MRU (most recently used) files you've used in vim.
vim-fileselector
keeps track of that itself, so you don't need another plugin or list. -
git ls-files
(only works if you are currently inside a git repo). -
find
orfd
- this is based off all files in a space-separated list of directories you specify in theg:fileselector_extra_dirs
environment variable. For example:
let g:fileselector_extra_dirs = ['~/stuff', '/tmp']
If highlight is installed,
vim-fileselector
will use it highlight the file contents in the preview
window. If it's not, it will gracefully degrade to unhighlighted contents.
vim-fileselector
will run faster if
ripgrep or
fd and GNU
grep are available (the latter is not
available by default on OS X). It
will autodetect and use these tools if present.
You can set patterns for excluded files from being stored in
vim-fileselector
's MRU list:
let g:fileselector_exclude_pattern = ['.*\.pdf', '\.DS_Store']
All patterns are ORed together and evaluated using vim's own regex engine.
If you want to override the color scheme used by highlight
, set for example
HIGHLIGHT_OPTIONS="solarized-dark"
in your environment (see man highlight
for more information.