Neovim is great, but time-consuming to configure it works properly. I deal with it from 2021, and still change it weekly to fit my job at cooperation.
This configuration works properly with JavaScript, Python, Go, Rust, Lua, PHP and Java.
Kitty with Fira, Cascadia, and Mini-File-Icons
- Use ligature font, italic font and icon font. (Thanks to Kitty)
- Saving the last session. (Thanks to auto-session)
- Support debug (Thanks to Nvim-Dap)
- Support test (Thanks to Vim-Test)
- Support RESTFul api test. (Thanks to Rest.nvim)
- Support several language's snippet. (I get snippets from rafamadriz/friendly-snippets)
- Support Emmet. (Thanks to Emmet-Ls)
- Support lint and formatter. (Thanks to Efm-Langsever)
- All in one sidebar. (Explorer, Symbol, Debug)
- Install all plugins manually.
- React
- Svelte
- Tailwind
- Express
- Gin
- FastAPI
- Laravel
- Spring Boot
Language | LSP | Treesitter | Formatter | Lint | Debug | Test |
---|---|---|---|---|---|---|
Bash | 👍 | |||||
C | 👍 | |||||
CMake | 👍 | 👍 | 👍 | |||
CPP | 👍 | 👍 | 👍 | |||
CSS | 👍👍👍 | 👍 | 👍 | |||
Dart | 👍 | 👍 | 👍 | 👍👍 | ||
Dockerfile | 👍 | 👍 | 👍 | |||
Go | 👍 | 👍 | 👍👍 | 👍 | 👍 | 👍 |
Haskell | 👍 | 👍 | 👍 | |||
HTML | 👍👍👍 | 👍 | 👍 | |||
HTTP | 👍 | |||||
Java | 👍 | 👍 | 👍 | 👍 | 👍 | |
Javascript | 👍 | 👍👍 | 👍 | 👍 | ||
JSON | 👍 | 👍 | 👍 | |||
Lua | 👍 | 👍 | 👍 | |||
Markdown | 👍 | 👍 | 👍 | |||
PHP | 👍 | 👍 | 👍 | 👍 | ||
Python | 👍 | 👍 | 👍 | 👍 | ||
React | 👍👍 | 👍 | 👍 | |||
Rust | 👍 | 👍 | 👍 | 👍 | ||
Scala | 👍 | |||||
Solidity | 👍 | 👍 | 👍 | |||
Svelte | 👍👍 | 👍 | 👍 | |||
Tex | 👍 | 👍 | 👍 | |||
TOML | 👍 | |||||
Typescript | 👍 | 👍 | 👍 | 👍 | ||
XML | 👍 | 👍 | 👍 | |||
YAML | 👍 | 👍 | 👍 | |||
Zig | 👍 | 👍 |
Last updated Jan 2 2021
=====================================
Top 10 plugins slowing nvim's startup
=====================================
1 3.097 vim-test
2 1.636 nvim-scrollview
3 1.290 nvim-treesitter
4 0.467 nvim-cmp
5 0.400 vim-ultest
6 0.398 nvim-ts-autotag
7 0.326 indent-blankline.nvim
8 0.163 cmp_luasnip
9 0.162 LuaSnip
10 0.156 cmp-path
=====================================
Find more in wiki
All settings are store in lua/settings.lua
return {
efm = {
filetypes = {
'css',
'cpp',
'dart',
'dockerfile',
'go',
'html',
'java',
'javascript',
'javascriptreact',
'json',
'lua',
'markdown',
'php',
'python',
'rust',
'svelte',
'tex',
'typescript',
'typescriptreact',
'xml',
'yaml',
},
},
lspconfigs = {
filetypes = {
'cmake',
'css',
'cpp',
'dart',
'dockerfile',
'go',
'haskell',
'html',
'javascript',
'json',
'lua',
'php',
'python',
'rust',
'svelte',
'tex',
'xml',
-- 'yaml',
'zig',
},
features = {
'efm',
'emmet',
'tailwindcss',
},
},
autoformat = {
filetypes = {
'cmake',
'css',
'cpp',
'dart',
'dockerfile',
'go',
'html',
'java',
'javascript',
'javascriptreact',
'json',
'lua',
'markdown',
'php',
'python',
'rust',
'svelte',
'tex',
'typescript',
'typescriptreact',
'xml',
'yaml',
},
},
colors = {
red = '#F9867B',
orange = '#CD9731',
yellow = '#FDCE68',
green = '#A3EEA0',
cyan = '#6796E6',
blue = '#7BE2F9',
purple = '#E19EF5',
tomato = '#F44747',
white = '#FFFFFF',
background = '#212835',
dark_background = '#1B212C',
border = '#3E4451',
comment = '#5C6370',
lineNumber = '#495162',
scrollbar = '#4E5666',
cursorLine = '#2C313A',
indent = '#383C44',
},
signs = {
DiagnosticSignError = ' ',
DiagnosticSignWarning = ' ',
DiagnosticSignHint = ' ',
DiagnosticSignInfo = ' ',
CodeActionSign = ' ',
},
kinds = {
Class = ' (class)',
Color = ' (color)',
Constant = ' (constant)',
Constructor = ' (constructor)',
Enum = ' (enum)',
EnumMember = ' (enum member)',
Event = ' (event)',
Field = ' (field)',
File = ' (file)',
Folder = ' (folder)',
Function = ' (function)',
Interface = ' (interface)',
Keyword = ' (keyword)',
Method = ' (method)',
Module = '{} (module)',
Operator = ' (operator)',
Property = ' (property)',
Reference = ' (reference)',
Snippet = ' (snippet)',
Struct = ' (enum)',
Text = ' (text)',
TypeParameter = ' (type parameter)',
Unit = ' (unit)',
Value = ' (value)',
Variable = ' (variable)',
},
statusline = {
git_branch_enabled = true,
diagnostic_enabled = true,
git_diff_enabled = true,
line_column_enabled = true,
tab_enabled = true,
line_break_enabled = true,
file_format_enabled = true,
efm_enabled = true,
emoji_enabled = true,
emoji_icon = '',
},
}
- Kitty
- Neovim 0.7.0-dev (Last updated Feb 1 2021)
- mini-file-icons
- Fira code (Or any ligature font)
- Cascadia (Or any italic font)
font_family FiraCode Nerd Font Mono
bold_font Cascadia Code
italic_font Cascadia Mono
bold_italic_font Cascadia Code
symbol_map U+e900-U+e954 mini-file-icons
font_size 16
cursor #6796E6
If you plan to install plugins manually, you can clone below plugins and
store in ~/.local/share/nvim/site/pack/*/start/
.
Plugin | Last updated |
---|---|
aerial | Mar 11 2022 |
auto-session | Feb 20 2022 |
cmp-nvim-lsp | Feb 15 2022 |
cmp-nvim-lsp-signature-help | Feb 15 2022 |
cmp-path | Feb 3 2022 |
cmp_luasnip | Jan 2 2022 |
dashboard-nvim | Apr 17 2021 |
diffview.nvim | Feb 21 2022 |
friendly-snippets | Mar 5 2022 |
git-utils.nvim | |
gitsigns.nvim | Mar 9 2022 |
goto-preview | Dec 25 2021 |
indent-blankline.nvim | Mar 9 2022 |
LuaSnip | Mar 11 2022 |
nvim-autopair | Mar 6 2022 |
nvim-bufferline.lua | Mar 9 2022 |
nvim-cmp | Mar 2 2022 |
nvim-colorizer.lua | Apr 20 2020 |
nvim-dap | Mar 9 2022 |
nvim-dap-ui | Mar 5 2022 |
nvim-dap-virtual-text | Feb 19 2021 |
nvim-jdtls | Jan 27 2022 |
nvim-lspconfig | Mar 9 2022 |
nvim-mini-file-icons | |
nvim-scrollview | Feb 27 2022 |
nvim-toggleterm.lua | Feb 27 2022 |
nvim-treesitter | Mar 11 2022 |
nvim-ts-autotag | Mar 1 2022 |
nvim-ts-context-commentstring | Dec 13 2021 |
nvim-ts-rainbow | Feb 23 2022 |
plenary.nvim | Mar 4 2022 |
rest.nvim | Jan 26 2022 |
tabout.nvim | Dec 15 2021 |
telescope-fzf-native.nvim | Feb 19 2022 |
telescope.nvim | Mar 11 2022 |
vim-test | Mar 8 2022 |
vim-ultest | Mar 2 2022 |
yanil |
Check wiki
Check wiki
Check wiki
Check wiki
Check wiki
Check wiki
Key | Description |
---|---|
<Leader>0 | Add break point |
<Leader>1 | Toggle debug |
<Leader>2 | Step over |
<Leader>3 | Step into |
<Leader>4 | Step out |
<Leader>9 | Scope information |
<Leader>a | Code action |
<Leader>b | Toggle Explorer |
<Leader>c | Range format |
<Leader>d | Go to definition |
<Leader>e | Search Gitmojis |
<Leader>f | Search text |
<Leader>g | Toggle git hover |
<Leader>m | Format code |
<Leader>o | Search buffers |
<Leader>p | Search file |
<Leader>q | Turn off search's highlight |
<Leader>r | Rename variable |
<Leader>s | Save file |
<Leader>t | Toggle test |
<Leader>u | Toggle debug sidebar |
<Leader>v | Run Restful API |
<Leader>w | Delete current buffer |
<Leader>x | Toggle symbol sidebar |
<Leader>z | Preview definition |
<Leader>/ | Toggle comment |
<M-t> | Toggle terminal |
<M-r> | Toggle rest |
jk | Insert to normal |
gh | Go to left window |
gj | Go to below window |
gk | Go to above window |
gl | Go to right window |
]d | Go to next diagnostic |
[d | Go to previous diagnostic |
]b | Go to next buffer |
[b | Go to previous buffer |
]q | Go to next tab |
[q | Go to previous tab |
]t | Go to next failed test |
[t | Go to previous failed test |
]x | Go to next function |
[x | Go to previous function |
If you want some languages that I don't support yet, then you can follow these steps to add manually.
The first thing I do is check nvim-treesitter and install parser for this language. After this step, your editor will highlight your syntax.
Then, you may want to find LSP in here
. After you've installed the LSP, you need to create a file in /after/ftplugin
,
/lug/languages
.
-- /lua/langauges/your-language.lua
local lsp = require('languages.lsp')
local M = {}
M.lsp_server = '<name of LSP>'
M.lsp = {
capabilities = lsp.capabilities,
on_attach = lsp.on_attach,
-- Any extra configuration should put there
}
return M
-- /after/ftplugin/your-language.lua
vim.opt.indentexpr = 'nvim_treesitter#indent()' -- Optional, If you use indent of treesitter
require('cmp').setup.buffer({
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- Optional, If you use snippet
{ name = 'path' }, -- Optional, If your language need path
{ name = 'nvim_lsp_signature_help' }, -- Optional, If your language has signature
},
})
You also need to add your language to /lua/settings.lua
-- /lua/settings.lua
return {
lspconfigs = {
filetypes = {
'cmake',
'<your lanugage>',
'zig',
},
},
}
If you know that there are formatters and linters for this language. Then you
need to install these tools first and go to /lua/languages/<your language>.lua
-- /lua/languages/<your language>.lua
M.efm = {
{
formatCommand = 'formatter1',
formatStdin = true,
},
{
formatCommand = 'formatter2',
formatStdin = true,
},
{
lintCommand = 'linter1',
lintIgnoreExitCode = true,
lintStdin = true,
lintFormats = {
'Your linter format',
},
},
}
M.all_format = { efm = 'Formatter1 Formatter2 Linter1' }
M.default_format = 'efm'
If you want debug when you need to check this
- Show theme in wiki
- Support Flutter
- Perfect center dashboard header and show dashboard if there is no buffer.
- Use nix to manage package.
- Support reload configuration in this
- Add test summary to sidebar
- Change highlight of nvim-dap-ui
- Change highlight of vim-ultest
- Handle lsp_extension
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.