-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
454 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
stats/ | ||
static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
!SLIDE normal | ||
# Basic Skills | ||
|
||
Open, close, edit, save. | ||
|
||
!SLIDE code | ||
# Basic Skills | ||
|
||
@@@vim | ||
vim, i, <esc>, :q, :e, :w, <CR> | ||
|
||
!SLIDE normal bullets incremental | ||
## Modal Editing | ||
|
||
* **Normal** - movement and action | ||
* **Visual** - selection | ||
* **Insert** - boring old plain old typing | ||
* **Command** - substitution and plugin commands | ||
* **Ex-mode** - only by accident | ||
* **Search?** - it's kind of like a mode? | ||
|
||
!SLIDE normal bullets incremental | ||
|
||
# *Digression* | ||
|
||
## vimrc | ||
|
||
* this is where your customizations will go. yours will be unique to you. | ||
* but for your sanity, make saving easier | ||
* and make things prettier | ||
|
||
!SLIDE code | ||
# *Digression* | ||
|
||
@@@vim | ||
|
||
" saving | ||
map <D-s> :w<CR> " just save | ||
imap <D-s> <esc>:w<CR> " save and return to normal mode | ||
vmap <D-s> <esc>:w<CR>gv " save and reselect | ||
|
||
" colors | ||
syntax on " Enable syntax highlighting | ||
filetype plugin indent on " Enable filetype-specific | ||
" indenting and plugins | ||
set background=dark " | ||
colorscheme desert " best non-Solarized scheme | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
!SLIDE normal | ||
# Movement | ||
|
||
Getting around at normal speeds vs. getting around quickly. | ||
|
||
!SLIDE normal | ||
## Movement Keys | ||
|
||
h j l k | ||
e w b | ||
|
||
!SLIDE normal | ||
## Search Based Movement | ||
|
||
search mode, move to **f**irst character, move un<strong>t</strong>il you find | ||
|
||
!SLIDE normal | ||
## Search Based Movement | ||
|
||
f t F T " one line, forward / BACKWARD | ||
/ ? " whole file, forward / backward | ||
|
||
While searching | ||
|
||
; " one line find again | ||
n " next | ||
N " previous | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
!SLIDE normal | ||
# Selection | ||
|
||
Also known as "Visual Mode". Strong stuff. | ||
|
||
v V <C-v> | ||
|
||
!SLIDE normal | ||
# Selection | ||
|
||
Works with simple movement | ||
|
||
vlllllll " select seven characters to the right | ||
|
||
!SLIDE normal | ||
# Selection | ||
|
||
Works with search | ||
|
||
vf= " select everything on this line | ||
" up to and including the next = | ||
|
||
v/end<CR> " select everything until you find | ||
" the next word 'end' | ||
|
||
!SLIDE normal | ||
# Yank and Paste | ||
|
||
**y**ank, **p**aste, **c**hange, **d**elete | ||
|
||
!SLIDE normal | ||
# Yank and Paste | ||
|
||
y p P | ||
c d | ||
yy dd | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
**v**isual select **a**ll of a **w**ord, **c**hange **i**nside the **"**'s | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
vaw | ||
vi" | ||
va" | ||
ci( | ||
ciw | ||
|
||
`text-objects` | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
one command | ||
|
||
va" | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
two parts | ||
|
||
va " | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
verb - subject | ||
|
||
visual select all | ||
| | ||
va " | ||
| | ||
of this quoted text | ||
|
||
For example: | ||
|
||
They said, "you're crazy! |It'll never work!" | ||
^ cursor | ||
|
||
They said, "you're crazy! It'll never work!|" | ||
---------------------------------- | ||
^ selection | ||
|
||
!SLIDE normal | ||
# TEXT OBJECTS | ||
|
||
BLAM! `text-objects`! | ||
|
||
v[ia]_ | ||
w word | ||
s sentence | ||
p paragraph | ||
( ()s | ||
[ []s | ||
{ {}s | ||
< <>s | ||
t html tag | ||
" ""s | ||
' ''s | ||
|
||
!SLIDE normal | ||
# It Goes Both Ways! | ||
|
||
`o` while in visual mode puts the cursor at the **o**ther end of the selection. | ||
|
||
!SLIDE normal | ||
# **BONUS** TEXT OBJECTS | ||
|
||
Also works with **c**hange, **d**elete, and **y**ank! | ||
|
||
c[ia]_ | ||
d[ia]_ | ||
y[ia]_ | ||
w word | ||
s sentence | ||
p paragraph | ||
( ()s | ||
[ []s | ||
{ {}s | ||
< <>s | ||
t html tag | ||
" ""s | ||
' ''s | ||
|
||
But visual first is nice because then you can see what you're doing. | ||
|
||
!SLIDE | ||
# Use a cheat sheet | ||
|
||
!SLIDE center | ||
|
||
![cheat sheet](vi-vim-cheat-sheet.gif) | ||
|
||
!SLIDE normal bullets | ||
# **s**ubstitutions | ||
|
||
Command mode, finally! | ||
|
||
One line: | ||
|
||
:s/this/that/ | ||
|
||
All lines: | ||
|
||
:%s/this/that/ | ||
|
||
Ask me each time: | ||
|
||
:%s/this/that/c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
!SLIDE normal bullets | ||
# Handling Multiple Files | ||
|
||
* Splitting windows | ||
* Working between files (hint: unix-style rears it's head) | ||
|
||
!SLIDE normal bullets | ||
# Splitting windows | ||
|
||
<C-w> + ... | ||
|
||
* **v**ertical split | ||
* horizontal **s**plit | ||
* **q**uit | ||
|
||
!SLIDE normal | ||
|
||
# Moving around splits | ||
|
||
Shortcuts (highly recommended) | ||
|
||
inoremap <C-h> <esc><C-w><C-h> | ||
inoremap <C-j> <esc><C-w><C-j> | ||
inoremap <C-k> <esc><C-w><C-k> | ||
inoremap <C-l> <esc><C-w><C-l> | ||
noremap <C-h> <C-w><C-h> | ||
noremap <C-j> <C-w><C-j> | ||
noremap <C-k> <C-w><C-k> | ||
noremap <C-l> <C-w><C-l> | ||
|
||
!SLIDE normal | ||
# Helpful Plugins for Multi-file Work | ||
|
||
## ag / ack | ||
|
||
Search - `ag` https://github.com/ggreer/the_silver_searcher | ||
|
||
Vim integration - `ack.vim` https://github.com/mileszs/ack.vim | ||
|
||
## NERDTree | ||
|
||
File browser - https://github.com/scrooloose/nerdtree | ||
|
||
## ctrlp | ||
|
||
Fuzzy file finder - https://github.com/kien/ctrlp.vim |
File renamed without changes
Oops, something went wrong.