commands
documentation for commands can be found here. currently using the space bar as <leader>
from normal mode
| purpose | command |
|---|---|
| save and quit | shift+z, shift+z |
| save without quitting | :w |
| quit without saving | shift+z, shift+q |
| insert mode (equivalent to standard mode of other text editors) | i |
| search forward | /thing ur searching for+enter |
| search backward | ?thing ur searching for+enter |
| go to next occurrence of last search | /+enter or n |
| go to previous occurrence of last search | ?+enter or N |
| find and replace on current line | :s/pattern/replace/g |
| repeat last substitution on current line | & |
| find and replace in current file | :%s/pattern/replace/g |
| find last search and replace in current file | :%s//replace/g |
| undo | u |
| go to top of file | gg |
| go to bottom of file | G |
| select all text in a file | ggVG |
| paste into line below | p |
| delete selection | d |
| delete current line | dd |
| move current line down | ddp |
| move current line up | ddkP |
| copy current line/selection | yy |
| insert line above | O |
| insert line below | o |
| go to the beginning of the current line and switch to insert mode | I |
| go to the end of the current line and switch to insert mode | A |
| select the word under the cursor | viw |
| open link under the cursor | gx |
| move one word right | w |
| move one word left | b |
from visual mode
enter visual mode by using the mouse to select something, or by pressing v (or V to select whole line)
| purpose | command |
|---|---|
| toggle commenting of selecting lines | highlight lines, then gc |
| paste into selection | p |
other
| abbreviation | meaning |
|---|---|
| <.*> | keystroke |
| <CR> | enter (carriage return) |
| <C> | control |
| <S> | shift |
- the following characters need to be escaped when searching:
/ ~
configuring
using lazyvim. to configure lazyvim or install a new plugin, make a new lua file in ~/.config/nvim/lua/plugins. the format should look like
return {
-- paste whatever stuff the author says to paste
-- for using lazy.vim
}for example, to make lazyvim use catppucin colors with a transparent background, run nvim ~/.config/nvim/lua/plugins/theme.lua and paste
return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin",
},
},
{
"catppuccin",
opts = {
transparent_background = true,
},
},
}or to install markdown-plus.nvim, run nvim ~/.config/nvim/lua/plugins/markdown-plus.lua and paste
return {
{
"yousefhadder/markdown-plus.nvim",
ft = "markdown", -- Load on markdown files by default
config = function()
require("markdown-plus").setup({
-- Configuration options (all optional)
enabled = true,
features = {
list_management = true, -- Enable list management features
text_formatting = true, -- Enable text formatting features
headers_toc = true, -- Enable headers and TOC features
links = true, -- Enable link management features
},
keymaps = {
enabled = true, -- Enable default keymaps
},
filetypes = { "markdown" }, -- Filetypes to enable the plugin for
})
end,
},
}plugin sources: