8000 GitHub - MrZLeo/nvime: It a neovim specific configuration fork from vime.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MrZLeo/nvime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦈 NVIME: Modern NeoVim Configuration

NVIME is a modern Neovim configuration using pure Lua. It leverages the built-in LSP features and improves startup times with lazy.nvim. It also includes file exploration, syntax highlighting, inline hints, and more.

Snapshots

image image image

Get Started

  1. Make sure your Neovim version ≥ 0.10.
  2. (Optional) For Arch Linux, run arch-install.sh to install dependencies quickly.
  3. Otherwise, install required packages manually:
    # Fedora as example
    sudo dnf install \
        ripgrep \
        nodejs \
        tree-sitter-cli \
        gcc \
        g++ \
        wget \
        unzip
  4. Clone this repository into your Neovim config path:
    git clone https://github.com/MrZLeo/nvime ~/.config/nvim
  5. Launch Neovim:
    nvim
    Installation starts automatically. Exit once done and reopen Neovim.

Key Bindings

Key Combination Mode Description
<C-h/j/k/l> Normal Navigate between windows
<C-h/j/k/l> Terminal Navigate between windows from terminal
<C-w>k Normal Split window above
<C-w>h Normal Split window left
<C-w>j Normal Split window below
<C-w>l Normal Split window right
<BackSpace> Normal Clear search highlighting
<Space><Space> Normal Save file
<Leader>ff Normal Find files
<Leader>fg Normal Live grep
<Leader>fb Normal List buffers
<Leader>fh Normal Help tags
gD Normal Go to declaration
gd Normal Go to definition (telescope)
K Normal Show hover information
gi Normal Go to implementation (telescope)
gr Normal Find references (telescope)
<Space>rn Normal Rename symbol
<Space>f Normal Code action
<Space>l Normal Show diagnostics (telescope)

Plugins

Plugins are managed by lazy.nvim in lua/plugins.lua. To add a new plugin, you need to add a new entry to the plugins table.

Adding a New Plugin

  1. Open lua/plugins.lua.

  2. Add the plugin specification to the plugins table. For example, to add a new plugin from GitHub:

    -- lua/plugins.lua
    local plugins = {
        -- ... other plugins
        {
            'user/repo',
            -- Optional: specify version for stability
            version = "*",
            -- Optional: run setup code
            config = function()
                require('plugin-name').setup({})
            end,
            -- Optional: specify events to load the plugin
            event = "VeryLazy",
        },
        -- ... other plugins
    }
  3. Save the file. The plugin will be installed automatically the next time you start Neovim. You can also run :Lazy sync to install it manually.

Language Server Protocol (LSP)

NVIME uses nvim-lspconfig for LSP support, with configurations organized in the lua/lsp_config directory:

LSP Configuration Structure

  • lua/lsp_config/init.lua: Main LSP initialization and auto-formatting setup
  • lua/lsp_config/on_attach.lua: Keybindings and settings applied when LSP attaches to buffers
  • lua/lsp_config/diagnostic.lua: Global diagnostic configurations (signs, virtual text, etc.)
  • Language-specific configs:
    • lua/lsp_config/rust.lua: Rust LSP configuration via rustaceanvim
    • lua/lsp_config/lsp/lua_ls.lua: Lua LSP configuration
    • lua/lsp_config/lsp/clangd.lua: clangd LSP configuration

Setting Up LSP

  1. Install the required language servers:

    # Example installations:
    npm install -g lua-language-server   # Lua
    rustup component add rust-analyzer   # Rust
    sudo pacman -S clang                 # C/C++
  2. Add the server name to the servers list in lua/lsp_config/init.lua:

    -- lua/lsp_config/init.lua
    local lsp_server = {
        "clangd",
        "lua_ls",
        "ruff",
        "pyright",
        -- "ty",
        "taplo",
        "texlab",
        "neocmake",
    }
  3. LSP features are automatically enabled when editing supported files. Common LSP commands:

    • gd: Go to definition (telescope)
    • K: Show hover information
    • gi: Go to implementation
    • See Key Bindings for more

Diagnostics and Visual Feedback

  • Error/warning signs in the gutter
  • Hover diagnostics (auto-show on cursor hold)
  • Inlay hints for supported languages
  • Automatic formatting on save (except for C/C++, you can change it in lua/lsp/init.lua)

LSP configurations can be customized by modifying the respective files in the lua/lsp_config directory.

That's it! Enjoy your updated Neovim setup.

About

It a neovim specific configuration fork from vime.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0