tmux
screen
(not recommended)
Using a terminal multiplexer helps keep a session in a given state.
I define at least two variables for a given session:
PARENT
: name of the git branchCRISSUE
: issue number that the cr tool uses
Persisting the branch name and issue number in the tmux
session is convenient.
$ PARENT=DOCS-XXXXX-documents-a-super-rad-feature
$ CRISSUE=XXXXXXXXXX
I use a small set of aliases and functions to wrangle common workflow tasks:
Aliases serve as a wrapper around an invocation. Aliases do not accept arguments.
Functions can contain more sophisticated logic and can accept arguments.
branch
: expands togit branch --show-current
add-commit
: expands togit add . && git commit --amend --no-edit
stage
: expands togit push origin -f $( branch ) ;
(Note how this calls the previously-definedbranch
alias.)
cr
: A small wrapper around the code review tool.occurrences
: count all occurrences of term(s) in the corpus (on the current branch).affected-files
: count all occurrences and list all files term is found in.
Here are some key combinations I find useful when navigating the command line:
ctrl-a
: jump to the beginning of the linectrl-e
: jump to the end of the linectrl-f
: move forward one char at a tiectrl-b
: move backward one char at a timeoption-f
: move forward one word at a timeoption-b
: move backward one word at a time
More info on Motions here: https://ss64.com/osx/syntax-bashkeyboard.html