# 02. Default keyboard shortcuts

Neovim is a modern version of Vim, a text editor used on Unix systems. Here are some keyboard shortcuts for working with Neovim:

### Basic movement:

- `h` - Left movement
- `j` - Move down
- `k` - Move up
- `l` - Move right
- `w` - Move to the beginning of the next word
- `b` - Move to the beginning of the previous word
- `gg` - Move to the beginning of the document
- `G` - Move to the end of the document

### Visual mode:

I switch to it in Normal mode by moving `v` where the cursor was to mark text.

### Normal mode - NORMAL:

I move to normal mode from other modes using `ESC`.

- `i` - Switch to insert mode before the cursor
- `I` - Switch to insert mode at the beginning of the line
- `a` - Switch to insert mode after the cursor
- `A` - Switch to end-of-line insertion mode
- `o` - Insert a new line below the current line
- `O` - Insert new line above the current line
- `dd` - Delete a line
- `dw` - Deleting a word
- `yy` - Copying a line
- `p` - Paste the contents of the clipboard under the cursor
- `P` - Insert clipboard contents before cursor
- `u` - Undo the last action performed
- `Ctrl + r` - Step forward opposite `u`
- `q` - Closes the window
- `.` - Last command
- `Ctrl + w` - Switch windows

### Command mode:

Command mode is invoked with `Shift + :`

- `:e + filename` - Creates a new file - `:e index.html`
- `:w` - Save changes
- `:q` - Exit the editor
- `:wq` - Save changes and exit
- `:q!` - Exit the editor without saving changes
- `:vs` - Vertical window layout
- `:sp` - Horizontal window layout
- `:colorscheme` - Changes the theme
- `:term` - Opens terminal

### Search and replace:

- `/searched_text` - Search text
- `n` - Skip to the next occurrence of the search text
- `N` - Skip to the previous occurrence of the search text
- `:s/searched_text/replaced_text/g` - Replacing the search text with the specified text throughout the document

### Misc:

- `Ctrl + r` - Re-execute a cancelled action
- `:help` - Display help

Copyright © 2024 - 2025 🚀 ApolloNvim / Lukáš Kaňka