Skip to content

Instantly share code, notes, and snippets.

@firedynasty
Created May 22, 2021 21:02
Show Gist options
  • Save firedynasty/e5d92e23a185db570e791fca5cb53b67 to your computer and use it in GitHub Desktop.
Save firedynasty/e5d92e23a185db570e791fca5cb53b67 to your computer and use it in GitHub Desktop.

COLON

show line numbers

the way that you do that is this:

":" + set number

use: todolist.jsx

FIND AND REPLACE

replace something

https://stackoverflow.com/questions/1048639/unable-to-replace-a-space-with-a-new-line-in-vim/1048646

Search and delete

:g/George Bush/d

:g/^[0-2][0-3]:[0-5][0-9]$/d

VERB MODIFIER OBJECTS

delete word

'dw'

delete word and insert

'diw' deletes a word that your cursor is on.

change the current sentence

S

or

'cis'

change all words inside bracket

'ci['

delete line

'dd'

insert line

from normal mode

'o'

VISUAL BLOCK MODE

highlight and delete

'Shift + V' , use arrow keys , 'd'

PRESET

copy to clipboard

https://stackoverflow.com/questions/9166328/how-to-copy-selected-lines-to-clipboard-in-vim

if has('clipboard')
    if has('unnamedplus')  " When possible use + register for copy-paste
        set clipboard=unnamed,unnamedplus
    else         " On mac and Windows, use * register for copy-paste
        set clipboard=unnamed
    endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment