Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/neovim-luaPublic template

Neovim KISS configuration with Lua

License

NotificationsYou must be signed in to change notification settings

brainfucksec/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 and LSP


Table of Contents

Plugins

lazy.nvim - A modern plugin manager for Neovim

lualine.nvim - A blazing fast and easy to configure neovim statusline plugin written in pure 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

alt text

Files and Settings

/nvim

  • init.lua: Main configuration file that calllua modules

  • lua: The directory oflua modules, these modules are called in theinit.lua file (see below).

See:nanotee/nvim-lua-guide: Where to put Lua files

/nvim/lua/core

/nvim/lua/plugins

Installation

  1. InstallNeovim v0.11.x.

  2. InstallNerd Fonts, (the font of the screenshots areJetBrainsMono Nerd Font).

  3. InstallNode.js - npm for download packages of LSP language servers, see:LSP Configuration.

  4. Make a backup of your currentnvim folder if necessary:

mv ~/.config/nvim ~/.config/nvim.backup
  1. Download neovim-lua withgit and copy thenvim folder in the${HOME}/.config directory:
git clone https://github.com/brainfucksec/neovim-lua.gitcd neovim-lua/cp -Rv nvim ~/.config/
  1. Installlazy.nvim for install and manage the plugins, see:lazy.nvim - Installation

  2. Run Neovim for download/sync plugins withlazy

nvim

LSP Configuration

  1. Install LSP language servers withnpm, see:Languages Currently Supported
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 verify the LSP support.

See:nvim-lspconfig - Quickstart

Languages Currently Supported

Lua -builtin

Bash -bashls

Python -pyright

C, C++ -clangd

HTML, CSS, JSON -vscode-langservers-extracted

JavaScript, TypeScript -ts_ls

LSP server configs:nvim-lspconfig #doc/LSP configs

Appearance

Available Colorschemes

Fonts: See:Installation

Icons:nvim-web-devicons

See:Screenshots

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

--[[Set Neovim UI color scheme.Current available color schemes: onedark, kanagawa, monokai-pro, rose-pine.See: https://github.com/brainfucksec/neovim-lua#appearanceInsert preferred color scheme in the `color_scheme` variable.Note: Color scheme is loaded in the "Load color scheme" section below, setupmust be called before loading.--]]localstatus_ok,color_scheme=pcall(require,'onedark')-- Color scheme setup before load:require('onedark').setup({-- Your settings here.})--[[Load color scheme:Note: The instruction to load the color scheme may vary depending on thepackage.See the README of the related color scheme (i.e. git package) for information,Examples: require('color_scheme').setup{}, vim.cmd('color_scheme')--]]require('onedark').load()

Keymaps

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

ShortcutModeDescription
kkInsertEsc withkk
<leader>cNormalClear search highlights
<F2>NormalToggle Paste mode
<leader>tk/thNormalChange split orientation (vertical/horizontal)
<Ctrl> + {h,j,k,l}NormalMove around splits windows
<leader>rNormalReload configuration file
<leader>sNormalSave file
<leader>qNormalSave (close all windows) and exit from Neovim
<Ctrl> + tNormalOpen terminal (:Term)
<Esc>TerminalExit terminal
<Ctrl> + nNormalOpen NvimTree
<leader>tNormalOpen/Close Tagbar

Configuration Check

  • Open nvim and run commandcheckhealth, 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 thestartuptime option to read the nvim startup logs:
nvim --startuptime nvim-start.lognvim nvim-start.log

See::help startuptime

Also you can check the plugins configuration and startup time withlazy:

:checkhealth lazy
:Lazyprofile

See:lazy.nvim - Usage

Screenshots

Note: Screenshots may be out of date compared to the actual setup.

(Click to expand)

OneDark Darker

1-onedark_darker.png

OneDark Dark

2-onedark_dark.png

OneDark Cool

3-onedark_cool.png

OneDark Deep

4-onedark_deep.png

Kanagawa Wave (lualine theme: palenight)

5-kanagawa_wave.png

Kanagawa Dragon (lualine theme: seoul256)

6-kanagawa_dragon.png

Monokai (lualine theme: molokai)

7-monokai.png

Rosé Pine (lualine theme: nightfly)

8-rose-pine.png

lazy.nvim

lazy-nvim.png

Guides and Resources

Other Neovim Lua Projects

Lua Resources


Disclaimer

This setup is based onKISS principle, probably some concepts may not be valid for everyone. Then feel free to take what you need butdon't install anything without checking first!

This setup is not a Framework but it is the configuration I use to work on Linux, it can be used by default as it can be a start point to understand how Neovim is structured and maybe improve this config. Is the base configuration I use, and it tries to stay as simple as possible, with each addition weighted along these lines.

Less is more

Thanks to:

  • All the contributors who helped improve this setup with their reports and advices and all the authors of the sources mentioned above.

Releases

No releases published

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp