A terminal-based workflow for research, writing, and programming
jacobzelko.com
jacobzelko.com
Also, +1 for Julia.
Hint: you have to redefine more of tmux' binds, the defaults are just not usable.
Hint2: most creation and resizing of panes and windows binds should be mapped without the tmux prefix, you can do this with "bind -n" in the .tmux.conf.
Hint3: read the tmux manual, it's really good and on one (long) page.
FWIW, while automatic tiling with i3 is super impressive, it's overrated. In the beginning you believe that this really boosts your productivity but you get quickly annoyed. If tmux is set-up right, so not just this seamless navigation but also creating and resizing of panes in a similar fashion with intuitive binds you wouldn't want any automatic tiling anymore. With my binds I am able to open and resize dozen of panes faster than I ever could with i3. And as a bonus tmux' config is just simple some remapping but never a rabbit hole to get basic things working.
I like it a lot but it's rare, the only one I've used is stumpwm.
You've just described what it feels like to be an emacs user. It's all just text[0].
[0] - https://blog.vivekhaldar.com/post/3996068979/the-levels-of-e...
- org-roam - org-noter - persp mode with persistent sessions - vterm + eshell - various plugins for org bibtex / latex
All of this in Doom Emacs gives me the same functionality.
I do admit that it took a large amount of time for me to cultivate this over several years, as it does for most workflows. It's very hard to jump ship, even when the grass may be objectively greener, because one has to actually be productive today instead of postponing until one's fonts are just right and keybindings are perfect!
https://github.com/org-roam/org-roam-bibtex
https://www.youtube.com/watch?v=Wy9WvF5gWYg Org-roam-bibtex - Quick Presentation
Also I think that the paradigm of modal editing is key to editing, not because I am used it, it just makes sense to have the myriad of functions of an editor easily reachable without too many modifiers. Coding isn't about just writing code but a lot about thinking, editing, staring at code, thinking, editing, jumping, f, /, yy's, dd's, ct, etc. I use modifiers heavily, way more than the typical ctrl/alt, but again to have an extra dedicated mode is crucial, so I can't imagine how any non-modal editor, eg emacs, can excel re UX like vim or nvim do. There must be reason that even the emacs community itself promotes spacemacs, which follows that paradigm, so much. But for some spacemacs is a layer too much adding unnecessary complexity. Besides, vim is also so popular because it's fast, load time, editing, anything.
Whatever, put me into any text field without modal binds and I am pretty much handicapped but maybe I might just missed emacs' hidden qualities. Trying emacs feels going one step back (when coming from modal editing).
Edit: Don't get me wrong, this shouldn't qualify as offense but every time I read some random emacs praise on the net, I never know if I should give emacs another try or if it's just a vocal minority who never experienced proper modal editing and I just should move on.
Just remember: Emacs' main strength comes from how malleable and extensible it can be. Give it time; don't jump ship after a few bumps. Patch it up with some Elisp and keep sailing.
But why? Because I have a better scripting language? Are there more benefits beyond having lisp?
But, putting Lisp aside, going through the growing pains was worth it for me because of org-mode. I'm certain Vim might have something similar but the proper `org` package is definitely on my list of benefits. I have an org-file that tracks my time and generates invoices with a click of a button. Another one documents all the API calls in another project with interactive areas, thanks to org-babel. I think being able to craft documents like this is invaluable but again, it's gonna come down to how you do work and what makes you happy/efficient.
Ok, here you got me and I'm about to try it another time. But then again I remember the slow loading times, the weaker ecosystem (is the lsp implementation as good and fast as coc-vim?) but whatever, maybe I should give it a try with evil mode. But there are so many other cool things waiting to be learned...
* Try spacemacs. Though I'm a Doom user, spacemacs is much more approachable out of the box. You can just uncomment things and have it work well. * Use Emacs 27.1 or later because it has faster JSON parsing -> crucial for good LSP performance
A few ways to get started are learning how to search for things within Emacs:
* C-h f: find documentation for any function by name * C-k k: find the documentation for any keystroke function * If you want to see what commands are going on: install command-log-mode. it will give you a buffer to see what commands you run with every keystroke * I don't remember if spacemacs has it or not, but the following two packages are crucial when you want to learn more: which-key (to show the keys available when you press something like C-x) and helpful mode [0]. I'm pretty sure spacemacs has these by default, but if not they're golden!
IntelliJ does this right. You are dropped into a brand-new, complicated editor, but the basics like the arrow keys, Ctrl+C/Ctrl+V, ctrl+arrow key movements, menus and lots of other bits are already familiar to you. You may remap the editor in any way you want, but you are likely to override a few presets and get on with your day, than rewire the entire thing.
Even when I VPN into work, ssh into a box at work, then ssh to a jumpbox in AWS, and then ssh from the jumpbox to an EC2 server the experience is still flawless.
I wondered though, if there’s no way to objectively “score” the advantage of, say, terminal-minimalism vs. GUI-maximalism, what might some discussions of t-min vs GUI-max be? What, if anything, does t-min really cut us out of while we’re preparing for the rare case of “Ok, imagine you’re stuck on a spacecraft with only a character terminal and a 300baud modem - what will you do then with your Windows RDP-available machine back on earth?” Am genuinely interested to hear people’s ideas of the calculus here.
Pros of GUI-max: - You don't have to spend hours learning and configuring things. - Certain tools are just better when they are built out in a GUI for you. I think here in particular of C/C++ debuggers, it's hard to get a nice experience in the terminal.
As for objectively "scoring" it's hard to assign real values. You could eventually measure speed. I have worked in production support solving a lot of benign problems on a day to day basis. This is when I adopted my terminal based workflow. It was way faster than my other teammates using desktop apps.
I got 70% of my sysadmin skills because of hanging out 24/7 in the shell and configuring things.
After spending hours, sometimes days, trying to learn GUI stand-ins and trying to configure them (turns out you usually can't unless the GUI designer though it was a good idea), I usually give up and go back to being productive instead by using the CLI.
My RDP connection over VPN works without issues.
When it fails, using ssh wouldn't be much better anyway.
Further, it makes my heart so so happy to see so many people being either inspired, interested, or curious about my workflow! I think the best workflow is the one that works for you. If my article played some part in that, then I am jubilant. Have a wonderful day!
One question though, how do I get the floating terminals?
After a year of not doing research I'm just getting it all back together and I've swapped Zotero for Jurism a fork that has support for multiple languages that I greatly appreciate.
Best of luck with your research endeavors!
The big gain is that you don't have to give up all those gui apps as they blend in next to the terminal apps quite well.
Adding keyboard shortcuts is easiest in window manager comparing to full desktop environment where the setting is hide behind the some Setting GUI.
Energy saving feature is basically setting P-state on Intel CPU, and does not work on AMD. You could do it manually by using kernel interface.
Dwm isn't for everybody, you modify the c source and compile to get the changes you want. The best part is that the source is small enough to understand for when you want to do something to it.
While I prefer the paradigm of tiling wms I eventually stuck with Windows (and WSL2) with its built-in window management but yeah.
My current setup uses xrandr to scale my 4k to 1440p.
It's not perfect, but it's better than other options.
It supports fractional scaling and different scales for different attached screens.. You have to tell the system you want it (`swaymsg 'output <x> scale 1.5'`) but it works.
You still need Xwayland installed for some stuff though. Most tools have adequate wayland replacements.
Instead of fitting all your windows within your monitor's boundaries, PaperWM sets all windows to take full height and gives you an infinite horizontal axis to arrange them on. I'm thoroughly enjoying it and vastly prefer it to tiling and floating windows
At the very least this article has given me the itch to dust off the old dotfiles and start fiddling with zsh again!
https://github.com/SabbathHex/confluence_poster
The downside is that due to Atlassian limitation and phasing out of wiki markup it's not possible to retrieve articles from Confluence. This script is not suitable for collaborative editing of the same page.
Script is quite ugly, but gets the job done.
Whereas, in vim, trying to do random-access edits like this with just a keyboard is sort of a nightmare.
I'm sure there's a way to rig ctrl-click up in vim, but to me the appeal of vim is the (purported) speed boost from your hands not leaving the keyboard, so that really defeats the point.
If anyone has ideas in this regard, I'd be happy to hear them!
I'd very much like an advanced, still cli/terminal, interface option.
https://www.youtube.com/watch?v=o4-YnLpLgtk
I think there are lessons to be had from the likes of Smalltalk and Logo too. Highly expressive without insane levels of cryptic inconsistent punctuation rules and UX man-traps.
Terminals of 2020 and beyond need to have first-class support for audio, video, images, and peripheral interactivity/customization. Terminology and iTerm 2's ability to display pictures, and some terminals' support for Sixel is one of the directions I want to see progress in.
- It should be possible to `cat` an image, or a video, or even previews of Word and Photoshop documents. Terminology, iTerm 2 and Sixel-compatible terminals have this to some extent, but it's not standardised and doesn't have a broad support base.
- Programs should be able to raise notifications without relying on third-party/OS-provided utils that have a drastically different API and availability across platforms.
- Rich read-only visualisations of progress should be possible to call up with a few lines of code. I want to see a `dd`, `mv` or `cp` with a graphical progress bar at the bottom of my window. If my OS supports it, I want this to integrate with the UI like the progress widget on my taskbar.
- We should be able to render a piece of output in 3D, if we so desire. I don't want Crysis, but I do want a Matlab logo that I can rotate by dragging my mouse and graphs that zoom when I Ctrl+scroll at them.
- Support for file pickers and rich selection/filtering of file/directory lists. Not for sandboxing, but for convenience.
- A command line builder (like one of the classic Apple OSes had, cannot find a reference now, or something like the one in Fish but more advanced). Only valid combinations of parameters will be supported, mutually exclusive commands are impossible to select. Any arguments that are files will be possible to use with a file picker. Any argument that's a date will get a calendar widget. Any argument that's a boolean or an enum will get a checkbox or drop-down respectively.
- Terminals should be able to intake gigabytes of input per second, up to the limit of the hardware, without choking up.
- We should be seeing 60FPS and beyond as a normal feature.
- We should finally get unlimited scrollback enabled by default. The terminal emulator should keep everything that I've seen before, and remember it for me. We have the space for it, either in RAM or persistent storage. If not, it should be adaptable and drop the scrollback buffer that is lower priority than other applications on the system if they need more resources.
- Unicode should come as standard. Emoji should come as standard.
- End termcap. We should be able to hash out ONE standard to rule them all. We've had 50 years to come up with ideas and opinions. Version it so that we can release a V2 in 2100.
- While we are at it, end Bash and come up with a saner shell notation that doesn't overload single/double quotes, the ampersand, > amd <, or human-text spaces. We have several more decades of syntax design knowledge worked out, and a whole keyboard with >101 keys. We have two Alts, two Ctrls, and a whole function key row. Let's make use of them for non-printable character input and interaction with the terminal.
- (Debatable) consider adding hypertext support. It's here to stay, and not just in the form of HTML.
There's more that can be added, but really, I think terminals deserve better.
https://github.com/oilshell/oil/wiki/Interactive-Shell
Many of the articles have nice screenshots / animations to give you a feel for what it is.
I plan to turn https://www.oilshell.org/ into a library and I hope people will build GUIs around it. There are some UI possibilities that are difficult or impossible unless you have hooks to the shell other than stdin/stdout.
The problem is that you really need an interface for loading software components into your system at runtime, which .NET provides, but aside from .NET or COM I am unaware of any other equivalent system. Java's OSGi is the closest, and ugh...
Some people love it and some people hate it. Some more responses here:
https://news.ycombinator.com/item?id=24873410
I guess what I'll say is that I hope the Oil ecosystem will grow the things that people like about it, that aren't tied to Windows. Windows and Unix are fundamentally different and it means they need fundamentally different shells, since a shell is by definition a language closely tied to the OS.
You can run powershell on Unix, and bash on Windows, but even on the same OS they are somewhat disjoint tools!
- Many programs offer intuitive quick-action- or quick-search-fields. For example: double-shift in IntelliJ or CMD-Shift-O in many Mac apps like Fork, Things and IA-Writer. - System wide search tools like Alfred and Launchbar will allow you to quickly access Files and execute Workflows - _Every_ Menubar in MacOS is searchable. Just press a shortcut and type what you want to do. - ...and let's not forget that keyboard shortcuts exist.
The great thing is that you get all the power of a keyboard workflow, without losing the accessibility of a GUI.
A (quantitative) researcher, involved in serious plotting, illustrations, and diagrammatic analysis, wouldn't last half-a-day in this workflow.
I'm curious what these refer to. What kind of illustrations are you thinking of? What is diagrammatic analysis?
Any introductory links for the uninformed?
plotting/viz using matplotlib, altair, Mike Bostock's D3.js, graphviz, pgf/tikz, inkscape, the list goes on
I can't think of much outside a small subset of pure-math, and a small subset of TCS, where visualization is not part and parcel of daily research activity. (ignoring non-STEM disciplines like english, communication, social/political/economic sciences, etc).
If, for example, I pause coding and spent a few hours comparing and reading about various libraries to aid in a certain task, wouldn't this task be best described as "research" as well?
I hate what 1970s terminal culture does to both.
Why can’t we have modern text-driven interfaces* that are both parsimonious and elegant? The mighty Knuth gave us TeX 40 years ago, and our hardware has long since passed the point where doing the job right demands a significant number of cycles (even with the clattery mess that is Unicode standard), so there really isn’t any excuse for such awful regressive primitivism now.
Because I don’t care that OP’s workflow works well for OP; I care about workflows that work better. For everyone.
/cynical idealist
--
* Traditionally “text-driven interface” means keyboard-driven, but if you aren’t paying attention to the rise of spoken words then you’re missing the next great opportunity to open up computing to all 8Bn of your fellow humans.
Can anyone elaborate on the advantages to using a single mother application to house all my command-line interactions instead of separate application windows for each?
1. Distractionless editing - not fiddling with formatting or things like that is quite nice. Especially since I work with markdown and LaTeX, it is easy to convert over to a word file once I get the draft of the version done thanks to pandoc. From there, then I can really worry about the formatting - if I need to as pandoc is great!
2. I like the speed and lightness of a text editor for writing. Don't have to wait for boot, can easily grep and replace, and jump to where I need to go.
I guess it is some people's idea of progress.
Terminals of 2020 and beyond need to have first-class support for audio, video, images, and peripheral interactivity/customization. Terminology and iTerm 2's ability to display pictures, and some terminals' support for Sixel is one of the directions I want to see progress in.
- It should be possible to `cat` an image, or a video, or even previews of Word and Photoshop documents. Terminology, iTerm 2 and Sixel-compatible terminals have this to some extent, but it's not standardised and doesn't have a broad support base.
- Programs should be able to raise notifications without relying on third-party/OS-provided utils that have a drastically different API and availability across platforms.
- Rich read-only visualisations of progress should be possible to call up with a few lines of code. I want to see a `dd`, `mv` or `cp` with a graphical progress bar at the bottom of my window. If my OS supports it, I want this to integrate with the UI like the progress widget on my taskbar.
- We should be able to render a piece of output in 3D, if we so desire. I don't want Crysis, but I do want a Matlab logo that I can rotate by dragging my mouse and graphs that zoom when I Ctrl+scroll at them.
- Support for file pickers and rich selection/filtering of file/directory lists. Not for sandboxing, but for convenience.
- A command line builder (like one of the classic Apple OSes had, cannot find a reference now, or something like the one in Fish but more advanced). Only valid combinations of parameters will be supported, mutually exclusive commands are impossible to select. Any arguments that are files will be possible to use with a file picker. Any argument that's a date will get a calendar widget. Any argument that's a boolean or an enum will get a checkbox or drop-down respectively.
- Terminals should be able to intake gigabytes of input per second, up to the limit of the hardware, without choking up.
- We should be seeing 60FPS and beyond as a normal feature.
- We should finally get unlimited scrollback enabled by default. The terminal emulator should keep everything that I've seen before, and remember it for me. We have the space for it, either in RAM or persistent storage. If not, it should be adaptable and drop the scrollback buffer that is lower priority than other applications on the system if they need more resources.
- Unicode should come as standard. Emoji should come as standard.
- End termcap. We should be able to hash out ONE standard to rule them all. We've had 50 years to come up with ideas and opinions. Version it so that we can release a V2 in 2100.
- While we are at it, end Bash and come up with a saner shell notation that doesn't overload single/double quotes, the ampersand, > amd <, or human-text spaces. We have several more decades of syntax design knowledge worked out, and a whole keyboard with >101 keys. We have two Alts, two Ctrls, and a whole function key row. Let's make use of them for non-printable character input and interaction with the terminal.
- (Debatable) consider adding hypertext support. It's here to stay, and not just in the form of HTML.
There's more that can be added, but really, I think terminals deserve better.
Your config is kinda similar looing to mine: github.com/radiosilence/dotfiles
I’d say it is one of the best utilities I use.
It’s 100% worth learning though. Tmux is available almost everywhere and it’s an easy way to increase your productivity!
(pun with ncurses).