• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/20

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

20 Cards in this Set

  • Front
  • Back

Change the next selected highlighted word from search results

cgn




Press . to change all words (good for renaming method names etc)

Put "hello" after every search pattern using :g

:g/[search]/ Ahello

Delete all lines except where search found results

:v/[search]/d

Ignore errors when searching (useful for macros that use search)

s/foo/bar/e

Run a macro in register q on all lines containing a pattern

:g/[search]/ norm @q

Edit a macro in register q

1. Open new buffer using "enew"


2. Paste the macro using "qp


3. edit to your heart's desire


4. yank the edited macro back to the register using "qy$

Find where a variable was defined.

* to highlight all occurrences. ggn to go to first occurrence. (GN goes to last - maybe useful for finding where a private method is declared)

Find occurrences of a string that occur anywhere

g*

Find the second occurrence of a search string

:2/[search]

Find occurrence and position cursor at end of word

:/search/e

Replace hello with hello_world by grouping "hello"

:s/\v(hello)/\1_world/ => hello_world

Replace the last replaced text

:s/~/hello/

Do a case sensitive search

/seaRch\C

Search with word boundaries



/\


or


/\v

search for method that does not end in a pattern



/\vhello_(fred)@!

Use expand to insert the absolute file path whilst in insert mode

=expand('%:p')

Show full filepath at bottom

1

Insert the pwd

:read !pwd

Automatically map --- to — whilst typing

:iabbrev --- —

1. Map the movement p to in brackets.

:onoremap p i(




or to have it so we can run the command on any line




:onoremap in( :<c-u>normal! f(vi(<cr>