A WebStorm inspired config for Neovim
Vim is key-based text-editor. All original keybinds from Vim are saved in this config. So, it's highly recommended to finish Neovim :Tutor first. Default <leader> key is <space>
You can create project from a boilerplate. List of available boilerplates:
- Empty Project
- Angular CLI
- Bootstrap
- Express
- HTML5 Boilerplate
- Next.js
- Node.js
- React Native
- Vite
- Vue.js
Find action using Telescope commands(see Telescope commands) Use <leader>pa to see list of available commands
- To add a line after the current one, press o in normal mode. It will move the caret to the next line.
- To add a line before the current one, press O in normal mode. It will move the caret to the previous line.
- To duplicate a line, press Ctrl-d in normal mode.
- To delete a line, place the caret at the line you need and pressdd in normal mode.
- To join lines, place the caret at the line to which you want to join the other lines and press J.Keep pressing the keys until all the needed elements are joined.
- To comment a line of code, place the caret at the appropriate line and press gcc. Press gcc again on the same line to uncomment it.
- To comment several lines of code, select few lines and press gc. Press gc on selected lines to uncomment them.
- To move a line up or down, select it, press J to move it down or K to move it up.
- To move (swap) an XML or HTML tag attribute to the left or to the right, place the caret at it, or select it and press CtrlAltShift0← for left or CtrlAltShift0→ for right. - ?
Understanding these terms will help you recall the correct keyboard shortcut.
- Y stands for “yank” in Vim, which is conceptually similar to copying.
- D stands for “delete” in Vim, which is conceptually similar to cutting.
- P stands for “put” in Vim, which is conceptually similar to pasting.
- You can use y to copy selected text to Vim buffer.
- You can use y to copy selected text to Vim buffer.
- You can use yy to copy the whole line to Vim buffer.
- You can use Y to copy from caret to the end of line to Vim buffer.
- You can use <leader>y to copy selected text to system clipboard.
- You can use <leader>Y to copy from caret to the end of line to system clipboard.
- You can use d on selected text to cut it into Vim buffer.
- You can use dd to cut the line into Vim buffer.
- You can use <leader>d to cut the line into system clipboard.
- You can use p to put the data from Vim buffer after the cursor.
- You can use P to put the data from Vim buffer before the cursor.
- You can use Ctrl-Shift-V to put the data from system clipboard after the cursor.
By default, when you select text and paste something upon the selected text, selected text goes to Vim buffer. To prevent it you can use <leader>p, so it will save what you have in Vim buffer.
If some commands above don't copy in to system clipboard, try to install xsel to your system.
Use v to enter view mode and start selection. Use V to enter view mode with line selection.
Select needed code statement then use H or J to move it up or down.
- Press Ctrl-Space in insert mode to start completion.
- Use Ctrl-j or Ctrl-h to select next or previous to choose relevant suggestion.
- Use <CR></kbd> after selection to complete statement.
- Use U in visual mode to convert selected text to uppercase.
- Use u in visual mode to convert selected text to lowercase.
- Use ~ in visual mode to toggle case.
- Use gc to comment selected code fragment in visual mode.
- To toggle between fold and unfold, press za.
- To collapse or expand all code fragments, press zM/zR in normal mode.
- To collapse or expand code recursivly, press zc/zo in normal mode.
- To create custom folding region use zf on selected code in view mode to create foldable region in visual mode.
- To delete custom folding region use zd in normal mode.
- To delete custom folding region and all nested regions use zD in normal mode.
- To peek folded lines under cursor use K in normal mode.
See navigation between windows
When you work this config displays code analysis results that include errors and warnings on the scrollbar. You can check whether your code has issues and quickly navigate to them.
For more information and customization check nvim-scrollbar
Every time you open a file for editing, a tab with its name is added next to the active editor tab.
- To close only active tab use
- To close all tabs except pinned use bwp
- To close all tabs except current use bwc
- To close all tabs except current and pinned tabs use bwe
- To close all tabs on the left from current tab use bwl
- To close all tabs on the right from current tab use bwl
- To copy relative path of current tab file use cf
- To copy absolute path of current tab file use cF
- To copy filename path of current tab file use ct
- To copy directory name of current tab file use ch
- To move tab to the left use
- To move tab to the left use
- To sort tabs by use
- To sort tabs by use
- To sort tabs by use
- To sort tabs by use
Plugin | Description |
---|---|
Comment | Smart and Powerful commenting plugin for neovim |
nvim-ts-context-commentstring | A Neovim plugin for setting the commentstring option based on the cursor location in the file. |
vim-illuminate | Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching. |
mason.nvim | Portable package manager for Neovim that runs everywhere Neovim runs.Easily install and manage LSP servers, DAP servers, linters, and formatters. |
mason-lspconfig.nvim | mason-lspconfig bridges mason.nvim with the lspconfig plugin - making it easier to use both plugins together. |
nvim-lspconfig | Configs for the Nvim LSP client |
nvim-cmp | A completion engine plugin for neovim written in Lua. |
cmp-nvim-lsp | nvim-cmp source for neovim's built-in language server client. |
Luasnip | Dependency plugin for nvim-cmp |
project.nvim | project.nvim is an all in one neovim plugin written in lua that provides superior project management. |
nvim-web-devicons | Plugin to provide web-icons |