Giter Site home page Giter Site logo

nvim's Introduction

Neovim setup

This is a setup for Neovim>=0.8. Current structure (might be a bit outdated):

after/                # Everything that will be sourced last (`:h after-directory`)
│ ftplugin/           # Configurations for filetypes
└ queries/            # Queries for treesitter
lua/                  # Lua code used in configuration
└ mini-dev/           # Development code for 'mini.nvim'
misc/                 # Everything not directly related to Neovim startup
│ dict/               # Dictionary files
│ mini_vimscript/     # Vimscript (re)implementation of some 'mini' modules
│ scripts/            # Scripts for miscellaneous usage
└ snippets/           # Snippets for snippets engine
spell/                # Files for spelling
src/                  # Custom 'plugin namespace'
│ plugins/            # Configurations for plugins
│ functions.lua       # Custom functions
│ mappings-leader.lua # Mappings for `<Leader>` key
│ mappings.lua        # General mappings
│ settings.lua        # General settings
└ vscode.lua          # VS Code related configuration

NOTEs:

  • Code is modularized with parts put into 'src/' directory which are sourced using dofile(). Currently general approach is to use 'lua/', but it has some downsides:
    • All modules inside of it are shared across installed plugins. This might lead to naming conflicts. It can be avoided by creating "personalized" directory module (like 'lua/ec/'), but with src/ it is not necessary.
    • Using require() to source those modules is not easily reloadable, as require() caches its outputs (stored inside package.loaded table). With dofile() it is not a problem.

Installation

Basically, this should (after installing system dependencies) work just by cloning this repository and waiting until all plugins/dependencies are installed (when there is no visible progress):

git clone --filter=blob:none https://github.com/echasnovski/nvim.git

System dependencies

Important system dependencies:

  • Nerd fonts (information source):

    • Download a Nerd Font (good choice is "UbuntuMono Nerd Font").
    • Unzip and copy to '~/.local/share/fonts'.
    • Run the command fc-cache -fv to manually rebuild the font cache.
  • Tools for finding stuff:

  • Clipboard support. One of 'xsel' (preferred) or 'xclip'.

  • Pre-commit hooks (not strictly necessary but "good to have"). This repository uses pre-commit hooks to verify integrity of code. Preferred way of setting this up:

    • Install pre-commit. Preferred way is to use pipx with pipx install pre-commit. There also other options.
    • From the root of this repository run pre-commit install. This enables pre-commit checks. Now they will be run before any commit. In case they did something, you need to git add those changes before commiting will become allowed.

Plugin management

Plugin management is done with 'mini.deps'. See :h mini.deps. In short:

  • To add plugin, add call to add() with plugin source. Restart Neovim.
  • To update plugins, run :DepsUpdate, review changes, :write. Don't forget to :DepsSnapSave and commit mini-deps-snap. See :h DepsUpdate and :h DepsSnapSave.
  • To delete plugin, remove its add() line from config, restart Neovim, run :DepsClean.

NOTEs:

  • Loading of most non-essential to startup plugins is deferred until after it with later() from 'mini.deps'. This mostly doesn't affect general usability: it decreases time before showing fully functional start screen (or asked file) from ~240ms to ~105ms (on a not so quick i3-6100) to ~65ms (on Ryzen 5600u).

Notes

  • 'Pyright' language server currently by default uses python interpreter that is active when Neovim is opened. However, if using virtual environment, it is a good idea to create 'pyrightconfig.json' file with at least the following content:
    {
        "include": ["<package_name>"], // Directory of package source
        "venvPath": ".", // Path to folder where virtual environment can be found
        "venv": ".venv" // Folder name of virtual environment
    }
    

Tips and tricks

  • When testing with 'vim-test', use -strategy=make argument to :Test* commands in order to populate quickfix list. Note that this will not display testing process as it is running and won't open quickfix list by default.

nvim's People

Contributors

echasnovski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nvim's Issues

Github copilot

Hi, I love your minimal config. It is possible to integrate copilot.lua with mini.completion ?

Thanks

Neovim 0.9 NVIM_APPNAME and mini.session configuration

Hi, I am integrating this Neovim configuration into the Lazyman Neovim Configuration Manager. Lazyman leverages the new feature in Neovim 0.9 that supports Neovim configurations in locations specified by the environment variable NVIM_APPNAME. For example, this configuration is located in ~/.config/nvim-MiniVim/ when installed and initialized with the lazyman command.

Everything looks fine and your configuration is excellent. Thanks!

However, the mini.session configuration sets the session directory to ~/.config/nvim/misc/sessions during setup in lua/ec/configs/mini.lua.

This is a minor issue and may never cause a problem. But one of the beauties of having NVIM_APPNAME is we can explore multiple Neovim configurations, each isolated in its own folder and never touching the default ~/.config/nvim folder.

I am just letting you know, I do not expect any action or "fix" to comply with my nitpicking. I don't even have a suggested modification. Checking if NVIM_APPNAME is set and using that if $HOME/.config/$NVIM_APPNAME exists?

Mostly, thanks for an excellent configuration that helps me learn the mini.nvim universe.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.