π« CosmicNvim
CosmicNvim is a lightweight and opinionated Neovim config for web development, specifically designed to provide a π« COSMIC programming experience!
π Stellar Features
Native LSP
Full featured native LSP functionality!
- π Go-to definition
- π Find references/type def/declaration
- π‘ Code actions
- π¨ Statusline diagnostics
- π§ Formatting thanks to conform.nvim
Additional features
- Custom rename and code action popups via Cosmic-UI
- Amazing default theme via tokyonight.nvim
- UI enhancements via snacks.nvim and noice.nvim
- Enhanced syntax highlighting via nvim-treesitter
- Custom statusline via lualine
- File editor via oil.nvim
- Floating terminal with toggleterm.nvim
- LSP server management via mason.nvim
- Autocompletion via blink.cmp
- Snippet support via LuaSnip
- Session management via auto-session
- Easy to find keybindings via which-key.nvim
- Floating windows for references, renaming, diagnostics, code actions and more!
While CosmicNvim is geared specifically toward TypeScript/JavaScript development, it should be able to provide a great experience with any LSP supported language.
π Installation
Quick guide
Prerequisites
- Neovim 0.13.0+ (Nightly)
- Node.js (recommended for JS/TS tooling)
- prettierd (required for default JS/TS/CSS/HTML/JSON formatting)
Install
# move to config dir
cd ~/.config
# back up current config
cp -r nvim nvim.backup
# clone repository
git clone https://github.com/CosmicNvim/CosmicNvim.git nvim
# open nvim and install plugins
nvim
By default, this will assume the Cosmic git directory is placed at vim.fn.stdpath('config'), i.e. ~/.config/nvim.
If you are symlinking your pulled repo to ~/.config/nvim, you must define the shell environment variable
COSMICNVIM_INSTALL_DIR that points to your installation.
Additional CosmicNvim installation details.
Additional LSP server installation details.
CosmicNvim uninstallation details.
βοΈ Configuration
Plugin customization in lua/cosmic/config/config.lua uses:
plugins = { ... }for direct lazy.nvim specs{ 'repo/name', enabled = false }to disable a built-in plugin- another spec with the same repository ID to override a built-in plugin
lsp.servers.NAME = true | false | { ... }to enable, disable, or override an LSP server
Built-in LSP defaults come from nvim-lspconfig and are extended by after/lsp/*.lua. User config under
lsp.servers.NAME is merged on top of those defaults when the server is enabled.
Enabled servers are installed through Mason automatically.
Enabled servers are enabled by Cosmic with vim.lsp.enable().
disable_builtin_plugins, plugins.add, plugins.disable, plugins.opts, plugins.override, and lsp.servers.NAME.opts have been removed.
β¨ Cosmic Commands
Update CosmicNvim
Updates CosmicNvim to the latest version
:CosmicUpdate