Created
September 18, 2012 15:21
-
-
Save bruschill/3743727 to your computer and use it in GitHub Desktop.
irb text editor brawl
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
# n: Brandon Ruschill | |
# c: github.com/bruschill | |
# t: @bruschill | |
# BASICS (command mode) | |
# never ever use the arrow keys. ever | |
# | |
# k | |
# h l | |
# j | |
# | |
# ^ - beginning of line | |
# $ - end of line | |
# | |
# ctrl+f - f-orward a page | |
# ctrl+b - b-ack a page | |
# ctrl+u - u-p half a page | |
# ctrl+d - d-own half a page | |
# | |
# H - top of current page (no mnemonic :[ ) | |
# M - M-iddle of current page | |
# L - L-ast line of current page (mnemonic stretch) | |
# | |
# gg - top of file | |
# G - end of file | |
# | |
# u - u-ndo | |
# ctrl+r - r-edo | |
# | |
# :w - w-rite | |
# :q - q-uit | |
class VIM < IRB::Presentation | |
# MOVEMENTS++ | |
# w (next w-ord), e (e-nd of next word) | |
# f* (f-irst occ. of char), t* (t-il occ. of char), ; (repeat last f/t) | |
MINASWAN = {:m => "matz", :i => "is", :n => "nice", :s => "so", :w => "we", :a => "are"} | |
# i (i-nsert before char), a (a-ppend after char) | |
# I (I-nsert at beginning of line), A (A-ppend at end of line) | |
# o (o-pen down a line to insert), O (O-pen up a line to insert) | |
def some_method | |
end | |
# x (remove char under cursor), X (remove char before cursor) | |
# c (c-hange {movement}), C (C-hange before char to end of line) | |
# ci* (c-hange i-nside char) | |
def another_method(param_one, param_two) | |
my_sentence = "ffirst param: #{param_one}, seconnd param: #{param_two}" | |
my_sentence.split(",") | |
end | |
# d (d-elete {movement}), dd (d-elete current line) | |
# d{N}d (d-elete this and n-1 lines below) | |
# . (repeat last) | |
def buggy_method | |
while(true) do | |
puts DateTime.now.to_i | |
end | |
end | |
# WAIT! | |
# movement multipliers | |
# h{N} - left n chars | |
# j{N} - down n chars | |
# k{N} - up n chars | |
# l{N} - right n chars | |
# | |
# use them with relative line numbers | |
# for fun and profit! | |
# v (v-isual mode), V (V-isual mode by line) | |
# ctrl+v (v-isual mode by block) | |
# y (y-ank to buffer), Y (Y-ank from cursor to beginning of line to buffer) | |
def first_name=(fn) | |
end | |
# p (p-ut yanked text from buffer below curr. line), P (P-ut yanked text from buffer above curr. line) | |
# SPLITS - opening | |
# ctrl+w s - horizontal split | |
# ctrl+w v - horizontal split | |
# | |
# SPLITS - closing | |
# :q | |
# | |
# SPLITS - switching | |
# ctrl+w h - move 1 split to the left | |
# ctrl+w j - move 1 split down | |
# ctrl+w k - move 1 split up | |
# ctrl+w l - move 1 split to the right | |
# | |
# SPLITS - moving | |
# ctrl+w H - move split left | |
# ctrl+w J - move split down | |
# ctrl+w K - move split up | |
# ctrl+w L - move split right | |
protected | |
# VIM PLUGINS | |
def janus_suite | |
#turns vim into a IDE-esque power house, is fully customizable | |
"https://github.com/carlhuda/janus" | |
end | |
def zoomwin | |
#zooms into a split, making file take up whole window, good for small screens | |
# ctrl-w o (janus binding) | |
"https://github.com/vim-scripts/ZoomWin" | |
end | |
def number_toggle | |
#new windows/buffers open with relative line numbers set, makes using movement multipliers /way/ easier | |
"https://github.com/vim-scripts/ToggleLineNumberMode" | |
end | |
def ctrl_p | |
#fuzzy finder | |
"https://github.com/vim-scripts/ctrlp.vim" | |
end | |
private | |
# IDE PLUGINS | |
def visual_studio | |
"http://bit.ly/QiMII1" | |
end | |
def eclipse | |
"http://bit.ly/S2ikq8" | |
end | |
def ruby_mine | |
"http://bit.ly/Qzd35b" | |
end | |
def emacs | |
#what? | |
"http://bit.ly/S5yhKW" | |
end | |
def sublime_text | |
"http://bit.ly/QX2CdS" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment