SkillAgentSearch skills...

Nvim

Archived. I'm using LazyVim now. Check here: https://github.com/ysl2/lazyvim

Install / Use

/learn @ysl2/Nvim
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

[!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

image

TLDR:

  1. Single main file: There is only one main file ./lua/ysl/init.lua which contains common configuration and lots of common plugins.
  2. 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
  3. 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.
  4. Very fast: All plugins are lazyloaded so you can gain best performance of this configuration.
  5. Clean: The files are clean and well structured so that you can easily understand and modify them to fit your needs.
  6. Choose your own: I provide a local config file ./lua/ysl/localhost.lua so 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.lua or ./lua/ysl/lsp/coc.lua, default is nvim_lsp, choose the one you like from these two files, write it into ./lua/ysl/localhost.lua.
  7. 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:

  1. Boilerplate: kickstart.nvim shows the single file structure, I think it has more benefits than lots of files especially when you're debugging with lots of plugins.
  2. Distributions: LunarVim & LazyVim & NvChad provide the most popular plugins list.
  3. Collections: awesome-neovim provides more special-interest plugins.
  4. Personal configs: FledgeXu/NeovimZero2Hero for minimal lsp & cmp configuration, theniceboy/nvim for some useful plugins.
  5. 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 clang or gcc (if Linux/Mac, choose one between them; else if Windows, clang recommended): Essential, for nvim-treesitter support.
    • ripgrep: Essential, for fuzzy search and replace.
    • nodejs and yarn: Essential, for some lsp support, markdown preview, and coc language 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)
  • Only Windows:

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

  1. Change font and size:

    set guifont=consolas:h20
    
  2. 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

  1. Python environment dependencies

    # For coc (not tested on nvim_lsp):
    pip install jedi ruff-lsp sourcery
    

    Configure 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'"
      ]
      
  2. 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
    
  3. sourcery

    This config will auto dynamically read ~/.config/sourcery/auth.yaml(this is the default sourcery config file) to load the sourcery token.

  4. 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

View on GitHub
GitHub Stars38
CategoryDevelopment
Updated5d ago
Forks3

Languages

Lua

Security Score

95/100

Audited on Mar 21, 2026

No findings