(Brown bag presentation by Contovista AG on 26.03.2015)
Authors:
Published at: http://git.io/jGdi
- Basics
- SHELL YOUR BRAINZ OUT
- VIM
- tmux
- It's all fine...but why? It's 2015!
-
Your favourite package manager homebrew
> # install some command line application > brew install tmux > # update the index of your local package repository > brew update > # upgrade your locally installed packages > brew upgrade > # be awesome again (you'll love it) > telnet nyancat.dakko.us
-
> brew install tmux
tmux
is of course optional!
-
The shell for running your commands
-
There is not just one shell:
- sh
- bash (default on modern systems)
- zsh (improved bash functions)
- fish
- etc...
Each one is powerful but this is just a matter of personal preference! (Of course they all provide tab completion out of the box)
-
Basic commands:
ls
cd
(this is even available on Windows Server systems since 2035?)touch
mkdir
less
cat
/head
/tail
grep
/ack
find
tr
/sed
rm
- and some more whatnot
-
Wait, typing these commands take way too much time?? -->
alias
to the rescue <3 -
Some other important thing - ever heard of
$PATH
?
-
Why? It's just plain awesome.
-
Why? See for yourself.
?OS 2cw OS X <ESC>
Whut? Pretty impressive huh?
-
Teach you, I will.
-
Everything is a text object
-
File navigation h: left j: down k: up l: right gg: go to start of file G: go to end of file 0: go to beginning of line $: go to end of line w: go to next word b: go to beginning of word
-
Modes (whut?) (vim has a total of 13 modes - I don't know them all either)
- Normal mode
- Insert mode
- Visual mode
Default mode is
Normal mode
- you can always switch to this mode by pressing -
Modify text (all in normal mode) i: Insert at cursor I: Insert text at beginning of line a: Append text after cursor A: Append text at end of line c: Change r: Replace d: Delete x: Remove char v: visual V: visual line u: Undo
-
We can combine commands: cw: Change the current word dw: Delete word d$: Delete until end of line
-
If you need more than standard vim just apply some plugins to the sauce:
- Plugin Managers: Vundle / Pathogen
-
VIM is very powerful! This did not even scratch the surface of what is possible.
-
Ehhhu. Sorry what? tmux is a terminal mutliplexer
-
What is it good for? windows panes sessions scriptable & shortcuts
-
Why should I care? well, on modern systems a little less so but if you're the command line type of guy maybe more so.
you can manage many windows and panes in one terminal session, log of and then reattach the session on anothe host
-
SAME ENVIRONMENT WHEREVER YOU GO! PERIOD.
-
Several studies (no links provided) have shown that the average user loses around 80 hours each year just by switching between mouse and keyboard.
tl;dr: Join the dark side, where we utilize the terminal and it's perks, improve life quality by getting things done faster.