News for hackers. Stuff that matters.

mklein994

Re:Termux on Monday February 02, 2026 @10:26AM (#46857080)
For me, it was how I learned Vim. The awkward keyboard pushed me towards learning more efficient keystrokes, so now I'm very comfortable with Vim.

I would learn it on the bus, and at the time I didn't have a data plan, so I could only access things I had already downloaded. The `:help` documentation is very thorough.

Re:Using Microsoft's New CLI Text Editor on Ubuntu on Saturday June 21, 2025 @02:46PM (#44339781)
It's actually a bit more nuanced: `:x` is like `:wq`, but only writes if changes have been made. `:x!` has the same semantics as `:wq!`.
Re:Things You Didn't Know About GNU Readline (2019) on Wednesday June 26, 2024 @02:26PM (#40802912)
> Also, without some sort of indicator, Vim’s modal design is awkward here—it’s very easy to forget which mode you’re in.

With `bash`, you can show which mode you're in by putting this in your `~/.inputrc`:

    show-mode-in-prompt on
It makes your prompt look like this:

    [foo@bar ~]$ # before turning it on
    @[foo@bar ~]$ # after
    @[foo@bar ~]$ set -o vi
    (ins)[foo@bar ~]$ # and after I press esc:
    (cmd)[foo@bar ~]$
Customize these with `emacs-mode-string`, `vi-ins-mode-string`, and `vi-cmd-mode-string`.
Re:Let the (terminal) bells ring out on Sunday December 24, 2023 @05:17PM (#38757500)
> [...] but I found it difficult to remember to put `;tput bel` on every command that would be slow [...]

What I do in these situations (assuming the job is still in the foreground, and can be interrupted), is suspend the task with ctrl+z and resume with `fg`, chaining it with some other command:

    fg; notify-send "done"
This uses the "job control" feature of `bash`, so it requires no extra setup. Your approach has the simple advantage however, that once it's set up, it just works, automatically.
Re:Navigational Instruments: Hidden Features in Firefox [2020] on Tuesday September 12, 2023 @08:27AM (#37480055)
Cool. I didn't know about "Ctrl+T, Ctrl+Z"; I've always used "Alt+D, Alt+Enter" to duplicate tabs. This other shortcut might come in handy if I want to immediately edit the URL.
Re:Lazygit: Simple terminal UI for Git commands on Wednesday July 19, 2023 @12:42PM (#36789341)
Not as quick as you're asking for, but what I do, after running "git log" to jog my memory of what the commit message was, is this:

  git commit --fixup=':/message regexp'
This will find the youngest commit where the message matches the "message regexp" pattern. See also: https://git-scm.com/docs/gitrevisions
Re:TablEdit – Music Tablature Editor on Monday December 26, 2022 @05:13PM (#34142480)
Lead sheets?
Re:Solving Advent of Code with jq on Monday December 12, 2022 @11:11PM (#33964734)
This is incredible. I'm learning so much by just reading the source code and trying it out.
Re:The Perfect Commit on Saturday October 29, 2022 @11:04PM (#33390603)
It's called the Imperative Mood[0]. I like to think of it as though I'm completing this statement: "If you apply this patch, this commit will [Do The Thing™]". Here's a few examples:

If I were to apply this patch, this commit will…

- Simplify FooWidget

- Add optional table support

- Remove trailing whitespace

- Update fizzbuzz to 1.2.0

- Merge branch 'feature/ABC-123-foobar'

- Revert "Add foo to bar"

[0]: https://en.wikipedia.org/wiki/Imperative_mood

Not quite there with the scanning part, but https://supercook.com comes close.
Cascadia Mono/Code, depending if I feel like having ligatures:

https://github.com/microsoft/cascadia-code

It has the option to enable cursive italics, which is disabled by default. Been using it for over a year. No complaints.

Re:Dark Sky Has a New Home (2020) on Tuesday June 07, 2022 @08:25AM (#31653150)
Another alternative is OpenWeatherMap: https://openweathermap.org/api/one-call-3

It's not quite a drop-in replacement, but it's pretty close. They have a free plan for 1,000 calls/day.

Re:Ask HN: What are you using for a RSS Reader? on Sunday April 24, 2022 @01:35AM (#31141546)
https://fraidyc.at/

It's a browser extension, and it's been very pleasant to use. I came across it on a previous Show HN post: https://news.ycombinator.com/item?id=22545878

Now if only it worked on mobile…

Re:Highlights from Git 2.35 on Monday January 24, 2022 @08:13PM (#30066585)
> git stash‘s new --staged mode makes it easy to stash away what you already have in the staging area, and nothing else.

Sweet! I've been wanting this feature for a while.

See also:

https://raw.github.com/git/git/master/Documentation/RelNotes...

Neat. I'll add this to my toolbox.

Somewhat unrelated: I discovered some time ago that the column command (from util-linux) can print trees of hierarchical data (up to 2 levels deep).

From the man page:

  $ echo -e '1 0 A\n2 1 AA\n3 1 AB\n4 2 AAA\n5 2 AAB' | column --tree-id 1 --tree-parent 2 --tree 3
  1  0  A
  2  1  |-AA
  4  2  | |-AAA
  5  2  | `-AAB
  3  1  `-AB
column(1): https://github.com/karelzak/util-linux/blob/master/text-util...
Re:A Vim Guide for Advanced Users on Saturday February 27, 2021 @08:00PM (#26289700)
Huh, learn something new everyday. Thanks!
Re:A Vim Guide for Advanced Users on Saturday February 27, 2021 @04:46PM (#26288466)
The docs for this is in `:help v_CTRL-A`.

It should actually say VISUAL BLOCK mode. This is where you use `CTRL-v` to select a block of text. You can read more in `:help blockwise-visual`.

Also see the 'nrformats' option: `:help 'nrformats'`. You can include alphabetic characters to do the same thing with A-Z, for example.

https://vimhelp.org/change.txt.html#v_CTRL-A

Re:Networking Tools Every Developer Needs to Know on Tuesday December 01, 2020 @10:26PM (#25272916)
I recently discovered the `-brief` flag to ip(1). It shows a summary table for the address and link commands that can be easier to read than the default output.
Re:This is how I git on Tuesday November 10, 2020 @08:40AM (#25045772)
Enter git rerere: https://git-scm.com/docs/git-rerere

This will "REuse REcorded REsolutions" of conflicted merges.

Once enabled, it will record how a merge conflict was resolved, and replay it back the next time it encounters it. Saves a lot of time in cases where you already solved the merge once before.

https://git-scm.com/book/en/v2/Git-Tools-Rerere

Re:iSH now available on the App Store on Friday October 23, 2020 @09:23AM (#24869196)
Is this like an iOS alternative to Termux? How does it compare?

https://termux.com

Re:CSS Layout – Grid vs. Flexbox on Tuesday October 13, 2020 @08:32AM (#24764965)
> I need to apply justify|align|content|items in the browser to make it do what I want. I can't for the life of me remember what they do.

I found the Flexbox Zombies course to be helpful for that: https://flexboxzombies.com

It's free right now too.

Re:Alacritty v0.5 on Saturday August 01, 2020 @11:05AM (#24020978)
I found that changing my keybinding to start alacritty with this environment variable set seems to work:

  WINIT_X11_SCALE_FACTOR=1.0 alacritty

https://github.com/alacritty/alacritty/commit/93780ef0929e08...
Re:Highlights from Git 2.28 on Monday July 27, 2020 @09:15PM (#23971277)
git diff --color-moved

This makes git diff highlight reindented or moved lines differently.

I use it to get diffs similar to when you pass -w, but with a bit more context.

It takes a bit of experimenting to keep it from looking like a fruit salad, but sometimes you get interesting results.

https://git-scm.com/docs/git-diff#Documentation/git-diff.txt...

Re:Highlights from Git 2.28 on Monday July 27, 2020 @08:40PM (#23971057)

  git range-diff
Very useful to get an overview of what changed after a rebase.

https://git-scm.com/docs/git-range-diff

Re:Show HN: Regex Cheatsheet on Friday January 31, 2020 @12:49PM (#22203713)
I tend to go to https://www.regular-expressions.info when I need to find out which features are supported between dialects. Not always up-to-date, but has some good info.
Re:A final proposal for Rust await syntax on Monday May 06, 2019 @12:31PM (#19840984)
The syntax feels a bit Ruby-ish, doesn't it? Here's an example from the article of how they could expand the syntax in the future:

  foo.bar(..).baz(..).match {
    Variant1 => { ... }
    Variant2(quux) => { ... }
  }
Compared to some Ruby:

  5.times {
    puts "Hello world!"
  }
Note I'm by no means an expert in Ruby or Rust, this is just what I thought of when I saw the syntax.
Re:Languages I want to write on Sunday April 14, 2019 @11:52AM (#19660097)
LilyPond comes to mind. http://lilypond.org/
Re:Firefox 66.0 Aims to Reduce Online Annoyances on Tuesday March 19, 2019 @04:55PM (#19435753)
I always forget them, so I have this bookmarked: https://support.mozilla.org/en-US/kb/awesome-bar-search-fire...

TL;DR:

Add ^ to search for matches in your browsing history.

Add * to search for matches in your bookmarks.

Add + to search for matches in pages you've tagged.

Add % to search for matches in your currently open tabs.

Add # to search for matches in page titles.

Add $ to search for matches in web addresses (URLs).

Add ? to search for matches in suggestions.

Older »