Showing posts with label cheat sheet. Show all posts
Showing posts with label cheat sheet. Show all posts

Saturday, February 18, 2017

tmux cheat sheet

A few commands that are useful to know. src.

managing sessions

tmux new -s foobar          | creates a new tmux session with given name foobar
tmux attach -t foobar       | attaches to an existing tmux session named foobar
tmux list-sessions          | list all available tmux sessions
tmux switch -t foobar       | switches to a session named foobar
tmux detach (ctrl + b, + d) | detach from the current session

managing windows

tmux new-window (ctrl + b, + c)     | create a new tmux window
tmux select-window -t :0-9 (ctrl + b, + 0-9) | choose an existing tmux window
tmux rename-window (ctrl + b, + ,)  | rename an existing tmux window

Thursday, February 2, 2017

git cheat sheet

Still learning the system.
git init                |  Tell git to start watching the directory
git clone <repo>        |  Get a local copy of the repository
.gitignore              |  Contains patterns of files to ignore
git rm --cached <file>  |  Stop tracking the file in git
git add <file>          |  Stage a snapshot of the file
git rm <file>           |  Stage the file's removal
git mv <a> <b>          |  Rename 'a' to 'b' and stage the change
git status              |  Staging status of files
git status -s           |  Simpler version of status
git commit              |  Upload to server
git commit -m "txt"     |  Commit, with inline message

Wednesday, January 25, 2017

Basic Vim

The cheat sheets and guides out there don't seem to provide a practical intro to Vim.  I'm not able to use MS Code on one of my primary interfaces, so I'm looking for the next best thing.  Vim, so I've heard, is probably it.  This is a great little tutorial to introduce the basics.

There's two modes: command mode, and insert mode.  Command mode is where you do things that would normally be accessed via cursor, arrow keys or a menu, and insert mode is where you type letters and they appear on the screen and you can use the arrow keys like you're used to.  When you open vim, you start in command mode.

This should get you to about a nano level of proficiency.

Basic Usage

open foo  | vim foo
save file | :w
quit file | :q
Command mode | [ESC]
                                  |   k
Move cursor left, right, up, down | h   l
                                  |   j
Insert here | i
Insert new line below | o
Delete char under cursor | x
Here's a nice cheat sheet for further use.

Final post here

I'm switching over to github pages .  The continuation of this blog (with archives included) is at umhau.github.io .  By the way, the ...