• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

brainfucksec/neovim-lua: Neovim KISS configuration with Lua

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

brainfucksec/neovim-lua

开源软件地址(OpenSource Url):

https://github.com/brainfucksec/neovim-lua

开源编程语言(OpenSource Language):

Lua 100.0%

开源软件介绍(OpenSource Introduction):

neovim-lua_logo

Neovim KISS configuration with Lua

Table of Contents

Plugins

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

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

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

nvim-cmp - Auto completion plugin

LuaSnip - Snippet Engine for Neovim written in Lua

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

Tagbar - A class outline viewer for Vim

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

nvim-treesitter - Nvim Treesitter configurations and abstraction layer

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

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

Directory Tree

${HOME}/.config/nvim

├── lua
│   ├── core
│   │   ├── autocmds.lua
│   │   ├── colors.lua
│   │   ├── keymaps.lua
│   │   ├── options.lua
│   │   └── statusline.lua
│   ├── plugins
│   │   ├── alpha-nvim.lua
│   │   ├── indent-blankline.lua
│   │   ├── nvim-cmp.lua
│   │   ├── nvim-lspconfig.lua
│   │   ├── nvim-tree.lua
│   │   └── nvim-treesitter.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

/nvim/lua/plugins

Installation

  1. Install Neovim v0.7.x.

  2. Install Nerd Fonts, (for the font of the screenshots install Cozette Font).

  3. Install npm for download packages of LSP language servers, see: LSP Configuration.

  4. Make a backup of your current nvim folder if necessary:

mv ~/.config/nvim ~/.config/nvim.backup
  1. Download neovim-lua with git and copy the nvim folder in the ${HOME}/.config directory:
git clone https://github.com/brainfucksec/neovim-lua.git
cd neovim-lua/
cp -Rv nvim ~/.config/
  1. Install packer.nvim for install and manage the plugins:
git clone --depth 1 https://github.com/wbthomason/packer.nvim\
 ~/.local/share/nvim/site/pack/packer/start/packer.nvim
  1. Run Neovim with PackerSync command:
nvim +PackerSync

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 additional packages for plugins support:

C, C++:

Python:

  1. Open a source file of one of the supported languages with Neovim, and 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

Appearance

Available Colorschemes

Fonts: Cozette

Icons: nvim-web-devicons

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

-- Load nvim color scheme:
...color_scheme = pcall(require, 'onedark')
require('onedark').setup {
    style = 'darker'
}
require('onedark').load()
-- Set colorscheme (from core/colors.lua/colorscheme_name)
local colors = require('core/colors').onedark_dark

Keymaps

These are the default keymaps, in the following shortcuts, the <leader> key is set up to , (comma) character, see: keymaps.lua.

Shortcut Mode Description
kk Insert Esc with kk
<leader>c Normal Clear search highlights
<F2> Normal Toggle Paste mode
<leader>tk/th Normal Change split orientation (vertical/horizontal)
<Ctrl> + {h,j,k,l} Normal Move around splits windows
<leader>r Normal Reload configuration file
<leader>s Normal/Insert Save file
<leader>q Normal Save (close all windows) and exit from Neovim
<Ctrl> + t Normal Open terminal (:Term)
<Esc> Terminal Exit terminal
<Ctrl> + n Normal Open NvimTree
<leader>z Normal Open Tagbar

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

alt text

  • 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

Screenshots

(Click to expand)

OneDark (darker)

1-onedark.png

Monokai

2-monokai.png

Rosé Pine

3-rose-pine.png

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, to all from whom I "stole" some configs, to the users of /r/Neovim subreddit for the support of the configuration and to all the people who help me to improve this setup with their reports and advices.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
tenvick/hugula: unity3d lua databinding mvvm发布时间:2022-08-16
下一篇:
asqbtcupid/unreal.lua: lua solution for UnrealEngine4发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap