4 ms·
Here's what I do: * keep my notes in a flat, plain-text "reference" file * key items/entries prefaced/abbreviated with leading double underscores; e.g. __bas
by vstuart 10y ago
Here's what I do:
* keep my notes in a flat, plain-text "reference" file
* key items/entries prefaced/abbreviated with leading double underscores; e.g.
__bash
__grep
__birthdays
+ anything else you want
* bash script ("ref.sh"):
#!/bin/bash
# https://stackoverflow.com/questions/7131670/make-bash-alias-that-takes-parameter
grep -i -A10000 --color=always __$1 /home/victoria/projects/shortcuts/reference | more
* ~/.bashrc alias:
# ----------------------------------------------------------------------------
# SEARCH MY 'REFERENCE' FILE:
# search my Reference file for argument, tagged (prepended) with two leading underscores (e.g.: 'ref wget' finds '__wget'):
alias ref='/mnt/Vancouver/Programming/scripts/ref.sh'
alias ?='/mnt/Vancouver/Programming/scripts/ref.sh'
# "free" (unlimited) grep search of my '/mnt/Vancouver/ .reference' file (e.g. 'ref rename' : i.e., not limited by double-underscore tag):
alias refgrep='/mnt/Vancouver/Programming/scripts/refgrep.sh'
* Now, when I want to find a note quickly, I launch a terminal, search, then exit out (alias "qq") ;-)
* E.g.: $ ref grep
* Image (screenshot): http://imgur.com/a/7WPtD http://imgur.com/a/7WPtD
- vstuart 10y agoOops -- I should have included my "refgrep.sh" bash script: #!/bin/bash # https://stackoverflow.com/questions/7131670/make-bash-alias-that-takes-parameter https://stackoverflow.com/questions/7131670/make-bash-alias-... grep -i -A10 --color=always $1 /home/victoria/projects/shortcuts/reference | more =========================== I should also have mentioned that with either script/alias {ref | refgrep}, partial strings are automatically searched. [I created/use the latter script because sometimes I cannot remember all of my __<entries>.] For example, if you have two or more placemarkers that are similar (__python | __pythonpath), "ref py" will find the first one; "ref pythonp" will find the the second one ... just extend the string to be more specific, as needed ... "refgrep <string>" will find (the first occurrence) of that string, anywhere in the "reference" file. I use that "reference" file for everything that I might want to quickly find (literally, seconds): programming; birthdays; phone numbers; prescriptions, doctors, you-name-it. Just pop open a terminal; search (ref <string>); read; quit terminal. :-D