Skip to content

Commit

Permalink
REFACTORED
Browse files Browse the repository at this point in the history
  • Loading branch information
abachman committed Jun 22, 2017
1 parent 9acd58a commit e964efb
Show file tree
Hide file tree
Showing 28 changed files with 454 additions and 197 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
stats/
static/
16 changes: 4 additions & 12 deletions mindfulness/01_intro.md → 01_mindfulness/01_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

## *Seeking Editor Purity by Driving Evil Away*

**Adam Bachman**
Baltimore Node
17 November 2010
[using-vim.heroku.com](http://using-vim.heroku.com)

!SLIDE dark-image center
Expand All @@ -22,20 +19,15 @@ Baltimore Node
!SLIDE blue-image center
# THIS<br>REPRESENTS<br>GOOD FEELINGS

!SLIDE normal text-heavy
!SLIDE normal

# The Zealots Are Wrong

Invariably, the master vim users that were helping me make the switch would
encourage me to stick it out. "If you just give it a few weeks,
you'll never want to switch back."
Invariably, the master vim users that were helping me make the switch would encourage me to stick it out. "If you just give it a few weeks, you'll never want to switch back."

The last few times someone tried to get me to switch to vim, I issued them a
simple challenge. Can you tell me a way to switch that will not significantly
reduce my productivity for the first few weeks?
The last few times someone tried to get me to switch to vim, I issued them a simple challenge. Can you tell me a way to switch that will not significantly reduce my productivity for the first few weeks?

[Yehuda Katz, "Everyone Who Tried to Convince Me to use Vim was
Wrong"](http://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/)
[Yehuda Katz, "Everyone Who Tried to Convince Me to use Vim was Wrong"](http://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/)

!SLIDE normal bullets incremental

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
!SLIDE normal
# Start Slowly

Start with the things you're already comfortable with, mouse, arrow keys,
Ctrl-S to save. Where possible, make no changes.
Start with the things you're already comfortable with, mouse, arrow keys, ⌘-s to save.

As much as possible, make no changes to your workflow.

!SLIDE normal
# Small Changes
Expand All @@ -20,4 +21,4 @@ Decide how you want to work, then work that way.

Decide how you want vim to act, then make it act that way.


There's probably a plugin for the thing you're thinking of.
File renamed without changes
File renamed without changes
48 changes: 48 additions & 0 deletions 02_usage/03_practice_basic.md
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

29 changes: 29 additions & 0 deletions 02_usage/04_practice_movement.md
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


153 changes: 153 additions & 0 deletions 02_usage/05_practice_selection.md
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
46 changes: 46 additions & 0 deletions 02_usage/06_practice_files.md
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

&lt;C-w&gt; + ...

* **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
Loading

0 comments on commit e964efb

Please sign in to comment.