Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hdoc1509/nvim-config
Personal configuration for Neovim
https://github.com/hdoc1509/nvim-config
neovim neovim-colorscheme neovim-config neovim-configuration neovim-lsp neovim-plugin
Last synced: 3 days ago
JSON representation
Personal configuration for Neovim
- Host: GitHub
- URL: https://github.com/hdoc1509/nvim-config
- Owner: Hdoc1509
- Created: 2022-09-03T16:59:53.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-03T17:30:01.000Z (15 days ago)
- Last Synced: 2024-11-03T18:22:10.163Z (15 days ago)
- Topics: neovim, neovim-colorscheme, neovim-config, neovim-configuration, neovim-lsp, neovim-plugin
- Language: Lua
- Homepage:
- Size: 347 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neovim configuration
This repository hosts my Neovim configuration that I'm using for Linux and Windows.
- Linux Distro: [`Linux Mint 21.2 Cinnamon`](https://www.linuxmint.com/edition.php?id=305)
- Windows Version: Windows 10 _(pending to check subversion)_## Features
- Written in Lua _(and a little bit of Vimscript)_
- Blinking cursor
- Custom [mappings](#mappings)
- Settings for [`neovim-qt`](https://github.com/equalsraf/neovim-qt) and [`neovide`](https://github.com/neovide/neovide)
- Plugin management via [`lazy.nvim`](https://github.com/folke/lazy.nvim)
- Code highlighting via [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter)
- Better statusline via [`lightline.vim`](https://github.com/itchyny/lightline.vim)
- File explorer via [`nvim-tree.lua`](https://github.com/nvim-tree/nvim-tree.lua)
and [`mini.files`](https://github.com/echasnovski/mini.files)
- File fuzzy finder via [`fzf`](https://github.com/junegunn/fzf) and [`fzf.vim`](https://github.com/junegunn/fzf.vim)
- Autopairing via [`auto-pairs`](https://github.com/jiangmiao/auto-pairs) and [`nvim-ts-autotag`](https://github.com/windwp/nvim-ts-autotag)
- Snippets support with [`vim-vsnip`](https://github.com/hrsh7th/vim-vsnip)
- Move lines and selections easier with [`vim-move`](https://github.com/matze/vim-move)
- Formatters support via [`formatter.nvim`](https://github.com/mhartington/formatter.nvim)
- Easier pair surrounding with [`nvim-surround`](https://github.com/kylechui/nvim-surround)
- Easier comments with [`Comment.nvim`](https://github.com/numToStr/Comment.nvim)
- Better TODO comments with [`todo-comments.nvim`](https://github.com/folke/todo-comments.nvim/)
- Better colorscheme with [`nightfox.nvim`](https://github.com/EdenEast/nightfox.nvim)
- Completion engine via [`nvim-cmp`](https://github.com/hrsh7th/nvim-cmp/)
- LSP support with [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig)
- Linter plugin with [`nvim-lint`](https://github.com/mfussenegger/nvim-lint)
- Git integration with [`gitsigns.nvim`](https://github.com/lewis6991/gitsigns.nvim) and [`vim-fugitive`](https://github.com/tpope/vim-fugitive)
- Markdown previewing with [`markdown-preview.nvim`](https://github.com/iamcco/markdown-preview.nvim)
- Functions and commands for Neovim GUI's via [`neovim-gui-shim`](https://github.com/equalsraf/neovim-gui-shim)
- Better colorcolumn with [`virt-column.nvim`](https://github.com/lukas-reineke/virt-column.nvim)
- Color highlighter with [`nvim-highlight-colors`](https://github.com/brenoprata10/nvim-highlight-colors)
- Indentation guides via [`indent-blankline.nvim`](https://github.com/lukas-reineke/indent-blankline.nvim)
- Beautiful GUI notifications with [`nvim-notify`](https://github.com/rcarriga/nvim-notify)
- Nerd fonts support with [`nvim-web-devicons`](https://github.com/nvim-tree/nvim-web-devicons)
- Unicode completion with [`unicode.vim`](https://github.com/chrisbra/unicode.vim)
- Rest client via [`rest.nvim`](https://github.com/rest-nvim/rest.nvim)
- Better code folding with [`nvim-ufo`](https://github.com/kevinhwang91/nvim-ufo) and [`statuscol.nvim`](https://github.com/luukvbaal/statuscol.nvim)
- Easily install packages with [`mason.nvim`](https://github.com/williamboman/mason.nvim) and [`mason-tool-installer`](https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim)
- Better tabline with [`tabby.nvim`](https://github.com/nanozuki/tabby.nvim)
- Jump out of brackets, quotes and other symbols with [`tabout.nvim`](https://github.com/abecodes/tabout.nvim)
- A.I. powered code-completion with [`supermaven-nvim`](https://github.com/supermaven-inc/supermaven-nvim)
- Beautiful markdown highlighting with [`markdown.nvim`](https://github.com/MeanderingProgrammer/markdown.nvim)
- Better `gx` with [`gx.nvim`](https://github.com/chrishrb/gx.nvim)
- Distaction-free coding with [`zen-mode.nvim`](https://github.com/folke/zen-mode.nvim)
- Support for [`Hygen`](https://github.com/jondot/hygen) templates with
[`hygen.nvim`](https://github.com/Hdoc1509/hygen.nvim)
- Css unit conversion via [`convert.nvim`](https://github.com/cjodo/convert.nvim)
- LSP Servers:
- [`astro`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#astro)
- [`bashls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#bashls)
- [`cssls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cssls)
- [`emmet_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#emmet_ls)
- [`eslint`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#eslint)
- [`html`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html)
- [`jsonls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#jsonls)
- [`lua_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#lua_ls)
- [`marksman`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#marksman)
- [`tsserver`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#tsserver)
- [`vimls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vimls)
- [`yamlls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls)
- Linters:
- [`actionlint`](https://github.com/rhysd/actionlint)
- 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## Requirements
- [Patched nerd-font](https://github.com/ryanoasis/nerd-fonts)
- [Neovim 0.9.5](https://github.com/neovim/neovim/releases/tag/v0.9.5)
- [Node.js](https://nodejs.org/en/download)
- [Yarn](https://yarnpkg.com/getting-started/install)
- [Git](https://git-scm.com/downloads)
- [FZF](https://github.com/junegunn/fzf#installation)
- [fd](https://github.com/sharkdp/fd#installation)
- [ripgrep](https://github.com/BurntSushi/ripgrep)
- [shellcheck](https://github.com/koalaman/shellcheck#installing)
- [Zig](https://github.com/ziglang/zig#installation) (optional) - See [Troubleshooting](#troubleshooting) section
- `C` compiler (needed by `nvim-treesitter`):
- [Windows tutorial](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support)
- [Linux tutorial](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Linux-Support)## Installation
### Before cloning
1. Backup your current configuration
2. Remove your `~/.config/nvim` folderOnce you installed this configuration you will be able to integrate your older
configuration. You can see it in [Customization](#customization) section### Cloning
Clone repository in neovim config path:
```sh
git clone --depth 1 https://github.com/Hdoc1509/nvim-config.git ~/.config/nvim
```Or start a new repo with [`tiged`](https://github.com/tiged/tiged):
```sh
tiged Hdoc1509/nvim-config ~/.config/nvim
```**IF YOU ARE A WINDOWS USER,** set the environment variable `XDG_CONFIG_HOME`
with `cmd`:```cmd
setx XDG_CONFIG_HOME %USERPROFILE%\.config
```### Install plugins
1. To suppress git messages about detached HEAD, run:
```bash
git config --global advice.detachedHead false
```2. To install plugins, run:
```bash
nvim --headless +'Lazy! restore' +quit
```3. Due to `headless` mode, some `tree-sitter` parsers can not be successfully
installed. All you need to do is open `Neovim`.## Mappings
Used mapleader is `space key`.
| Mapping | Mode | Description |
| ------------- | --------------- | --------------------------------------------- |
| `` | Normal | Toggle `nvim-tree` with focus in current file |
| `` | Normal | Toggle `nvim-tree` |
| `w` | Normal | Save file |
| `W` | Normal | Save all files |
| `q` | Normal | Save and close file |
| `Q` | Normal | Save all files and close Neovim |
| `tq` | Normal | Close current tab |
| `to` | Normal | Close all other tabs |
| `th` | Normal | Move tab to left |
| `tH` | Normal | Move tab to first position |
| `tl` | Normal | Move tab to right |
| `tL` | Normal | Move tab to last position |
| `tj` | Normal | Go to previous tab |
| `tJ` | Normal | Go to first tab |
| `tk` | Normal | Go to next tab |
| `tK` | Normal | Go to last tab |
| `[` | Normal | Jump to tag under cursor in a split |
| `]` | Normal | Jump to tag under cursor in a new tab |
| `j` | Normal / Visual | Scroll down 10 lines |
| `J` | Normal / Visual | Scroll down 20 lines |
| `k` | Normal / Visual | Scroll up 10 lines |
| `K` | Normal / Visual | Scroll up 20 lines |
| `sb` | Normal | Toggle scrollbind in windows of current tab |
| `>` | Normal | Resize current split 10 pixels to left |
| `<` | Normal | Resize current split 10 pixels to right |
| `chh` | Normal | Run `:checkhealth` |
| `` | Normal | Jump to left split |
| `` | Normal | Jump to bottom split |
| `` | Normal | Jump to top split |
| `` | Normal | Jump to right split |
| `H` | Normal | Move window to previous tab |
| `L` | Normal | Move window to next tab |
| `gaa` | Normal | Execute `git add --all` |
| `gd` | Normal | Execute `git diff` |
| `gp` | Normal | Execute `git push` |
| `gl` | Normal | Execute `git pull` |
| `gs` | Normal | Execute `git status` |
| `gc` | Normal | Execute `git commit` |
| `` | Normal / Insert | Toggle Uppercase of word under cursor |
| `` | Normal / Insert | Toggle Title Case of word under cursor |
| `` | Normal / Insert | Remove current line |
| `ya` | Normal | Copy all text of current file to clipboard |
| `e` | Normal | Search files with `fzf` |
| `]t` | Normal | Jump to next TODO comment |
| `[t` | Normal | Jump to previous TODO comment |
| `/` | Normal | Clear search highlighting |
| `rr` | Normal | Run HTTP request under the cursor |
| `rl` | Normal | Re-run the last HTTP request |
| `vh` | Command | Open help window in vertical split |
| `th` | Command | Open help window in new tab |
| `mo` | Normal (\*) | Start Markdwon preview |
| `mc` | Normal (\*) | Stop Markdown preview |
| `mt` | Normal | Toggle Markdown renderer |
| `f` | Normal | Format current file |
| `F` | Normal | Format and save current file |
| `H` | Normal | Preview folded lines |
| `o` | Normal [N] | Add blanklines below current line |
| `O` | Normal [N] | Add blanklines above current line |
| `]c` | Normal | Jump to next hunk |
| `[c` | Normal | Jump to previous hunk |
| `hs` | Normal | Stage hunk |
| `hs` | Visual | Stage selected hunk(s) |
| `hr` | Normal | Reset hunk |
| `hr` | Visual | Reset selected hunk(s) |
| `hS` | Normal | Stage buffer |
| `hu` | Normal | Unstage hunk |
| `hR` | Normal | Reset buffer |
| `hp` | Normal | Preview hunk |
| `` | Insert | Insert `supermaven` suggestion |
| `` | Insert | Accept `supermaven` word suggestion |
| `` | Insert | Clear/Cancel `supermaven` suggestion |
| `-` | Normal | Open mini.files explorer in current file |
| `_` | Normal | Open mini.files explorer |
| `` | Insert / Normal | Toggle spell checking |
| `` | Normal | Reload (re-edit) file |
| `r` | Visual | Replace selected text in current file |
| `R` | Visual | Replace selected text in all files |
| `z` | Normal | Toggle Zen Mode |
| `fs` | Normal | Enable Fullscreen. Only for `nvim-qt` |
| `Fs` | Normal | Disable Fullscreen. Only for `nvim-qt` |
| `` | Normal | Toggle Fullscreen. Only for `neovide` |**(\*): Mappings that show a notify window.**
**[N]: Mappings that can receive a count.**
### Markdown mappings
The following mappings just run on `*.md` files:
| Mapping | Mode | Description |
| ------------- | ----------- | ------------------------------------------------------------------- |
| `sat` | Visual Line | Create a table from shell aliases definitions and run `FormatWrite` |## Git integration
This configuration provides a minimal configuration file for integration with
git.To use it, run the following command:
```sh
git config --global core.editor "nvim -u ~/.config/nvim/minimal.lua"
```## Customization
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`](./lua/globals.lua)
- General options must be placed in [`lua/options.lua`](./lua/options.lua)
- Custom autocommands must be setted in [`lua/autocmds.lua`](./lua/autocmds.lua)
- Plugins configurations must be added inside [`lua/plugins`](./lua/plugins)
folder (can be a `*.lua` file or a folder with an `init.lua` file). Config
files of plugins will be loaded automatically by `lazy.nvim`
- Mappings must be setted in [`lua/maps.lua`](./lua/maps.lua)
- Settings about diagnostic are in [`lua/diagnostic.lua`](./lua/diagnostic.lua)
- Custom icons must be declared in [`lua/icons.lua`](./lua/icons.lua)
- Options related to colorscheme and custom GUI highlighting goes in
[`lua/plugins/colorscheme.lua`](./lua/plugins/colorscheme.lua)
- Options for Neovim GUI's are in [`ginit.vim`](./ginit.vim)
- Util functions must be placed in [`lua/utils.lua`](./lua/utils.lua)If you want to integrate more LSP servers, see the list of all [available LSP
servers](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md).
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`](./lua/plugins/lsp/servers).
- Add it to the list of mason tools in [`lua/plugins/lsp/mason.lua`](./lua/plugins/lsp/mason.lua).## Troubleshooting
### Fail to install treesitter parser
If you are a Windows user and have problems to install `treesitter` parser,
install `zig` and retry to install.### Fail to use `rest.nvim`
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:
```powershell
$GIT_PATH = "C:\Program Files\Git\mingw64\bin"
```- `Git 32-bit` version:
```powershell
$GIT_PATH = "C:\Program Files (x86)\Git\mingw64\bin"
```- Finally, run:
```powershell
[Environment]::SetEnvironmentVariable(
"Path",
"$GIT_PATH;" + [Environment]::GetEnvironmentVariable("PATH", "MACHINE"),
"MACHINE"
)
```### Fail to use with `astro` files
If you have problems to use `astro` files, follow instructions in:
- [`eslint-plugin-astro`](https://github.com/ota-meshi/eslint-plugin-astro)
- [`prettier-plugin-astro`](https://github.com/withastro/prettier-plugin-astro)## My dotfiles
[My dotfiles](https://github.com/Hdoc1509/dotfiles)