⌨️ Keyboard shortcuts
...

This neovim configuration tries as much as possible to use shortcuts common in other code editors, trying to be as close as possible to other editors like VSCode but with the accessibility of neovim.

Note

By default the <leader> key is space, you can set it to whatever you need in the init.lua file in the vim.g.mapleader variable.

Reset
...

KEYMODECOMMANDFUNCTION
Escnormal insert<Esc>:VMClear <BAR> :nohl <CR>Pressing the escape key tries to delete all selections made by the vim-multi plugin and by "/".

Buffer
...

KEYMODECOMMANDFUNCTION
qnormal<cmd>:q<CR>Closes the current buffer or the editor
<leader> + q + qnormal<cmd>:q!<CR>Forces the buffer to close
Ctrl + snormal insert<cmd>:w<CR>Saves changes made to the buffer
Ctrl + h + hnormal<cmd>:bprevious<CR>Move to the previous buffer
Ctrl + l + lnormal<cmd>:bnext<CR>Move to the next buffer
Ctrl + q + qnormal<cmd>:Bdelete<CR>Closes the current buffer but does not close the entire editor
<leader> + n + rnormal<cmd>:vsplit<CR>Open a window with the current buffer on the right side.
<leader> + n + bnormal<cmd>:split<CR>Open a window with the current buffer on the bottom side.
Ctrl + fnormal insert<Esc>/Allows you to search the buffer for the phrase you require

Text Manipulation
...

KEYMODECOMMANDFUNCTION
Ctrl + cvisualyAllows you to copy the selected text
Ctrl + vinsert<Esc>piAllows you to paste the previously copied text
Ctrl + xvisualdAllows you to cut the selected text
Ctrl + anormal visual<Esc>gg0vG$Allows you to select all text in the current buffer
Ctrl + znormal insert<cmd>:undo<CR>Desase the last change made
Ctrl + ynormal insert<cmd>:redo<CR>Restore the last discarded change
Alt + DownnormalyypAllows you to copy the line you are on at the bottom of the page.
Shift + Downnormal:m+1<CR>Moves the line to the bottom of the line.
Ctrl + pnormal insert<cmd>:CommentToggle<CR>Comment on the current line
Ctrl + pvisual<S-:>CommentToggle<CR>Comments on selected lines in visual mode

File manager
...

KEYMODECOMMANDFUNCTION
Ctrl + bnormal insert<Esc><cmd>:NeoTreeFocusToggle<CR>Allows you to open the Neotree plugin file tree.
<leader> + f + fnormal<cmd>Telescope fd<CR>Displays the list of files in the project.
<leader> + f + enormal<cmd>Telescope diagnostics<CR>Displays the list of buffer diagnostic messages.
<leader> + f + bnormal<cmd>Telescope buffers<CR>Displays the list of currently open buffers.
<leader> + f + hnormal<cmd>Telescope help_tags<CR>Displays the list of available aids.
<leader> + h + hnormal<cmd>Telescope colorscheme<CR>Displays the list of available themes for the editor.
<leader> + g + cnormal<cmd>Telescope git_commits<CR>Displays the list of commits performed on the project.
<leader> + g + snormal<cmd>Telescope git_status<CR>Displays the list of changes to files in the git repository.
<leader> + g + fnormal<cmd>Telescope git_files<CR>Displays the list of files in the git repository.
<leader> + g + bnormal<cmd>Telescope git_branches<CR>Displays the list of branches that exist in a git repository.
<leader> + t + cnormal<cmd>TodoTelescope<CR>Displays the list of TODO comments in the project.

Terminal
...

KEYMODECOMMANDFUNCTION
<leader> + t + rnormal<cmd>:botright vnew <BAR> :terminal<CR>This command will open a terminal on the right of the current buffer.
<leader> + t + bnormal<cmd>:botright new <BAR> :terminal<CR>This command will open a terminal at the bottom of the current buffer.
<leader> + tnormal<cmd>:ToggleTerm<CR>This command will open a toggleterm plugin terminal, by default a floating terminal.

Git
...

KEYMODECOMMANDFUNCTION
Ctrl + gnormal<cmd>:Gitsigns toggle_current_line_blame<CR>Shows a virtual text line with the last changes in the line.

Execute files
...

KEYMODECOMMANDFUNCTION
<leader> + m + pnormal<cmd>:MarkdownPreviewToggle<CR>Allows to open the current markdown file in the browser
<leader> + o + hnormal<cmd>:OpenHTML<CR>Open an HTML file in the default browser
<leader> + r + pnormal<cmd>:RunPython<CR>Execute the python file
<leader> + r + j + snormal<cmd>:RunJavaScript<CR>Execute the javascript file
<leader> + r + c + p + pnormal<cmd>:RunCPP<CR>Execute the c++ file
<leader> + r + cnormal<cmd>:RunC<CR>Execute the c file
<leader> + r + t + snormal<cmd>:RunTypeScript<CR>Execute the typescript file
<leader> + r + s + c + snormal<cmd>:RunScss<CR>Execute the scss file
<leader> + r + g + onormal<cmd>:RunGo<CR>Execute the go file

LSP
...

KEYMODECOMMANDFUNCTION
Shift + Alt + fnormalvalidates_the_code_formatting_typeFormat the code using the function that discriminates which files to format with neoformat
Shift + Alt + f + fnormalvim.lsp.buf.formatFormats the code using the default LSP server formatter
Tabnormalvim.lsp.buf.hoverDisplays the information of the selected method or variable
Ctrl + dnormalvim.lsp.buf.definitionOpen the buffer where you defined the function or variable you have selected
Ctrl + RightMousenormalvim.lsp.buf.definitionOpen the buffer where you defined the function or variable you have selected
Ctrl + knormalvim.lsp.buf.code_actionExecute the client's codeactions
Ctrl + enormalfunction() vim.diagnostic.open_float(0, { scope = "line", border = "rounded" }) endOpen diagnostic messages on selected line

CMP Autocomplete
...

KEYMODECOMMANDFUNCTION
Ctrl + spaceinsertcmp.mapping.complete()Open the menu with suggestions for completion
Ctrl + ninsertcmp.mapping.complete()Open the menu with suggestions for completion
Ctrl + cinsertcmp.mapping(go_close_menu, { "i", "s" })Closes the menu with suggestions to complete
Downinsertcmp.mapping(go_down_in_menu, { "i", "s" })Scroll down the menu
Upinsertcmp.mapping(go_up_in_menu, { "i", "s" })Scroll up the menu
Ctrl + jinsertcmp.mapping.scroll_docs(-4)Scrolls down in the menu jumping on 4 items
Ctrl + kinsertcmp.mapping.scroll_docs(4)Scrolls up in the menu jumping on 4 items
Enterinsertcmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Insert, select = true, }Inserts the selected suggestion