demos.otl 3.26 KB
Newer Older
1 2 3 4
bash
	start in ~/git/meonkeys/dotfiles/bashrc
		see https://gitlab.com/meonkeys/dotfiles
	emotiprompt
5
		see smiley() in my bashrc
6 7 8 9 10 11
		; false
		; true
	readline basics
		Alt-f, Alt-b to jump over words
		Ctrl-w to delete, Ctrl-y to "yank" (paste)
		Home key, End key, arrow keys
Adam Monsen committed
12 13 14 15 16 17 18 19 20 21 22 23
		Ctrl-r to reverse-search through history
	fish
		syntax highlighting
		; echo foo bar baz
		shows best Tab-completion before completing ("autosuggestions")
		; echo
		better tab completion
		; man pi<Tab>
		; echo the date is (date -<Tab>)
		web-based config
		; fish_config
	back to bash - reusing arguments
24 25 26 27
		; vim bashrc
		; git add <Alt-.>
		; git ci <Alt-.>
		; ^ci^log
Adam Monsen committed
28 29 30 31 32 33 34 35 36
	globs
		; echo *    # files & dirs
		; echo */   # only dirs
		with shopt -s globstar...
		; echo **   # only files, recursive
		; echo **/  # only dirs, recursive
	watch a few commands at once
		source: https://twitter.com/climagic/status/641706344458944512
		; watch '{ uptime; echo; free; echo; df -h; }'
37 38 39 40
	rename
		; rename -n 's/rc$/BLAH/' *
		; rename 's/rc$/BLAH/' *
		; rename 's/BLAH$/rc/' *
41
	dirjump / z / j2
Adam Monsen committed
42
		a much better cd (doesn't completely replace cd)
43
		see https://github.com/rupa/j2
44
		; j
45 46 47
		; j dot
		; j cli<TAB>
	pv
48 49 50 51
		copy file with progress
		; pv sourcefile > destfile
		network throughput
		; pv /dev/zero | ssh localhost 'cat > /dev/null'
52
		more tricks: http://blog.urfix.com/9-tricks-pv-pipe-viewer/
Adam Monsen committed
53 54 55 56 57
	top 10 most frequent commands:
		; cli-top-10
		; history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
		slightly different in a shell script because history is disabled
		; cat ~/.bash_history | awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
58 59 60 61 62 63 64
	from my bashrc
		; cd   # with auto-ls, created because ls was top in cli-top-10
		; s    # alias for cd ..
		; mkcd # create dir and cd to it
		; vw   # vim a file in path (vim with "which")
		; p    # better grep of process table
		; pw   # better grep of process table, wide listings
65 66 67 68 69 70 71 72
	percol
		; vim `git ls-files | percol`
		pick one with <Enter> or multiple with <Ctrl-space>, then <Enter>
	sl - misspelled ls (steam locomotive)
		; sl
		; sl -l
		; sl -F
	dutop - top disk space users by subdir
73
		vs. baobab
74 75 76 77
		http://www.pixelbeat.org/scripts/
		http://www.pixelbeat.org/scripts/dutop
		; cd ~/personal
		; dutop
78 79 80 81 82 83 84
	http - one-line HTTP server in current dir
		; python -m SimpleHTTPServer 8000
		see http() function in my bashrc
	hollywood
		; hollywood
		; pkill hollywood
		; pkill mplayer
85 86
vim
	my Vim setup: https://gitlab.com/meonkeys/dotvim
87 88 89 90 91 92 93 94 95 96 97 98 99 100
	airline - enhanced status line
		; vim bashrc
		mode, # changes, branch, file, %, line no: col no
		:w
		syntax check on save - Syntastic
		:Errors
		use ]l and [l to skip through errors
		introduce trailing whitespace, save again
		syntastic highlights line w/trailing whitespace on airline
	multiple windows
		; vim
		:sp<Enter> to create initial horizontal split
		Ctrl-w + motion to switch windows
		:q<Enter> to close a split
101
	vimoutliner
102 103
		zm, zm, zm, zR (this file)
		see :help zm
104 105 106
	CommandT
		start in ~/git/meonkeys/osem
		\t
107 108 109 110 111 112 113
	UltiSnips & YouCompleteMe
		; vim /tmp/test.html
		html5<Ctrl-j>
		lorem<Ctrl-j>
		ul+<Ctrl-j>
	gitgutter
		show local modifications in "gutter" on left
114 115 116 117 118
ssh
	ssh-agent
	multiplex
screen
	detach/reattach
119 120 121 122
git
	bisect
		use example from git talk
	local clones (speed, testing, etc)