Lurker News
I recently started integrating tmux and vim into my workflows. Obviously, it was a huge efficiency booster. What are some other tools (custom built or off-the-shelf), hotkeys, workflows that were game-changing for you as a dev? I'm interested in hearing about anything and everything (stuff from ctrl+l to clear the terminal to little-known git commands to larger-scale strategies like CI/CD)

Comments (522) 158 threads

Earlier comments
lukifer7 replies#
I can't say enough good things about a multiple clipboard manager. Not only is it useful to copy/paste multiple items in sequence, but it's a game changer to be able to quickly retrieve a code snippet, or URL, or CLI command you used recently; and/or, to trivially stash one just in case you'll want it later. (Primary downside: using a computer without multiple clipboards feels broken. What do you mean it "forgot" the thing I copied five minutes ago?)

My weapon of choice these days is LaunchBar [0]. Despite the clipboard history feature being bolted on to otherwise unrelated functionality, I love the low-friction keyboard shortcut: Cmd-\, arrow-down to the chosen item, release Cmd to automatically paste.
[0] https://obdev.at/products/launchbar/index.html

uryga1 reply#
Windows 10's builtin clipboard history (Win+V) is one of the best things they've added tbh

(it's opt-in, in case anyone's wondering...)

mceachen#
Also try Ditto. It has features I missed with the new built-in win10 tool which made be come back to it. Open source. https://ditto-cp.sourceforge.io/
kall#
The searchable clipboard history in alfred app set to three months has been a complete game changer for me.

Pushing things that I may or may not need at some point into the clipboard has become subconcious. The type to search is a dream and can even be used without really looking.
I have no need for any actice code snippet managment/notes since anything that matters stays in the three month buffer.

