neovim-lua

brainfucksecGPL-3.0活跃维护

用 Lua 编写的极简 Neovim 配置,遵循 KISS 原则,开箱即用,适合想要轻量 IDE 体验又不想折腾复杂配置的人。

Neovim KISS configuration with Lua

暂无版本829star114fork同步于 2026-11-07 07:32 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/brainfucksec/neovim-lua.git
cd neovim-lua/
cp -Rv nvim ~/.config/
nvim
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一套遵循 KISS 原则的 Neovim Lua 配置,内置 LSP 与常用插件,可直接使用或作为学习起点

用 Lua 编写的极简 Neovim 配置,遵循 KISS 原则,开箱即用,适合想要轻量 IDE 体验又不想折腾复杂配置的人。

核心能力

  • 用 vim.pack 管理插件并自动同步
  • 预置 lua_ls、pyright、clangd 等 LSP 配置
  • 集成 nvim-cmp 补全与 LuaSnip 代码片段
  • 内置 nvim-tree 文件树与 Tagbar 大纲
  • 提供 OneDark、Kanagawa 等多套配色

容易踩的坑

需要 Neovim v0.12.x,版本过低无法使用;LSP 语言服务器需另用 npm 全局安装,否则补全不生效;需安装 Nerd Fonts 才能正常显示图标;覆盖前先备份原有 ~/.config/nvim

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Table of Contents

    Plugins

    lualine.nvim - A blazing fast and easy to configure neovim statusline plugin written in pure lua.

    nvim-lspconfig - A collection of common configurations for Neovim's built-in language server client

    nvim-cmp - Auto completion plugin

    LuaSnip - Snippet Engine for Neovim written in Lua

    nvim-tree.lua - A File Explorer written In Lua

    indentBlankline - Adds indentation guides to all lines (including empty lines)

    nvim-autopairs - A super powerful autopairs for Neovim

    Tagbar - A class outline viewer for Vim

    gitsigns - Super fast git decorations implemented purely in lua/teal

    nvim-treesitter - Nvim Treesitter configurations and abstraction layer

    alpha-nvim - A fast and highly customizable greeter for neovim.

    nvim-web-devicons - A Lua fork of vim-devicons

    Directory Tree

    ${HOME}/.config/nvim

    alt text

    Files and Settings

    /nvim

    • init.lua: Main configuration file that call lua modules

    • lua: The directory of lua modules, these modules are called in the init.lua file (see below).

    See: neovim.io/doc/user/lua-guide/#_lua-modules

    /nvim/lsp/

    Path for LSP configs lsp/*.lua files. See: Lsp - CONFIG

    /nvim/lua/config

    /nvim/lua/plugin

    Installation

    1. Install Neovim v0.12.x.

    2. Install Nerd Fonts, (the font of the screenshots are JetBrainsMono Nerd Font).

    3. Install Node.js - npm for download packages of LSP language servers, see: LSP Configuration.

    4. Make a backup of your current nvim folder if necessary:

    mv ~/.config/nvim ~/.config/nvim.backup
    
    1. Download neovim-lua with git and copy the nvim folder in the ${HOME}/.config directory:
    git clone https://github.com/brainfucksec/neovim-lua.git
    cd neovim-lua/
    cp -Rv nvim ~/.config/
    
    1. Run Neovim and download/sync plugins with vim.pack, see: Pack - Plugin Manager
    nvim
    

    LSP Configuration

    1. Install LSP language servers with npm, see: LSP Default Language Servers
    sudo npm install -g \
        bash-language-server \
        pyright \
        vscode-langservers-extracted \
        typescript typescript-language-server \
        rust-analyzer
    

    For Lua language server see:

    1. Install additional packages for C, C++ and Python:

    C, C++:

    Python:

    1. Open a code file matching one of the filetypes specified in the config with Neovim, and check that LSP is active with :checkhealth vim.lsp command.

    See: neovim.io/doc/user/lsp/

    LSP Default Language Servers

    neovim-lua by default has the following language servers installed:

    Lua - lua_ls

    Bash - bashls

    Python - pyright

    C, C++ - clangd

    HTML, CSS, JSON - vscode-langservers-extracted

    JavaScript, TypeScript - ts_ls

    Rust - rust_analyzer

    See nvim-lspconfig #doc/LSP configs

    Appearance

    Available Colorschemes

    Fonts: See: Installation

    Icons: nvim-web-devicons

    See: Screenshots

    The color scheme (default: OneDark) is defined in the following file:

    
    -- Color scheme setup before load:
    require('onedark').setup({
        -- color scheme settings here..
    })
    
    --[[
    Load color scheme:
    Note: The instruction to load the color scheme may vary depending on the
    package.
    See the README of the related color scheme (i.e. git package) for information,
    Examples: require('color_scheme').setup{}, vim.cmd('color_scheme')
    --]]
    require('onedark').load()
    

    Keymaps

    These are the default keymaps, in the following shortcuts, the <leader> key is set up to , (comma) character, see: keymaps.lua.

    ShortcutModeDescription
    kkInsertEsc with kk
    <leader>cNormalClear search highlights
    <F2>NormalToggle Paste mode
    <leader>tk/thNormalChange split orientation (vertical/horizontal)
    <Ctrl> + {h,j,k,l}NormalMove around splits windows
    <leader>rNormalReload configuration file
    <leader>sNormalSave file
    <leader>qNormalSave (close all windows) and exit from Neovim
    <Ctrl> + tNormalOpen terminal (:Term)
    <Esc>TerminalExit terminal
    <Ctrl> + nNormalOpen NvimTree
    <leader>tNormalOpen/Close Tagbar

    Configuration Check

    • Open nvim and run command checkhealth, you should not see any error in the output (except for the one related to the Python 2 interpreter if don't have it):
    :checkhealth
    

    See: help checkhealth

    alt text

    • You can also use the startuptime option to read the nvim startup logs:
    nvim --startuptime nvim-start.log
    
    nvim nvim-start.log
    

    See: :help startuptime

    Screenshots

    Note: Screenshots may be out of date compared to the actual setup.

    OneDark Darker

    1-onedark_darker.png

    OneDark Dark

    2-onedark_dark.png

    OneDark Cool

    3-onedark_cool.png

    OneDark Deep

    4-onedark_deep.png

    Kanagawa Wave (lualine theme: palenight)

    5-kanagawa_wave.png

    Kanagawa Dragon (lualine theme: seoul256)

    6-kanagawa_dragon.png

    Monokai (lualine theme: molokai)

    7-monokai.png

    Rosé Pine (lualine theme: nightfly)

    8-rose-pine.png

    vim.pack

    pack.png

    Neovim Guides and Resources

    Lua Resources

    Neovim Lua Docs


    Disclaimer

    This setup is based on KISS principle, probably some concepts may not be valid for everyone. Then feel free to take what you need but don't install anything without checking first!

    This setup is not a Framework but it is the configuration I use to work on Linux, it can be used by default as it can be a start point to understand how Neovim is structured and maybe improve this config. Is the base configuration I use, and it tries to stay as simple as possible, with each addition weighted along these lines.

    Less is more

    Thanks to:

    • All the contributors who helped improve this setup with their reports and advices and all the authors of the sources mentioned above.