Dislcaimer: This article is written with a heavy dose of satire. It’s a twist on the “Me, an Intellectual” meme. While the suggestions are sincere (and by no means complete), the references to being a “hacker” are just for fun.
Average developer: A shell is a shell. It doesn’t really matter which one I use. They all suck anyway.
You, a Hacker: The shell is the lifeblood of my work. My passion for efficiency and features knows no bounds. My shell must be one worthy of a true hacker.
cd
completion using <t
ab>cd /u/c/c/j
+ <t
ab> =cd /user/caleb/code/
jarvisnode-docs
command for opening website docsAverage developer: Okay I’ve got my files open for lame_project_1. But I also need to do work in boring_project_2. I also need to ssh into a server and look at the logs. I guess I’ll just create a huge mess in my terminal that has files/tabs from multiple projects open in a way that I’ll eventually lose control of and be forced to close and start over.
You, a Hacker: I work on several projects at once, so I need a tool to help me keep it organized. It should work across multiple platforms, and allow me to create organized work spaces and have a lot of other features that help with productivity.
Average developer: Where did I define that constant at? I know it’s somewhere in here. I’ll try to grep for it. What are the arguments again? Let me google that. Ah crap, now it’s searching my node_modules folder. This is the worst.
You, a Hacker: When I search for something, it should be blazing fast. Also, it should use sensible default settings, like ignoring binaries or hidden files.
.gitignore
file ignores, and skipping binaries and hidden files. That’s why you use ripgrep. It’s like grep on steroids.Average developer: It’s sure hard to remember the exact location of so many files within my project. I guess I’ll stumble around until I find the right one.
You, a Hacker: I should be able to fuzzy-find files. I can type the file name, or some of the path, or all of it, and quickly find the file I’m looking for.
zsh
config:Average developer: Who cares what my terminal prompt looks like? There’s no way it could possibly give me any useful information. I’ll just leave it as the default.
You, a Hacker: I want my prompt to be amazing. It should be context-aware. It should give me useful info and be configurable. Also, it would be sweet if it was related to space.
Average developer: I need to change my directory to my “hacker” project, which is inside of my cool folder, which is inside of my personal folder, which is inside of my code folder, which is in my home directory.
You, a Hacker: I need to change my directory to my “hacker” project.
Git
for version control to write merge and commit message.Bash
scripts to process files: If you want to very quickly process a large set of text files, you will often use Bash
at the command line. You will use a text editor to write that script.Jupyter Notebook
(or some other coding GUI) for others. You will figure out your preferred workflow as you code more!Jpyter Notebook
. However, it is important to be familiar with text editors because they are powerful tools that many scientists use to write code. If you use Git
, you will need a text editor to create some commit and merge messages.Git Bash
installed). Vim is a text editor designed to support the command line / terminal interface. This means that rather than buttons to save, open and close files, you need to use the correct key commands as follows:vim
at the command line. Like this::q!
(colon, lower-case ‘q’, exclamation mark). Hit Enter
and you will return to the terminal.i
or insert
.ESC
):
)w
and then give the file a name such as earth-analytics-test.txt
Enter
Enter
:
), type pwd
. If you want to save that file in a different directory, type w
followed by filepath/filename.txt
.earth-analytics-test.txt
file that we just saved from vim.vim
followed by the name of the file. For example:i
. To save your edits, follow the same commands as before to save the file:ESC
):
)w
(and if desired, save the updated file to a new name such as earth-analytics-test-v2.txt
)Enter
Enter
Git
operations.Markdown
in a .md file and preview the rendered output in a different window. Hydrogen package, allows you to run code inline in Atom, similar to Jupyter Notebook
.Git
using:GIT_EDITOR=vi
git config
(if git is installed on your computer already).Editor | Configuration command |
---|---|
Atom | git config –global core.editor “atom –wait” |
nano | git config –global core.editor “nano -w” |
Sublime Text (Mac) | git config –global core.editor “subl -n -w” |
Sublime Text (Win, 32-bit install) | git config –global core.editor “‘c:/program files (x86)/sublime text 3/sublime_text.exe’ -w” |
Sublime Text (Win, 64-bit install) | git config –global core.editor “‘c:/program files/sublime text 3/sublime_text.exe’ -w” |
Notepad++ (Win, 32-bit install) | git config –global core.editor “‘c:/program files (x86)/Notepad++/notepad++.exe’ -multiInst -notabbar -nosession -noPlugin” |
Notepad++ (Win, 64-bit install) | git config –global core.editor “‘c:/program files/Notepad++/notepad++.exe’ -multiInst -notabbar -nosession -noPluginin” |