Ask HN: Where do you save code snippets or cli commands Hi, where do you guys save code snippets and/or cli commands that you have just learned before you memorize them? |
Ask HN: Where do you save code snippets or cli commands Hi, where do you guys save code snippets and/or cli commands that you have just learned before you memorize them? |
You can add new sections by setting $MANSECT. So I added a new section named with my initials, pj:
export MANSECT=1:n:l:8:3:2:3posix:3pm:3perl:5:4:9:6:7:pj
You can also change where the `man` command searches for manpage files using $MANPATH: export MANPATH="$MANPATH:$HOME/man"
Now you can just `mkdir -p ~/man/manpj` and start adding files with a `.pj` extension, like `postgres.pj` and `bash.pj`. Then it's super-fast to bring those up by saying `man pj postgres`.Of course you would substitute all the above with your own initials or whatever.
You don't even have to write the files with the usual formatting macros. Most of the time a plain text file works okay. But it's kind of fun to learn enough of that to get by: probably less than a dozen macros for paragraph breaks, underlining, etc.
And then you can put your collection of notes on Github like here:
https://github.com/pjungwir/manpj
Here is a file with a few man macros:
I also keep forgetting my password :-(