Skip to content
Proyectos

Acerca de

Configuración de Neovim práctica, fácil de mantener y compatible con varios idiomas.

Herramientas de desarrollo

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

Archive

Switched to the https://gram-editor.com

Neovim Configuration

Preview Image for My Neovim Configuration

This Neovim configuration is built with a focus on a simple, elegant, and distraction-free user interface. The goal is to enhance coding usability rather than overwhelm with fancy, unnecessary UI elements. I will consistently add and test plugins with multiple coding scenario, keep only those are suitable for daily use.

Getting Start

This configuration is compatible with neovim 0.12+ version.

git clone --depth=1 https://github.com/Avimitin/nvim.git ~/.config/nvim

Finally, input nvim to open the editor, and all plugins will be downloaded automatically.

nvim

Use pre-installed plugins

This configuration facilitate the vim.pack module to download plugins. But user could also use other package manager to download plugins. To avoid vim.pack management, set the NEOVIM_EXTERNAL_PLUGIN_MANAGEMENT environment, or enable the corresponding config:

  • Use env
export NEOVIM_EXTERNAL_PLUGIN_MANAGEMENT=1
nvim
  • Or, change config
require("core").setup({use_external_plugins = true})

Flake

This repository is also a flake. You can run it directly:

nix run github:Avimitin/nvim

Or add it to your configuration inputs:

{
  inputs = {
    # ...
    nvim-config.url = "github:Avimitin/nvim";
  };

  outputs = { self, nixpkgs, nvim-config, ... }: {
    # ...
    nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ({ pkgs, ... }: {
          environment.systemPackages = [
            nvim-config.packages.${pkgs.system}.default
          ];
        })
      ];
    };
  };
}

Home Manager

Import the module into your Home Manager configuration:

{
  inputs = {
    # ...
    home-manager.url = "github:nix-community/home-manager";
    nvim-config.url = "github:Avimitin/nvim";
  };

  outputs = { self, home-manager, nvim-config, ... }: {
    # ...
    homeConfigurations.exampleUser1 = home-manager.lib.homeManagerConfiguration {
      # ...
      modules = [
        nvim-config.homeModules.nvim
        {
          programs.avimitin-nvim.enable = true;
          # Optional: custom treesitter grammars
          # programs.avimitin-nvim.treesitter-grammars = [ "bash" "nix" "rust" ];
        }
      ];
    };
  };
}

Diagnostic error/warning/hint are highlighted with undercurl, please use kitty, wezterm or anyother terminal that support undercurl.

If you are using tmux, to have a correct display, you can try my configuration below:

# (MUST) Enable 256 color for tmux
set -g default-terminal "tmux-256color"

# (Optional, choose any of them)
# Enable true color and undercurl for wezterm
set -as terminal-features ",wezterm*:RGB"
set -as terminal-features ",wezterm*:usstyle"
# Same as above, but for kitty. (kitty doesn't support Windows so I have to keep two configuration here)
set -as terminal-features ",kitty*:RGB"
set -as terminal-features ",kitty*:usstyle"
# Same as above, but for SSH. This is useful because I am using `alias ssh="TERM=xterm-256color exec ssh"`
set -as terminal-features ",xterm-256color*:RGB"
set -as terminal-features ",xterm-256color*:usstyle"
set -as terminal-overrides ",xterm*:Tc"

# (MUST) This hijack the neovim undercurl char sequence, to avoid tmux escape them.
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'

Project Structure

  • lsp/*.lua: Built-in vim.lsp configuration

  • lua: the configuration core

    • completion/: plugins and configuration for LSP completion
    • core/: autocmds and vim options
    • git/: plugin and configuration for using git in Neovim
    • lang/: UI and key mapping configuration for LSP
    • libs/: functions that I don't want to write twice
    • tools/: miscellaneous plugins that can enhance editing experience
    • treesitter/: plugins for text object highlight and editing
    • ui/: plugins for decorating the neovim
    • pack.lua: script to download lazy.nvim plugin manager
  • ftdetect: List of script to help neovim identify filetype for some file, not important.

  • after/ftplugin/<lang>.lua: configuration for non-default filetypes

  • indent: List of script to help neovim properly set indentation, not important.

  • syntax: Additional syntax detection for some file type, not important.

License

This configuration since commit 912416ae9c4b55501b23a91d774b567ba8697dd1 are licenced under the Apache 2.0 license.

另附:禁止在 CSDN,bilibili 等国内平台使用该配置文件进行任何活动。 你只保有自己修改部分的权利。

Explorar proyectos relacionados

Cargando…