Skip to content

Lecture 03b

fluf1024 edited this page Oct 10, 2013 · 31 revisions

Tools

Keep your hands on keyboard!

Touching story ...

Code editing

Everything is far better than notepad ...

Quick review from easy to most geek one ...

PSPad

Who remembers old PSPad?

TextMate

For Mac hipsters.

RubyMine

  • Awesome IDE
  • About 90 € for comercial license
  • Free for running opensource projects

RubyMine

Sublime Text 2, 3, ...

  • Great compromise
  • Many awesome keyboard shortcuts (Ctrl + P)

Sublime Text 2

Vim

  • Pros
  • Pretty geek
  • Pretty fast
  • Keep your hands on keyboard
  • Work directly on server
  • Cons
  • Learning curve
  • Features
  • Code completion

VIM

Fast tutorial

Start

Vim has 3 modes:

  • Command mode (Esc)
  • Input mode (i)
  • Visual mode (v)

Most important commands

  • :q! - Get me out of here!
  • :w - Save changes!
  • ZZ - Save changes and get me out of here!
  • Movement
  • h,l - left, right
  • j,k - down, up
  • w - jump to next word
  • gg - jump to the begining of the file
  • G - jump to the end of the file
  • ^ - jump to the begening of the line
  • $ - jump to the end of the line
  • Editing
  • d[movement command] - delete
  • dd - delete line
  • D - delete from cursor to end of line
  • c[movement command] - delete and start editing
  • C - delete from cursor to end of line and start editing
  • r - change one character
  • o/O - new line after/before this line
  • Files
  • Ctrl + P - open file
  • Find
  • Use '/' and start typing text
  • Use Enter to jump to found text
  • Use n/N to switch to next/previous text
  • Replace
  • Write :%s/regexp-to-find/pattern-to-replace/g
  • s - search and replace
  • g - do it globally for whole file
  • Copy + Paste
  • Start Visual mode (v)
  • Select desired text using movement keys
  • Use 'd' to delete text, or 'y' to copy (yank) text
  • Use p/P to insert yanked text after/before cursor

Must have features:

Tmux

Tabs in linux console.

Why?

  • Everything is save if you loose connection.
  • You can have only one ssh/putty window opened.

SSH

  • Use SSH Keys - they are awesome! (especially for github)

Shell

Zsh

Awesome and pretty configurable shell. If you hate configs try oh-my-zsh. Or I can provide you my .zshrc config file.

Fish

Great and easy shell. No need to configure anything! Just try it!

Debug

pretty print

require 'pp'

a = {:ahoj => 1, :neco => 2}
pp a

irb

Let's move to pry.

pry

Interactive ruby console.

require 'pry'

a = 'hello'
binding.pry
puts a

For the seminar:

  • Till thursday
  • Have Vim with Janus installed
  • If you have any problem with installation process, or any other question, please contact me [email protected]