A Neovim plugin for more efficient navigation in framework projects.
This plugin provides specific movements for frontend navigation patterns.
Add support for frameworks with simular type of navigation, like next.js approuter.
While working with frameworks like SvelteKit, I found myself constantly jumping between related files:
+page.svelte
and its corresponding +page.server.ts
Telescope & harpoon doesn't really solve this because this is depenent on the file you currently are in.
+layout.svelte
file & upwardsUsing lazy.nvim:
return {
"rossvold/frontend-movements.nvim",
config = function()
require("sveltekit-movements").setup()
end
}
Default keymaps:
<leader>sc
- Jump to nearest parent +layout.svelte
<leader>ss
- Jump to +page.server.ts/js
<leader>sl
- Jump to nearest parent +layout.svelte
<leader>sh
- Jump to nearest parent +hooks.server.ts
<leader>sa
- Toggle between +page.svelte
and +page.server.ts
The plugin can be configured through the setup function. The default configuration is:
require("sveltekit-movements").setup({
-- default keybinds
-- Jump to spesific file
page_keymap = '<Leader>sc', -- Jump to +page.svelte
server_keymap = '<Leader>ss', -- Jump to +page.server.ts
layout_keymap = '<leader>sl', -- Jump to nearest layout file
hooks_keymap = '<leader>sh', -- Jump to nearest hooks file
-- Toggles
toggle_keymap = '<Leader>sa', -- Alternate between page/server
})
You can customize these keybindings to your preference by modifying the keymap values.
MIT, do whatever bro