Skip to content

tommmyy/vim-workshop

Repository files navigation

Vim - cool moves

Tomáš Konrády


https://i.pinimg.com/originals/4a/90/4d/4a904d967b26a89fe6773c93c501cce5.jpg


Setup

  • capslock
  • MacOS - keystrokes speed - High or Low?

Opening the Vim


Normal Mode


Good bye to arrows and wasd

  • hjkl
  • arrow keys -> bind to noop

Words, words, words...

  • wW
  • bB
  • eE

Numbers

  • number -> 4w

Line movement

  • ^ _ 0
  • $ g_

Screen movement

  • gg, G, G
  • } {
  • C-d, C-u
  • H(igh) M(iddle) L(ow)
  • <num>{j|k} - relative line-numbering
  • Cursor: zt, zz, zb

First editation moves


  • x
  • p
  • Konráyd

Shortcuts as a functions

  • function + object
  • dw
  • D, dd
  • diw
  • di{
  • da), or da(
  • dit

Insert mode


  • i
  • a
  • s
  • c
  • A
  • I
  • o, <shift-o>

Horizontal movement


  • tT
  • fF
  • ;,
  • ctrl-i / ctrl-o

Command mode


  • :w, :q, :q!, :bw

  • :100

  • /search

  • %s/foo/bar/g - *

  • ?s/foo/bar/g - #

  • Example: zoe - extracting a function


  • !

./example-exclamation.txt


Visual mode


Basics

./example-vmode-basics.js

  • v, V, <C-v>
  • o - toggle free end of selection
  • gv - in normal mode reselects last visual selection
  • U - uppercase the selection
  • u - lowercase
  • ~ - toggle case
  • Vr- - replace all chars in selection with dash

Multicursors?


.vimrc


Plugins

  • vundle
  • NerdTree
  • VimPicker
  • VimSurround
  • Fugitive

Coc

Example: zoe


ALE

Example: zoe


Macros

./example-macro.js


Sources


  • tmux - terminal multiplexor
  • neovim
  • vimium

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published