https://github.com/llllvvuu/nvim-js-actions
`nvim-treesitter`-based actions on JavaScript code
https://github.com/llllvvuu/nvim-js-actions
Last synced: about 2 months ago
JSON representation
`nvim-treesitter`-based actions on JavaScript code
- Host: GitHub
- URL: https://github.com/llllvvuu/nvim-js-actions
- Owner: llllvvuu
- License: mit
- Created: 2023-07-22T15:58:53.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-20T13:22:41.000Z (almost 2 years ago)
- Last Synced: 2025-04-13T01:29:30.135Z (about 2 months ago)
- Language: Lua
- Size: 4.88 KB
- Stars: 19
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `nvim-treesitter`-based actions on JavaScript code
I would have considered as `null-ls` code actions but unfortunately that project is retiring.
## with `lazy.nvim`
```lua
local js_filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
}return {
{
"llllvvuu/nvim-js-actions",
ft = js_filetypes,
dependencies = { "nvim-treesitter/nvim-treesitter" },
init = function()
vim.api.nvim_create_autocmd(
"FileType",
{
pattern = js_filetypes,
command = "nnoremap ta " ..
":lua require('nvim-js-actions').js_arrow_fn.toggle()"
-- can also do `require('nvim-js-actions/js-arrow-fn').toggle()`
}
)
end
}
}
```## `js_arrow_fn`
Toggles between `function` and `=>` syntax.https://github.com/llllvvuu/nvim-js-actions/assets/5601392/69d436f2-4801-4521-8e58-3e22810914ed