This repository hosts my Neovim configuration that I'm using for Linux and Windows.
- Linux Distro:
Linux Mint 21.2 Cinnamon
- Windows Version: Windows 10 (pending to check subversion)
- Written in Lua (and a little bit of Vimscript)
- Blinking cursor
- Custom mappings
- Settings for
neovim-qt
andneovide
- Plugin management via
lazy.nvim
- Code highlighting via
nvim-treesitter
- Better statusline via
lightline.vim
- File explorer via
nvim-tree.lua
andmini.files
- File fuzzy finder via
fzf
andfzf.vim
- Autopairing via
auto-pairs
andnvim-ts-autotag
- Snippets support with
vim-vsnip
- Move lines and selections easier with
vim-move
- Formatters support via
formatter.nvim
- Easier pair surrounding with
nvim-surround
- Easier comments with
Comment.nvim
- Better TODO comments with
todo-comments.nvim
- Better colorscheme with
nightfox.nvim
- Completion engine via
nvim-cmp
- LSP support with
nvim-lspconfig
- Linter plugin with
nvim-lint
- Git integration with
gitsigns.nvim
andvim-fugitive
- Markdown previewing with
markdown-preview.nvim
- Functions and commands for Neovim GUI's via
neovim-gui-shim
- Better colorcolumn with
virt-column.nvim
- Color highlighter with
nvim-highlight-colors
- Indentation guides via
indent-blankline.nvim
- Beautiful GUI notifications with
nvim-notify
- Nerd fonts support with
nvim-web-devicons
- Unicode completion with
unicode.vim
- Rest client via
rest.nvim
- Better code folding with
nvim-ufo
andstatuscol.nvim
- Easily install packages with
mason.nvim
andmason-tool-installer
- Better tabline with
tabby.nvim
- Jump out of brackets, quotes and other symbols with
tabout.nvim
- A.I. powered code-completion with
supermaven-nvim
- Beautiful markdown highlighting with
markdown.nvim
- Better
gx
withgx.nvim
- Distaction-free coding with
zen-mode.nvim
- Support for
Hygen
templates withhygen.nvim
- Css unit conversion via
convert.nvim
- LSP Servers:
- Linters:
- Treesitter parsers:
- astro
- bash
- css
- embedded_template (ejs)
- gitignore
- html
- http
- javascript
- jsdoc
- json
- jsonc
- lua
- markdown (also used for
mdx
files) - markdown_inline
- scss
- toml
- typescript
- tsx
- vim
- vimdoc
- yaml
- Patched nerd-font
- Neovim 0.9.5
- Node.js
- Yarn
- Git
- FZF
- fd
- ripgrep
- shellcheck
- Zig (optional) - See Troubleshooting section
C
compiler (needed bynvim-treesitter
):
- Backup your current configuration
- Remove your
~/.config/nvim
folder
Once you installed this configuration you will be able to integrate your older configuration. You can see it in Customization section
Clone repository in neovim config path:
git clone --depth 1 https://github.com/Hdoc1509/nvim-config.git ~/.config/nvim
Or start a new repo with tiged
:
tiged Hdoc1509/nvim-config ~/.config/nvim
IF YOU ARE A WINDOWS USER, set the environment variable XDG_CONFIG_HOME
with cmd
:
setx XDG_CONFIG_HOME %USERPROFILE%\.config
-
To suppress git messages about detached HEAD, run:
git config --global advice.detachedHead false
-
To install plugins, run:
nvim --headless +'Lazy! restore' +quit
-
Due to
headless
mode, sometree-sitter
parsers can not be successfully installed. All you need to do is openNeovim
.
Used mapleader is space key
.
Mapping | Mode | Description |
---|---|---|
<F1> |
Normal | Toggle nvim-tree with focus in current file |
<F2> |
Normal | Toggle nvim-tree |
<leader>w |
Normal | Save file |
<leader>W |
Normal | Save all files |
<leader>q |
Normal | Save and close file |
<leader>Q |
Normal | Save all files and close Neovim |
<leader>tq |
Normal | Close current tab |
<leader>to |
Normal | Close all other tabs |
<leader>th |
Normal | Move tab to left |
<leader>tH |
Normal | Move tab to first position |
<leader>tl |
Normal | Move tab to right |
<leader>tL |
Normal | Move tab to last position |
<leader>tj |
Normal | Go to previous tab |
<leader>tJ |
Normal | Go to first tab |
<leader>tk |
Normal | Go to next tab |
<leader>tK |
Normal | Go to last tab |
<leader>[ |
Normal | Jump to tag under cursor in a split |
<leader>] |
Normal | Jump to tag under cursor in a new tab |
<leader>j |
Normal / Visual | Scroll down 10 lines |
<leader>J |
Normal / Visual | Scroll down 20 lines |
<leader>k |
Normal / Visual | Scroll up 10 lines |
<leader>K |
Normal / Visual | Scroll up 20 lines |
<leader>sb |
Normal | Toggle scrollbind in windows of current tab |
<leader>> |
Normal | Resize current split 10 pixels to left |
<leader>< |
Normal | Resize current split 10 pixels to right |
<leader>chh |
Normal | Run :checkhealth |
<c-h> |
Normal | Jump to left split |
<c-j> |
Normal | Jump to bottom split |
<c-k> |
Normal | Jump to top split |
<c-l> |
Normal | Jump to right split |
<leader>H |
Normal | Move window to previous tab |
<leader>L |
Normal | Move window to next tab |
<leader>G |
Normal | Open git summary window |
<leader>vG |
Normal | Open git summary window in vertical split |
<leader>tG |
Normal | Open git summary window in new tab |
<leader>gaa |
Normal | Execute git add --all |
<leader>gd |
Normal | Execute git diff |
<leader>gp |
Normal | Execute git push |
<leader>gl |
Normal | Execute git pull |
<leader>gs |
Normal | Execute git status |
<leader>gc |
Normal | Execute git commit |
<c-u> |
Normal / Insert | Toggle Uppercase of word under cursor |
<c-t> |
Normal / Insert | Toggle Title Case of word under cursor |
<c-d> |
Normal / Insert | Remove current line |
<leader>ya |
Normal | Copy all text of current file to clipboard |
<leader>e |
Normal | Search files with fzf |
]t |
Normal | Jump to next TODO comment |
[t |
Normal | Jump to previous TODO comment |
<leader>/ |
Normal | Clear search highlighting |
<leader>rr |
Normal | Run HTTP request under the cursor |
<leader>rl |
Normal | Re-run the last HTTP request |
<leader>mo |
Normal (*) | Start Markdwon preview |
<leader>mc |
Normal (*) | Stop Markdown preview |
<leader>mt |
Normal | Toggle Markdown renderer |
<leader>f |
Normal | Format current file |
<leader>F |
Normal | Format and save current file |
H |
Normal | Preview folded lines |
<leader>o |
Normal [N] | Add blanklines below current line |
<leader>O |
Normal [N] | Add blanklines above current line |
]c |
Normal | Jump to next hunk |
[c |
Normal | Jump to previous hunk |
<leader>hs |
Normal | Stage hunk |
<leader>hs |
Visual | Stage selected hunk(s) |
<leader>hr |
Normal | Reset hunk |
<leader>hr |
Visual | Reset selected hunk(s) |
<leader>hS |
Normal | Stage buffer |
<leader>hu |
Normal | Unstage hunk |
<leader>hR |
Normal | Reset buffer |
<leader>hp |
Normal | Preview hunk |
<leader>hP |
Normal | Preview hunk inline |
<c-a> |
Insert | Insert supermaven suggestion |
<c-j> |
Insert | Accept supermaven word suggestion |
<c-q> |
Insert | Clear/Cancel supermaven suggestion |
- |
Normal | Open mini.files explorer in current file |
_ |
Normal | Open mini.files explorer |
<F3> |
Insert / Normal | Toggle spell checking |
<F5> |
Normal | Reload (re-edit) file |
<leader>r |
Visual | Replace selected text in current file |
<leader>R |
Visual | Replace selected text in all files |
<leader>z |
Normal | Toggle Zen Mode |
H |
Normal / Visual | Jump to first non-blank character |
L |
Normal / Visual | Jump to last non-blank character |
<leader>fs |
Normal | Enable Fullscreen. Only for nvim-qt |
<leader>Fs |
Normal | Disable Fullscreen. Only for nvim-qt |
<F11> |
Normal | Toggle Fullscreen. Only for neovide |
(*): Mappings that show a notify window.
[N]: Mappings that can receive a count.
Abbreviation | Mode | Expansion |
---|---|---|
vh | Command | vertical help |
th | Command | tab help |
The following mappings just run on *.md
files:
Mapping | Mode | Description |
---|---|---|
<leader>sat |
Visual Line | Create a table from shell aliases definitions and run FormatWrite |
This configuration provides a minimal configuration file for integration with git.
To use it, run the following command:
git config --global core.editor "nvim -u ~/.config/nvim/minimal.lua"
If you want to integrate your older configuration or want to extend this configuration, follow next indications:
- Custom global variables and Mapleader must be in
lua/globals.lua
- General options must be placed in
lua/options.lua
- Custom autocommands must be setted in
lua/autocmds.lua
- Plugins configurations must be added inside
lua/plugins
folder (can be a*.lua
file or a folder with aninit.lua
file). Config files of plugins will be loaded automatically bylazy.nvim
- Mappings must be setted in
lua/maps.lua
- Settings about diagnostic are in
lua/diagnostic.lua
- Custom icons must be declared in
lua/icons.lua
- Options related to colorscheme and custom GUI highlighting goes in
lua/plugins/colorscheme.lua
- Options for Neovim GUI's are in
ginit.vim
- Util functions must be placed in
lua/utils.lua
If you want to integrate more LSP servers, see the list of all available LSP servers. Once you have all software requirements for desired LSP server, you need to:
- Configure it in the list of servers in
lua/plugins/lsp/servers.lua
. - Add it to the list of mason tools in
lua/plugins/lsp/mason.lua
.
If you are a Windows user and have problems to install treesitter
parser,
install zig
and retry to install.
If you are a Windows user and have problems to use rest.nvim
because of
curl --compressed
option, you need to prepend the path of the curl
binary
that comes bundled with git-for-windows
to your system PATH
.
Run the following commands with powershell
as admin:
-
Git 64-bit
version:$GIT_PATH = "C:\Program Files\Git\mingw64\bin"
-
Git 32-bit
version:$GIT_PATH = "C:\Program Files (x86)\Git\mingw64\bin"
-
Finally, run:
[Environment]::SetEnvironmentVariable( "Path", "$GIT_PATH;" + [Environment]::GetEnvironmentVariable("PATH", "MACHINE"), "MACHINE" )
If you have problems to use astro
files, follow instructions in: