Nvim
Archived. I'm using LazyVim now. Check here: https://github.com/ysl2/lazyvim
Install / Use
/learn @ysl2/NvimREADME
[!NOTE] Archived. I'm using LazyVim now. Check here: https://github.com/ysl2/lazyvim
ysl2/nvim: An ultimate modern neovim pure lua configuration that focuses on KISS principle
TLDR:
- Single main file: There is only one main file
./lua/ysl/init.luawhich contains common configuration and lots of common plugins.- All things you need: language server support & auto completion & diagnostics, file tree, motion, bookmark, register, edit history, buffer & window control, terminal, git, session save & auto restore like vscode, colors & highlight & outlooks, fuzzy find & global replace, remote ssh, markdown image paste & markdown preview
- Original keymap: I don't like to define many custom keymaps so I try my best to keep native keymaps and only map some functions or applications.
- Very fast: All plugins are lazyloaded so you can gain best performance of this configuration.
- Clean: The files are clean and well structured so that you can easily understand and modify them to fit your needs.
- Choose your own: I provide a local config file
./lua/ysl/localhost.luaso that you can cover some default settings like: which colorscheme, which lsp backend, which file to require, add your own plugin list. For example, You can select your lsp backend flavor from./lua/ysl/lsp/nvim_lsp.luaor./lua/ysl/lsp/coc.lua, default isnvim_lsp, choose the one you like from these two files, write it into./lua/ysl/localhost.lua.- Integration with others: VSCode's neovim extension support, Chrome input frame edit support.
Introduction
The configuration is built to fit my needs, might also fit yours. Feel free to use it.
Insights from:
- Boilerplate:
kickstart.nvimshows the single file structure, I think it has more benefits than lots of files especially when you're debugging with lots of plugins. - Distributions:
LunarVim&LazyVim&NvChadprovide the most popular plugins list. - Collections:
awesome-neovimprovides more special-interest plugins. - Personal configs:
FledgeXu/NeovimZero2Herofor minimal lsp & cmp configuration,theniceboy/nvimfor some useful plugins. - Other websites:
chatGPT,Google,Github,Reddit,Stackoverflow, etc.
Prerequisites, install, update
Prerequisites
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1723675123
Run "nvim -V1 -v" for more info
- Linux/Mac/Windows:
<!-- - Neovim version >= 0.10.0 -->
- A build tool: Essential, for enhance telescope performance, choose one below depends on your system.
make(for MacOS and Linux only)cmake(for Windows only)
- A C compiler
clangorgcc(if Linux/Mac, choose one between them; else if Windows, clang recommended): Essential, for nvim-treesitter support. ripgrep: Essential, for fuzzy search and replace.nodejsandyarn: Essential, for some lsp support, markdown preview, andcoclanguage server backend support.- pip package:
- pynvim (essential, for coc-snippets and builtin functions support).
- A
nerd-font: Optional, but recommended. - xsel (For linux:
sudo apt install xsel)
- A build tool: Essential, for enhance telescope performance, choose one below depends on your system.
- Only Windows:
Visual Studio C/C++ Build ToolsandWindows SDK: Only essential for windows users, for telescope-fzf-native.nvim plugin build process.powershell 7: Only essential for windows users, for terminal support.
Install & update
# Install
# Option 1. On Linux/MacOS
git clone git@github.com:ysl2/nvim.git ~/.config/nvim
# Option 2. On Windows
git clone git@github.com:ysl2/nvim.git %LOCALAPPDATA%\nvim
# Dependencies
pip install pynvim
# Update: Choose an option below.
# Option 1. If you don't add some modification, you can simply pull from the origin url.
git pull origin master
# Option 2. If you have modified some code yourself, you should fetch then you might need to merge your configuration with origin url
git fetch origin && git merge origin/master --no-edit
Project structure tree, and how to replace the default settings with your local configuration
Project structure tree
❯ tree --dirsfirst
.
├── lua |
│ └── ysl |
│ ├── lsp | Choose one LSP backend between them.
│ │ ├── coc.lua | Coc LSP backend.
│ │ └── nvim_lsp.lua | Nvim built-in LSP backend.
│ ├── init.lua | Main configuration file.
│ ├── localhost.lua | Self local configuration, for overriding some default value. Default not exists, needs to be created by yourself.
│ └── utils.lua | Some useful functions.
├── scripts | Some build scripts stored here.
│ └── build_snippets.py |
├── templates |
│ ├── snippets | Snippets folder.
│ │ ├── cython.json -> python.json |
│ │ ├── lua.json |
│ │ ├── package.json | Used by LuaSnip to recognize snippets folder structure.
│ │ └── python.json |
│ ├── cspell.json | Words whitelist for cspell diagnostic in markdown file.
│ └── eisvogel.latex | Markdown to Latex template.
├── coc-settings.json | Coc settings file.
├── init.lua | Project entrance. Nvim will read this file first.
├── lazy-lock-coc.json | Plugins version tracking file, for coc branch.
├── lazy-lock.json | Only be created when lsp backend is nil. E.g, when you use neovim into vscode by vscode's neovim plugin.
├── lazy-lock-nvim_lsp.json | Plugins version tracking file, for nvim_lsp branch.
├── LICENSE |
└── README.md |
6 directories, 19 files
Replace the default settings with your local configuration
Put the code below into ./lua/ysl/localhost.lua
-- ./lua/ysl/localhost.lua
local M = {}
-- M.requires, default value: { 'ysl.lsp.coc' }
M.requires = {
'ysl.lsp.nvim_lsp' -- Use nvim_lsp to override default LSP backend (default: coc).
-- 'ysl.lsp.coc'
}
-- M.plugins, default value: {}
-- You can add some plugins into the table, lazy.nvim plugins manager will load them.
-- M.plugins = {
-- vim = { 'someone/balabala' },
-- coc = { 'coc-ltex' }
-- }
-- M.config, default value: {}
M.config = {
utils = {
github = { -- For swiching to China github mirror.
ssh = 'git@git.zhlh6.cn:',
raw = 'https://mirror.ghproxy.com/https://github.com/'
},
},
vim = {
opt = {
-- WARNING: Transparency is an experimental feature now.
-- winblend = 70 -- Uncomment this to enable transparency.
-- -- M.vim.opt.colorscheme, default value: { 'folke/tokyonight.nvim' }
-- -- You can specify `colorscheme` to override default colorscheme.
-- colorscheme = {
-- 'catppuccin/nvim',
-- name = 'catppuccin',
-- lazy = false,
-- priority = 1000,
-- config = function()
-- vim.cmd.colorscheme('catppuccin-mocha')
-- end
-- }
}
}
}
return M
Keymaps
check conflicts example: :verbose imap
| key | command | note | | --- | ------- | ---- | | | | |
Systems
Plugins management system
Color & outlook system
Transparency
Experimental now. Not recommended.
GUI font size and color
-
Change font and size:
set guifont=consolas:h20 -
Check highlight group:
" Check the highlight group under cursor: :Inspect
Session system
File system
LSP system
About debugger: My neovim configuration does not provide inner debugger like nvim-dap. Integrate an inner debugger is not a hard work, but I prefer using other more powerful outer debugger.
You can find language-specific outer debuggers below.
You can check current buffer's filetype by :set filetype?.
Python
-
Python environment dependencies
# For coc (not tested on nvim_lsp): pip install jedi ruff-lsp sourceryConfigure ruff:
-
Linter
// coc-settings.json // ruff check --help "ruff.lint.args": [ "--ignore", "F401" ] -
Formatter
// coc-settings.json // ruff format --help "ruff.format.args": [ "--config", // Ref: https://docs.astral.sh/ruff/formatter/#configuration "format.quote-style='single'" ]
-
-
Python debugger
Again, my neovim configuration does not provide inner debugger like
nvim-dap. Integrate an inner debugger is not a hard work, but I prefer using other outer debugger.For python, there are several pip libs can support debug. E.g,
pdb,ipdb,pudb.Another choice is to use some logger like
pysnooper,loguru.# pdb is python built-in library, so you don't need to install it via pip. Just import it. pip install ipdb pudb pysnooper loguru -
sourcery
This config will auto dynamically read
~/.config/sourcery/auth.yaml(this is the default sourcery config file) to load the sourcery token. -
mypy
# Install stubs mypy --install-types
C
For coc, you also need to manually install clangd.
./clang-format on project root or root
Related Skills
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.2kCommit, push, and open a PR
