Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cheatsheet for Keymaps #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions KeyMapCheatSheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# KeyMap Cheat-Sheet

For anyone who is just starting with this neovim config!

##### Note:

- Vim Commands still work as they do one vanilla neovim
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one -> in? on?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ion?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ion?

Talking about the grammar I think, in the line they do one vanilla neovim, should be they do in/on neovim.

- All keybinds can be changed according to one's preference in the `keymaps.lua` file located at `.../nvim/lua/user/lsp/`

- To make edits enter (Debian):

```sh
cd ~/.config/nvim/lua/lsp
nvim keymaps.lua
```

- [Explainer (Video)](https://www.youtube.com/watch?v=435-amtVYJ8&list=PLhoH5vyxr6Qq41NFL4GvhFp-WLd5xzIzZ&index=3)

- All commands are case sensitive
- Both `<CTRL>` keys (R, L) are supported for commands requiring to press one
- Press `<SPACE>` to open

**Helper Menu can be accessed via `<SPACE>`**

## Normal mode

One can trigger these key-binds directly

#### Buffers (Open Files) Navigation

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :------------------: | :-----------------: |
| `<SHIFT>+l` | Open Next buffer | `:bnext` |
| `<SHIFT>+h` | Open Previous buffer | `:bprevious` |
| `<SPACE>+c` | Close Current Buffer | `:bd` |

#### Window Navigation

| Key-Combination | Action |
| :-------------: | :------------------: |
| `<CTRL>+h` | Move to Left Window |
| `<CTRL>+j` | Move to Window Below |
| `<CTRL>+k` | Move to Window Above |
| `<CTRL>+l` | Move to Right Window |

#### Window Resize (with arrows)

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :-------------: | :-------------------: |
| `<CTRL>+Up` | Increase Height | `:resize -2` |
| `<CTRL>+Down` | Decrease Height | `:resize +2` |
| `<CTRL>+Left` | Increase Width | `:vertical resize -2` |
| `<CTRL>+Right` | Decrease Width | `:vertical resize +2` |

> Note: Up, Down, Left and Right are the Arrow keys

#### Move text

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :----------: | :-----------------: |
| `<ALT>+j` | Move line up | `:m .+1` |
| `<ALT>+k` | Move line up | `:m .-2` |

#### Text Editing

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :--------------: | :-----------------: |
| `i` | Insert Mode | `i` |
| `jk` | Exit Insert Mode | `<ESC>` |

## Visual Mode

One needs to be in the visual mode for these binds to work

> Note: Press `v` to enter visual mode

#### Add Indentation

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :-----------: | :-----------------: |
| `<` | Remove Indent | `<gv` |
| `>` | Add Indent | `>gv` |

#### Move text

| Key-Combination | Action | Vim Key-Combination |
| :-------------: | :-------: | :-----------------: |
| `<ALT>+j` | Move Down | `:m .+1` |
| `<ALT>+k` | Move Up | `:m .-2` |

**For those who are beginning with vim/neovim please visit this [site](https://devhints.io/vim) for the basic commands**

Feel free to contribute more to this file!