Show HN: Hn2org, read HN pages in Emacs Org mode
github.com1 pointsby rml0 comments
> (list-tuples '(B G) 2)
((B B) (B G) (G B) (G G))
3 cases have at least one girl ~/Dropbox/{Code,Documents,Videos,Downloads}
on a new computer I install Dropbox and create symlinks, e.g. /home/rml/.emacs -> /home/rml/Dropbox/Code/personal/config/dot-emacs
/home/rml/.Xinitrc -> /home/rml/Dropbox/Code/personal/config/Xinitrc
/home/rml/Code -> /home/rml/Dropbox/Code
... etc
Because I pretty much live in Emacs and manage files using `dired` I have lots of Elisp code and custom keybindings that take me to my most-used files and directories. For other "tier 2" things I either know where they are due to long habit (most stuff doesn't move or it's obvious which folder e.g. a PDF will be in) or I use a combination of `M-x locate` and `M-x grep` which works pretty well. # add first and penultimate columns
perl -lane 'print $F[0] + $F[-2]'
# print just lines 15 to 17
perl -ne 'print if 15 .. 17' *.pod
# in-place edit of *.c files changing all foo to bar
perl -p -i.bak -e 's/\bfoo\b/bar/g' *.c
# command-line that prints the first 50 lines (cheaply)
perl -pe 'exit if $. > 50' f1 f2 f3 ...
# delete first 10 lines
perl -i.old -ne 'print unless 1 .. 10' foo.txt
# change all the isolated oldvar occurrences to newvar
perl -i.old -pe 's{\boldvar\b}{newvar}g' *.[chy]
# command-line that reverses the whole file by lines
perl -e 'print reverse <>' file1 file2 file3 ....
# find palindromes
perl -lne 'print if $_ eq reverse' /usr/dict/words
# command-line that reverse all the bytes in a file
perl -0777e 'print scalar reverse <>' f1 f2 f3 ...
# command-line that reverses the whole file by paragraphs
perl -00 -e 'print reverse <>' file1 file2 file3 ....
# increment all numbers found in these files
perl i.tiny -pe 's/(\d+)/ 1 + $1 /ge' file1 file2 ....
# command-line that shows each line with its characters backwards
perl -nle 'print scalar reverse $_' file1 file2 file3 ....
# delete all but lines between START and END
perl -i.old -ne 'print unless /^START$/ .. /^END$/' foo.txt
# binary edit (careful!)
perl -i.bak -pe 's/Mozilla/Slopoke/g' /usr/local/bin/netscape
# look for dup words
perl -0777 -ne 'print "$.: doubled $_\n" while /\b(\w+)\b\s+\b\1\b/gi'
# command-line that prints the last 50 lines (expensively)
perl -e 'lines = <>; print @@lines[ $#lines .. $#lines-50' f1 f2 f3 ...
As the years go by one realizes that even these “features” like Org, Dired, etc are just illusions in some sense. They’re just Elisp code someone else wrote and put a name on. You can take or leave them or write your own code that changes/advises/customizes them.
It’s all up to you. You don’t need a blessed “plugin” architecture, some PM at IntelliJ’s permission etc
At some point one realizes the “visual shell” nature of Emacs. Every single piece of text on screen can be programmed to “mean something” (see also: “recognizers” from human interface research) and have actions taken on it either by the editor itself, or external processes / scripts you call with a command. If it’s common enough, make a key binding. It’s your house, do what you want
Depending on how you set up your environment, you may never have to look at text again that you do not have this level of power over. You are no longer at the mercy of “application developers”
I’ve been using it since 2005. Guess how many of 2005’s popular editors even still exist
My recommendation to anyone trying to actually learn is start with the full vanilla config, weird default keybindings, etc, go through the built in tutorials, and only add things to your config that you write and understand yourself. Understand it in its own terms. The plethora of packages, etc have “cool features” but impede learning by adding mountains of complex dependencies that are opaque to the beginner and cause confusion IMO