Shortcut action list powered by fzf
fuzzy-finding.
Offshore cognitive effort into a persistent, project-specific list of repeating actions. Common use cases include:
- Go to faraway files: config files, system headers, repos you're basing your project off...
- Execute arbitrary vim commands (including shell commands)
- Update and source an action list tailored to your current project
This plugin requires you to have fzf.vim first.
Using vim-plug:
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'pabsan-0/vim-actions'
If unused, the plugin will set <leader>q
as default mapping to call the action list.
The point of this plugin is speed, nonetheless you can also call it via the slower :Actions
.
Your personal default list of actions can be defined in your ~/.vimrc
by setting the variable g:actions_list
. Find an example below.
About action lists:
- Notice the usage of the
|
to separate action names and targets. - Lines will be displaying in reverse, i.e top-to-bottom, in the fzf menu.
- Empty lines are to make chunks out of the actions, and will reflect on the fzf menu.
let g:actions_list = [
\ ["Source local rc | :source .vimrc "],
\ ["Edit local rc | :edit .vimrc "],
\ [" "],
\ [".gitconfig | ~/.gitconfig "],
\ [".vimrc | ~/.vimrc "],
\ [" "],
\ ]
For project-specific actions, use a local .vimrc
file at the root of your project that updates g:actions_list
.
Here's a few examples on how this file may look like.
vim-actions/samples/.vimrc-extend
Lines 4 to 10 in be959d1
vim-actions/samples/.vimrc-replace
Lines 4 to 7 in be959d1
For maximum convenience, your default action list should include an action to source this file. An extra custom mapping to handle this file is not recommended, since it only gives you more stuff to think about.