Readit News logoReadit News
JNRowe commented on Journaling using Nix, Vim and coreutils   tangled.sh/@oppi.li/journ... · Posted by u/icy
zdw · 12 days ago
If you want week numbers in the calendar, you can use `ncal -w` and they'll be the last row. Add a `-3` and you get:

    $ ncal -w3
        July 2025         August 2025       September 2025
    Mo     7 14 21 28        4 11 18 25     1  8 15 22 29
    Tu  1  8 15 22 29        5 12 19 26     2  9 16 23 30
    We  2  9 16 23 30        6 13 20 27     3 10 17 24
    Th  3 10 17 24 31        7 14 21 28     4 11 18 25
    Fr  4 11 18 25        1  8 15 22 29     5 12 19 26
    Sa  5 12 19 26        2  9 16 23 30     6 13 20 27
    Su  6 13 20 27        3 10 17 24 31     7 14 21 28
       27 28 29 30 31    31 32 33 34 35    36 37 38 39 40

JNRowe · 11 days ago
There is also a `-b` flag to get it back in to the shape you'd expect from cal. I find the week column easier to read in that form:

   w| Mo Tu We Th Fr Sa Su
  31|              1  2  3
  32|  4  5  6  7  8  9 10
Perhaps worth noting that ncal's -w is ISO-8601 compliant¹, which may surprise some people around new year as week numbers can reset in December or January.

[Said as someone who aliases cal to "ncal -wb" mostly just to get the correct first day of the week for their locale.]

¹ https://en.wikipedia.org/wiki/ISO_week_date

JNRowe commented on Writing simple tab-completions for Bash and Zsh   mill-build.org/blog/14-ba... · Posted by u/lihaoyi
derriz · 14 days ago
I feel that the ergonomics of bash completion took a hit as the configurations got “smarter” and “helpfully” started blocking file or directory name completion if it thinks it wouldn’t be appropriate to have a file name at the current cursor position. Instead of blocking, the default should always be to fall back to filename completion.

Sometimes I’m close to disabling/uninstalling all completion scripts out of irritation as decades of muscle memory are frustrated by this behavior.

It’s like that bad/annoying UX with text fields where the UI is constantly fighting against you in order prevent you from producing “illegal” intermediate input - e.g. let me paste the clipboard here goddammit - I know what I’m doing - I’ll correct it.

JNRowe · 14 days ago
There is the complete-filename function that only completes filenames in bash, bound to M-/ by default. You can use that in any place you want a filename where "complete"(the function normally bound to tab) would do something you don't desire.

There are a collection of other non-context aware completion functions that are bound by default too, useful for example when you when you wish to complete hostnames in a for-loop.

zle has what is largely a significant superset of this, the documentation is spread about between the zshzle and zshcomp* manpages.

u/JNRowe

KarmaCake day7285February 3, 2014
About
username at gmail.com ; Feel free to get in touch.

[ my public key: https://keybase.io/jnrowe; my proof: https://keybase.io/jnrowe/sigs/orH3nyNqAK4vkIpcxn2HRihHPV2HX80SyDwM9cR5xnw ]

View Original