Execute pathaction.yaml rules using the pathaction command-line tool from Vim.
(The pathaction command-line tool enables the execution of specific commands on targeted files or directories. Its key advantage lies in its flexibility, allowing users to handle various types of files simply by passing the file or directory as an argument to the pathaction
tool. The tool uses a .pathaction.yaml
rule-set file to determine which command to execute. Additionally, Jinja2 templating can be employed in the rule-set file to further customize the commands.)
Below are two examples of key bindings (<leader>ee
to execute the "main" tag and <leader>ei
to execute the "install" tag):
nnoremap <leader>ee :call pathaction#run("main")<CR>
nnoremap <leader>ei :call pathaction#run("install")<CR>
Copyright (C) 2021-2025 James Cherti.
Distributed under terms of the MIT license.
mkdir -p ~/.vim/pack/jamescherti/start
cd ~/.vim/pack/jamescherti/start
git clone --depth 1 https://github.com/jamescherti/vim-pathaction
vim -u NONE -c "helptags vim-pathaction/doc" -c q
You can also install this Vim plugin with any third-party plugin manager such as Pathogen or Vundle.
- vim-pathaction @GitHub
- The
pathaction
command-line tool (requirement): pathaction - For Emacs users: pathaction.el @GitHub, an Emacs package that allows executing the
pathaction
command-line tool directly from Emacs.