Skip to content

Plugin to mix together various different sources of files to open

License

Notifications You must be signed in to change notification settings

andrewferrier/vim-fileselector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vim-fileselector

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.

Installation

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>

Understanding Sources of Files Shown

Currently it uses three sources:

  1. 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.

  2. git ls-files (only works if you are currently inside a git repo).

  3. find or fd - this is based off all files in a space-separated list of directories you specify in the g: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.

Ways of Speeding Up vim-fileselector

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.

Other Configuration Options

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.

About

Plugin to mix together various different sources of files to open

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published