lgunsch#
Definitely agree. I've used a clipboard manager for years now, and I can't imagine going back. I always miss it when I'm not on my machine.
kanyethegreat#
Nice! I've been looking for something like this. Do you use tmux? I wonder how it works with tmux copy mode... Semi-related to this, I wish there was a way to visualize your undo/redo tree. I hate that if I want to undo a change I made 10 changes ago, I can't (at least, I don't know how to). Something like a jump list in vim.
war10251 reply#
I used to have Glipper installed in Gnome, but it looks like that's been a dead project for the better part of a decade now. Does anyone know a modern equivalent? I did enjoy having a clipboard manager

I guess one potential downside is that I use `pass` to manage passwords and I don't terribly want my passwords all stuck in my clipboard history...

seelaman#
I use Clipman. Simple, but does job.
edwinyzh#
Yes! And please don't choose one that's too much powerful (usually means complexity) and bloated. On Windows over the decades I've tried a lot of them, and ATM, clipdiary is the best, because it does what I need (just keep a list of clip history and let me select and paste any of them handily) and not slow.
mekster#
Unclutter on macOS is simple and doesn't get in the way as clipboard manager. It also has quick memo feature which I use to keep my to-do list.

These small things are part of the reasons I stick with macOS.
Not sure why in decades, Windows never have these things.

jmondi3 replies#
Write meaningful git commit messages, always. Even in stupid side projects that don't matter. Because then when you're at work, it will be second nature to write good messages, and your colleagues will absolutely appreciate it.

I've been following the keywords here: https://github.com/joelparkerhenderson/git_commit_message

city411 reply#
To add to that, rebase and generally "clean" your commits before pushing them out. A repo that has no "oops, typo" type commits in it is just so much more pleasant to navigate.
lloeki#
It goes into full effect when you came to witness a repo full of WIP/SAVEPOINT/fix typo commit that literally kills git blame/guy bisect.
darekkay#
This. But I always emphasize the reasoning for doing so. I usually don't care about the git _log_, but I'm using git _blame_ very often. I want to know why exactly someone changed a piece of code, and "oh, typo" or "fix bug" don't help at all. At least include some ticket reference.
JensRantil#
Nice! I totally agree with this! I've used https://www.conventionalcommits.org (initially from Angular, I think) and it has _really_ made me a better programmer. Worth pointing out that it also simplified code review a lot to make PRs less of a frictionpoint.
dceddia7 replies#
A couple others have mentioned shell tricks. One of my favorites is using Alt-. (in Bash and Zsh) to insert the last argument of the previous command. Press it multiple times and it will cycle through the last argument of all previous commands. It's great for when you want to, say, `ls thing` and then `vim thing`.

Yesterday I went looking for a similar key that would insert a copy of the last argument on the current line, like for when you want to copy or rename a file to a similar name in the same directory, as in `cp some/long/path/to/foo.txt some/long/path/to/foo2.txt`.
I couldn't find a command for this, so I made my own Zsh "widget" and bound it to Alt-/ so now I can type `cp some/long/path/to/foo.txt` and hit Alt-/ to prefill the second arg. I put the code for it up here: https://gist.github.com/dceddia/0a45a88dd61cbdf1be023d0a8f15...

cs02rm02 replies#
I think !$ will do similar, at least in bash.

(I'm on a phone and normally rely on muscle memory so it might be the wrong symbols).

edaemon1 reply#
`!$` is right, though it isn't interactive like `Alt+.` is.
mkl2 replies#
Yes it is, you just need to press Alt-^ to do history expansion on it.

Continue this thread — 2 replies

dceddia#
Maybe I misunderstood, or it does something different in zsh, but it seems like it's inserting the command itself:

    ls foo.txt !$

    ls: ls: No such file or directory
    foo.txt
DaanVanVugt1 reply#
For `cp some/long/path/to/foo.txt some/long/path/to/foo2.txt` I always liked brace expansion, for example

`cp some/long/path/to/{foo,foo2}.txt`
(Though foo{,2}.txt is even shorter)

read_if_gay_#
Gonna have to try doing this, I usually cd to the source/target directory in these situations, then copy it and use cd - to get back quickly.
chadlavi2 replies#
I assume you're talking about only on linux? On a mac `alt .` and `alt /` are mapped to characters ≥ and ÷
bandris1 reply#
Esc-. is more portable. Works on mac too.
kanyethegreat#
Yea, this is what I use.
dceddia#
I'm on a Mac using iTerm, but I think I've tweaked some setting about meta keys somewhere in preferences.
kanyethegreat#
Yes, I love this one! I'll check out the widget. Sounds cool! I have the same problem (it's usually changing filenames, so I just use fzf twice, then modify the second filename).

There was one bash feature along the same lines of this. It was like bringing up the previous command in a shell script, so you could modify it freely, then run it. It was useful for long command, I think. Haven't tried learning it though. Just saw a couple wizard colleagues using it, and it seemed cool.

war10252 replies#
One of my favorite bash tricks is that I have this alias in my bashrc file:

   function goto {
      cd -P ~/.links/"$1";
   }

And then in the `.links` folder I have symbolic links to directories I need to go to often.

Then getting to a frequently used directory is just a `goto X` away.

erik_seaberg1 reply#
Cool. How does that compare with setting CDPATH?
war1025#
I just looked up CDPATH and my understanding is that the difference between the two is that with CDPATH you are setting directories that you can quickly navigate to subdirectories of.

This is more of a quick link to directories themselves.
Maybe you could do something similar to the alias if you had my `~/.links` directory in your CDPATH, but then you'd still need to add the `-P`every time to get it to follow the symbolic link.
Not something I had ever thought of before honestly.

bruh2#
Ooh, that's cool. You might be interested at z[1]. It kinda fills the same purpose as your trick, except it automatically figures out what are your most used directories by tracking your shell navigation or something.

[1] https://github.com/rupa/z/wiki

noisy_boy#
$_ will do the same thing in bash as in "ls thing" and then "vim $_" (but only works for arguments from the last command)
mpawelski#
Thanks! I didn't know about Alt-. I'm using powershell and it works there too.
simonw2 replies#
Don't push a commit with a new feature without tests and documentation. Even for your personal projects.

I started doing this a couple of years ago and it's hard to overstate the positive impact this has had on my macro productivity. I can come back to a project I haven't touched in six months and instantly start productively making improvements.
Tests and documentation really are for future you.

quicklime1 reply#
+1, good tests are by far the biggest long-term productivity win, in my experience worth much more than any other tooling or process improvement.

Unfortunately I've gone in the opposite direction as you. I recently moved from a company that had a good automated test culture, to one that has a culture of manually testing things, often in production. Everyone, even the senior engineers who've been around for a long time, regularly lands changes that cause prod incidents.
There's actually quite a good canary/rollback system in place to deal with this, so a lot of people think everything's fine. But they don't quite realize how much more efficient things are if you can just make a change and run a test suite, and quickly have confidence that you didn't break things.

simonw#
Working for Eventbrite really helped we with this. I was there for over five years and got to see the transition from ad-hoc testing and an often broken master to every commit passing the test suite for most teams.

It got to the point where I could drop in on a project by a team in another country that I'd never encountered before, read their README, checkout their code, run the tests, make a change and submit a pull request.
The big thing for me in the past couple of years has been applying the same discipline to my own personal projects and finding that even there my overall productivity improved rather than being held back by the extra work invested in testing and documentation.

kanyethegreat#
Absolutely! I've come to the same realization. Just haven't figured out my effective documentation rules. Difficult to experiment with what works when the feedback loop is on the same magnitude of how long it takes you to forget (eg. 6 months). Best proxy I can come up with is "how can I communicate this to someone who has no context? What would they want to know?"

Load more comments