Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
/ neovim-lua Public archive
forked from brainfucksec/neovim-lua

Neovim KISS configuration with Lua

License

Notifications You must be signed in to change notification settings

SunJun8/neovim-lua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neovim-lua_logo

Neovim KISS configuration with Lua

Plugins

packer.nvim - A use-package inspired plugin manager for Neovim

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

feline.nvim - A minimal, stylish and customizable statusline for Neovim written in Lua

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

vista.vim - View and search LSP symbols, tags in Vim/NeoVim

nvim-treesitter - Nvim Treesitter configurations and abstraction layer

nvim-cmp - Auto completion plugin

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

LuaSnip - Snippet Engine for Neovim written in Lua

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

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

Directory Tree of Lua Files

${HOME}/.config/nvim

├── lua
│   ├── core
│   │   ├── colors.lua
│   │   ├── keymaps.lua
│   │   └── settings.lua
│   ├── plugins
│   │   ├── alpha-nvim.lua
│   │   ├── feline.lua
│   │   ├── indent-blankline.lua
│   │   ├── nvim-cmp.lua
│   │   ├── nvim-lspconfig.lua
│   │   ├── nvim-tree.lua
│   │   ├── nvim-treesitter.lua
│   │   └── vista.lua
│   └── packer_init.lua
├── plugin
│   └── packer_compiled.lua
└── init.lua

Files and Settings

/nvim

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

  • lua: Folder of lua modules, here reside all the Lua modules that needed. These modules are called from init.lua file (see below).

See: https://github.com/nanotee/nvim-lua-guide#where-to-put-lua-files

/nvim/lua

/nvim/lua/core

  • settings.lua: General Neovim settings and configuration

  • keymaps.lua: Keymaps configuration file, vim/neovim and plugins keymaps.

  • colors.lua: Define Neovim and plugins color scheme

/nvim/lua/plugins

Appearance

Colorschemes:

Fonts: Cozette

Icons: nvim-web-devicons

Screenshots

(Click to expand)

OneDark (darker)

onedark_1

onedark_2

Monokai

monokai_1

monokai_2

Rosé Pine

rose-pine_1

rose-pine-2

Installation

  1. Install neovim v0.6.x

  2. Install npm (for download the packages of LSP language servers)

  3. Download this repository with git and copy the nvim folder in the ${HOME}/.config directory (make a backup of your current nvim folder if necessary):

    git clone https://github.com/brainfucksec/neovim-lua.git
    cd neovim-lua/
    cp -Rv nvim ~/.config/
  1. Install packer.nvim for install and manage plugins, see: https://github.com/wbthomason/packer.nvim#quickstart

LSP Configuration

  1. Install LSP language servers with npm
    sudo npm install -g bash-language-server pyright vscode-langservers-extracted typescript typescript-language-server
  1. Install clang for use LSP with clangd

  2. Open a source file of one of the supported languages with neovim, in the Neovim cmd line run command :LspInfo for testing the LSP support.

Languages Currently Supported

Lua - builtin

Bash - bashls

Python - pyright

C, C++ - clangd

HTML, CSS, JSON - vscode-html

JavaScript, TypeScript - tsserver

See: nvim-lspconfig #doc/server_configurations.md

Set Color Scheme

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

-- Load colorscheme
require('onedark').setup {
    style = 'darker'
}
require('onedark').load()
-- Set colorscheme (from core/colors.lua/colorscheme_name)
local colors = require('core/colors').onedark

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

.

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

nvim /tmp/nvim-start.log

See: :help startuptime

TODO

  • Improve "Autocommands" management
  • Improve LSP configuration

Guides and resources

Other Neovim Lua projects and examples

Lua resources

Disclaimer

As all my setups I try to follow the 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!


Thanks to all the authors of the sources mentioned above and to all the others from whom I "stole" some configs :)

About

Neovim KISS configuration with Lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%