This file contains examples of workflows I use to illustrate how to combine the various elements of my setup.
In this tutorial, we'll create a new python package called spaghetti
and
start working on it.
- Press
<fk> <shift-c> spaghetti <enter>
to create a new tmux session for the project. c src<enter>
ccp<enter>
and answer the questions to create a new cookiecutter project. Make sure to answer1
to the Click question so we have a cli. Not always necessary, but we'll do it here. Read about Click; it's great.pyn spaghetti<enter>
to create a pyenv for this projectpys lf<space><enter>
to activate the pyenvc spa<tab><enter>
to switch to the spaghetti directoryl<enter>
to see a list of filesgit init .<enter>
to initialize a git repogn develop<enter>
to create adevelop
branchfi<space><enter>
and press enter a bunch of times to initialize git flowga .<enter>
to add everything to the git repogc<space> Initial commit<enter>
to commit the repo with the message "Initial commit".- Link this repo with github by either following instructions on github or
creating new repo using
git create -d "Spaghetti"<enter>
. gp -u origin develop<enter>
to push and set up trackingpie<enter>
to install current repo into pyenv.pi <package><enter>
to install a depppv <package><enter>
to see what version was installed. SelectKeras==1.2.0
or whatever it is with mouse and press<cmd-c>
to copy to clipboard. This is basically the only time I use the mouse. Probably could eliminate it but hasn't been pressing enoughvim se<ctrl-j><enter><enter>
to opensetup.py
/req<enter>
to find the requirements sectionjjdd<v-j>
to delete theTODO
line and save<shift-o>
to create a new line above the current<ctrl-[>
to escape from insert mode<g-j> p
to paste from system clipboard==
to fix indentationysi<shift-w>'
to surround with quotes. Try to understand this by looking up vim-surround and thinking about motions to understand what this is doing. In particular, why<shift-w>
instead ofw
?f= r> <v-j>
to replace==
with>=
and save<shift-a> , <v-j>
to add comma at the end then exit insert mode and savegsi]
to sort dependencies. Note this won't do anything, as they're already sorted. But good practice to do whenever you add a dep.<v-j>
to save<f-k> '
to create a new pane above the current. We'll use this one for git stuff and managing the directory.<f-k> z
to zoom the panej sp<enter><enter>
to change to thespaghetti
directorypys spa<tab><enter>
to activate thespaghetti
pyenvgca<space> Add deps<enter>
to add changed files and commitgp<enter>
to push changes to server<f-k> c
to create a new window. We'll use this one for running the cli.j sp<enter><enter>
to change to thespaghetti
directorypys spa<tab><enter>
to activate thespaghetti
pyenvspa<tab><enter>
to run thespaghetti
program<f-k> ;
to select the other windowffs improve-cli<enter>
to start a new feature branch calledimprove-cli
. At first, always read the output from git flow commands. These start withff
and expand togit flow ...
.<f-k> d
to zoom the vim pane<g-j> k cli
to search forspaghetti/cli.py
.<ctrl-v>
to open it in a vertical split}}}k<shift-v>kk
to select the three lines ofmain
.<shift-c>pass<v-j>
to set the contents topass
and save<f-k> ;
to switch to the other window<ctrl-p><enter>
to runspaghetti
again and see that there is no longer any output.<f-k> ;<f-k> d
to switch to git terminalgs<enter>
to see the status of the branchgd<enter>
to see what exactly has changed. When this is long, it will let you navigate using vim-like shortcuts egj
andk
gca Remove output.<enter>
to commit change.ffp<enter>
to publish branchpr<enter>
to create a pull request<shift-q>
to accept message and finish creating pull request. You could also edit it. It's vim. I don't often change this, but sometimes it's useful. You should follow the same guidelines here as for commit messages.- Hold down
<cmd>
and click on the link. You can see your pull request. You can send this link to others so that they can see what you've done and comment on it.