My personal workflow for terminal-based coding, writing, research, and more!
Hello everyone! It has been quite sometime since I last posted! Suffice it to say, I have been immensely busy the past year but I am happy to say I am able to resurrect this blog!
I have thoroughly grown into my own workflow for programming, research, and writing. Today, I am happy to be able to share it with you!
If you prefer to watch a video describing most of this entire process, here is an overview of my workflow from one of my live streams. It does not go as in-depth as this document but should serve as a strong complement to this post.
My Workflow Tools of Choice
I use Alacritty as my terminal, zsh and oh-my-zsh as my shell and plugin manager respectively, tmux as my multiplexer, lsd as my list command with fun icons, Fantasque Sans Mono as my typeface font, neovim for my editor, fzf paired with ripgrep for speedy and interactive file finding, bat an enhanced
cat with a git diff gutter, pandoc for writing in markdown and LaTeX and outputting the piece to whatever file type I want, Zotero for managing my collection on scientific literature, ranger as a terminal-based file explorer, and gruvbox-dark as my general color palette.
Here are gists to the relevant config files I use to modify my interface and user experience:
Here is a picture of what that looks like altogether:
My Workflow in Action
The following sections describe in broad strokes my workflow. I mention some plugins that I use and are provided in my config files. If you want to learn more about them, I encourage you to read through my config files or search for them.
Floating terminals are immensely powerful and I love them!
This enables me to quickly pull up a terminal and do some changes without having to split tmux panes or get out of vim.
Furthermore, what is awesome is that you can use it as a sort of
vim-slime tool to send lines of code to the floating terminal.
This is a great feature as it uses your last used floating terminal for its target - therefore, if you switch between projects a lot, just switch your floating terminal accordingly.
No need to keep opening and closing REPL sessions and such!
Persistent Working Sessions via tmux
Though it is a little hard to see, I closed my terminal completely. Oh no! All my paneling and windows have disappeared! I’ll have to spend valuable time getting my workflow set back up… Or do I?
tmux can actually remember all these layouts with the plugins,
This is great for when your computer unexpectedly dies or crashes as everything is backed up at regular intervals you define!
Furthermore, pairing the (neo)vim plugin,
obsession, allows tmux to also automatically recover vim layouts and sessions as well.
You will never have to worry about losing your terminal workflow again!
tmux and (neo)vim also support mouse mode and interactivity! I can quickly jump all over the place with my mouse or easily resize any opened pane.
Interactive File Finding
I integrated the powerful file finding tool,
ripgrep to quickly find files I am looking to use.
Then, in my (neo)vim configuration file, I merged these two together into one function that I can easily call while editing files in (neo)vim.
find files I search for and pandoc to enable citations in pandoc, markdown, or TeX files.
Terminal-Based File Explorer
Furthermore, I also use the great tool,
ranger, which allows me to have a terminal based file explorer.
It’s nice as it pops up in its own window and does not actually directly interfere with any of the background files being edited.
It even has image preview capabilities!
Citation Engine & Live Preview
As a researcher, this part gets me immensely excited!
While I am writing, I can actively insert citation keys into whatever I am working on via
With my config file, you will have to specify where your own .bib file exists.
markdown-preview allows me to preview my markdown in a web browser and
vim-latex-live-preview allows me to view my current TeX files in a pdf viewer – works for subfiles too!
This works for whenever I write TeX files or markdown files which makes writing a breeze!
If any of this section is confusing, I strongly encourage you to read my article on Knowledge Management.
Deprecated Workflow Tools
These are parts of my workflow that I used to use. They have been retired for a variety of reasons but all in an effort to improve my workflow. I have kept these around in case anyone finds it useful!
Vim-Slime for Rapid Evaluation
Rationale for deprecation: I used to use
vim-slime but deprecated it from my workflow because of the flexibility of floating terminals.
Not only could I use floating terminals to send code, I could also quickly flip through terminals in one button press.
Here, I target my Julia REPL in a tmux panel and use the
vim-slime plugin to send code from my Julia script opened in neovim to the Julia REPL for rapid evaluation.
This config works for any time you want to target a window.
This also works for code chunks such as functions or loops!
I hope you found my workflow and toolchain interesting! My dream would be for this workflow to serve as inspiration for your own workflow. Make it your own and all the best!
If you spot any errors or have any questions, feel free to contact me about them!