Skip to content

A lightweight and ultra-fast Angular file navigation plugin for Neovim, written in Lua. Simple to install and has no dependencies.

License

Notifications You must be signed in to change notification settings

FlorianBx/ng-croissant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 

🥐 ng-croissant

 

✨ Angular navigation so smooth, you’ll want a coffee with it.
Jump instantly between your Angular files in Neovim. Lightning fast. Minimal setup.

 


🚀 Features

  • One key, instant jump: between .component.ts, .component.html, .component.spec.ts, .component.css and .component.scss
  • Smart pattern matching (no LSP required)
  • Lightweight: 100% Lua, zero dependencies
  • Works everywhere: Neovim-ready, dead simple codebase

 


📦 Installation

With lazy.nvim
{
  "florianbx/ng-croissant",
  config = function()
    local ng = require("ng-croissant");
    ng.setup()

    local keymap = vim.keymap
    keymap.set("n", "<leader>ac", ng.goto_component_ts,   { desc = "Go to component.ts" })
    keymap.set("n", "<leader>at", ng.goto_component_html, { desc = "Go to component.html" })
    keymap.set("n", "<leader>as", ng.goto_component_spec, { desc = "Go to component.spec.ts" })
    keymap.set("n", "<leader>acs", ng.goto_component_css, { desc = "Go to component.css" })
    keymap.set("n", "<leader>asc", ng.goto_component_scss, { desc = "Go to component.scss" })
  end
}

 

With Packer
use {
  "florianbx/ng-croissant",
  config = function()
    local ng = require("ng-croissant");
    ng.setup()

    local keymap = vim.keymap
    keymap.set("n", "<leader>ac", ng.goto_component_ts,   { desc = "Go to component.ts" })
    keymap.set("n", "<leader>at", ng.goto_component_html, { desc = "Go to component.html" })
    keymap.set("n", "<leader>as", ng.goto_component_spec, { desc = "Go to component.spec.ts" })
    keymap.set("n", "<leader>acs", ng.goto_component_css, { desc = "Go to component.css" })
    keymap.set("n", "<leader>asc", ng.goto_component_scss, { desc = "Go to component.scss" })
  end
}

 

Just copy, paste, and start coding!

 


⚡ Usage

Default keymaps:

Keybinding Action
<leader>ac Go to component.ts
<leader>at Go to component.html
<leader>as Go to component.spec.ts
<leader>acs Go to component.css
<leader>asc Go to component.scss

Files should follow standard Angular naming: foo.component.ts, foo.component.html, foo.component.spec.ts, foo.component.css, foo.component.scss.


Want your own keys? Example:

keymap.set("n", "<leader>ngt", ng.goto_component_html, { desc = "Go to component.html" })

 


🎯 How does it work?

ng-croissant uses simple filename pattern matching to quickly find and open your related Angular files.
No dependencies, no LSP, just smart file-based jumping.

 


❔ FAQ

Is Angular LSP required?

No, navigation is file-based and works out-of-the-box.

What if my files use a different naming convention?

It follows Angular’s defaults. For custom structures, feel free to adapt or PR!

Can I set custom keymaps?

Absolutely, just add your own vim.keymap.set lines.

 


🤝 Contributing

Open to issues, PRs, or suggestions!
Help keep it fast and simple!

 


🙌 Credits

The initial inspiration came from ng.nvim by joeveiga — thank you for lighting the path!

 


⚖️ License

MIT License © 2025 florianbx

About

A lightweight and ultra-fast Angular file navigation plugin for Neovim, written in Lua. Simple to install and has no dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages