Created
June 4, 2024 17:25
-
-
Save ismasan/69d6137b4b74c396f12608a8cef553c2 to your computer and use it in GitHub Desktop.
NeoVim: run Rubocop on buffer save
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Run Rubocop on save | |
" Requires vim.o.xrc = true in NeoVim config | |
lua << EOF | |
vim.api.nvim_create_autocmd("BufWritePost", { | |
pattern = "*", | |
callback = function() | |
local file = vim.fn.expand('%:p') | |
vim.fn.system('your-command ' .. file) | |
end, | |
}) | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment