Skip to content

psugrg/nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

118 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Configuration

This neovim is configured in lua.

Type :h rtp for detaile about the neovim startup configuration procedure

Dependencies

Install Deno (needed by neo-vim markdown-preview plugin)

sudo curl -fsSL https://deno.land/install.sh | sh

Install lazy-git

LAZYGIT*VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": *"v\K[^"]_') curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}\_Linux_x86_64.tar.gz" tar xf lazygit.tar.gz lazygit sudo install lazygit -D -t /usr/local/bin/

Structure

  • init.lua - root file where neovim starts looking for configuration (lua modue style)
  • lua - Everything inside of the lua directory will automatically sourced by neovim
    • psu - user defined configuration (psu in this case). It's a lua module for convinience
      • init.lua - module initialization file1
      • set.lua - neovim basic configuration (e.g. line numbers, tabs-to-space, tab width etc.)
      • remap.lua - custom key mapping
      • lazy.lua - plugin manager configuration
      • plugins - plugins (and colorschemes) configuration
        • ... - plugin configurations (one per file)

Plugins & Color Schemes

It's inspired by youtube video from Josean Martinez.

This configuration uses the lazy.nvim as a package manager

Use :Lazy to spawn lazy.nvim plugin manager UI

Color schemes are managed also by the package manager

Use :checkhealth <name_of_plugin> to inspect the plugin

Adding New Plugin

  1. Find your new plugin on github (e.g.: nvim-treesitter).
  2. Create a configuration file in the ./lua/psu/plugin directory using a following scheme:
return {
    "plugin-name/neovim",
    config = function()
        require('plugin-name').setup({
            -- Add setup code here (if needed)
        })

    -- Add extra configuration here (like key-mapping etc.)

    end
}

Using config is optional and required only of a plugin has a setup function that is required to be called

LSP plugin

Nice video explaining how it works More sophisticated (but a little bit more bloated)

LSP is part of neovim, there is a plugin for getting configuration - check the lsp.lua file

Use comamnd checkhealth vim.lsp to check the configuration.

LSP language servers configuration

The LSP language servers are automatically configured by the nvim-lspconfig plugin.

It is possible to add additional configuration to the language server by adding it to the /lsp folder.

See ./after/lsp/lua_ls.lua as an example Note that the /after directory means that the configuration in that folder will be run after the original configuration (From github)

Footnotes

  1. In lua folder can also be a module if it contains the init.lua file

About

My Neovim configuration

Resources

Stars

Watchers

Forks

Contributors