Skip to content

Instantly share code, notes, and snippets.

@Maple-pro
Last active June 16, 2024 09:56
Show Gist options
  • Save Maple-pro/988bbfc01e39c8b110cf988a22e54f8f to your computer and use it in GitHub Desktop.
Save Maple-pro/988bbfc01e39c8b110cf988a22e54f8f to your computer and use it in GitHub Desktop.
Commonly used shortcuts

Shortcuts

IdeaVim

<leader> key is ,

Key Mappings Details
J ideajoin: Join a selected block of text together.
<leader>f{char} easymotion: Find {char} to the right.
<leader>s{char} easymotion: Find {char} forward and backward.
<leader>j easymotion: Line downward.
<leader>k easymotion: Line upward.
cs{oldChar}{newChar} surround: Change the surroundings in pairs.
ds{char} surround: Remove the surroundings in pairs.
ysiw{char} surround: Surround the word with the {char}.
yss{char} surround: Surround the line with the {char}.
S{...} surround: Press V to enter visual line mode, surround the selected block with a string.
gcc commentary: Comment the line.

Tmux

<leader> key is <Ctrl>-B

Key Mappings Details
tmux [new -s name] Start a new session.
tmux ls List existing sessions.
tmux at [-t name] Attach to session.
tmux kill-sesssion -t name Kill a sessioin by name.
<leader>d Detach from the current session.
<leader>c Create a new window.
<leader>s Swith between sessions.
<leader>w Switch between sessions and windows.
<leader>:new Create a new session.
<leader>$ Rename current session.
<leader>n Next window.
<leader>p Previous window.
<leader>" Split pane vertically.
<leader>% Split pane horizontally.
<leader><space> Switch the split pane between vertical and horizontal
<leader>{num} Go to target window.
<leader>q{num} Go to target pane.
<leader><Arrow> Go to pane.
<leader>x Close current pane.
<leader>& Close current window.
<leader>I Install plugins with TPM.
<leader>U Update plugins with TPM.
<leader> <Alt>-u Remove plugins with TPM.
<leader> <Ctrl>-s Save the current environment.
<leader> <Ctrl>-r Restore the saved environment.

NVim

For new installation:

  • PackerSync: install plugins
  • TSUpdate: install treesitter
  • MasonUpdate: install lsp clients

<leader> key is ,

  • iw: inner word, e.g., di' means delete all the thing inside the '
  • aw: arround word, include whitespace
Key Mappings Details
<Ctrl>-o Back to the previous place
:bp Previous buffer
:bn Next buffer
:b {buffer} Open buffer
:e {file} Open file
<Ctrl>-w <Arrow> Switch between windows
zc Close a folding
zo Open a folding
<Alt>-m or ,m nvim-tree: Toggle panel
<Ctrl>-p telescope: Find files
<Ctrl>-f telescope: Live grep
gc commentary: Toggle comment
gd LSP: Jump to definition
gh LSP: Hover documentation, press gh again jump into the hover window, gx to open link
gr LSP: List all references
gp LSP (diagnostic): Show line diagnostic
gj LSP (diagnostic): Jump to next
gk LSP (diagnostic): Jump to previous
<leader>rn LSP: Rename
<leader>ca LSP: Code actions (press q to quit)
<Ctrl>-<Alt>-l LSP: Format the file
<leader>s{char} hop: Find {char} forward and backward
<leader><leader>s{char}{char} hop: Jump by two keys
<leader>f{char} hop: Find {char} forward
<leader>j hop: Jump to line start forward
<leader>k hop: Jump to line start backward
<Ctrl>-\ toggleterm: toggle terminal
<leader>git toggleterm: lazygit terminal
<leader>th toggleterm: horizontal terminal
<leader>tt toggleterm: tab terminal
<leader>tf toggleterm: float terminal
<leader>gj gitsigns: next hunk
<leader>gk gitsigns: previous hunk
<leader>gp gitsigns: preview hunk
<leader>gb gitsigns: blame line
<leader>gd gitsigns: diff this hunk
<leader>gtb gitsigns: toggle line blame

IntelliJ

Key Mappings Details
<Alt>-1 Toggle project structure.
<Ctrl>-e Recent open files.
<Ctrl>-<Shift>-e Recent locations.
<Shift><Shift> Find all.
<Ctrl>-n Find class.
<Ctrl>-<Shift>-n Find file.
<Ctrl>-<Shift>-a Find actions.
<Ctrl>-<Shift>-f Find in files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment