So if I'm reading this correctly, you need to quote your text, and it can't be multi-line... why not this:
alias notes='cat >> ~/notes'
Just hit ctrl+c (stops cat) or ctrl+d (signals EOF) when you're done writing. No quoting, special characters that might act funny, line or size limits, etc.
I prefer it over echoing into a file because it has more advanced display features - such as by date - and topics (hashtags [don't forget to escape the hash!], or @tags)
Got the journal files stored in Dropbox so they're everywhere I am
I have it setup but don’t use it as my main notes app. That would still be Simplenote (with Notational Velocity on desktop).
Mainly because I figured would rather use GUI for notes on both desktop and mobile. Maybe one of these days I should give Standard Notes a try (https://standardnotes.org). It’s OSS and client side encrypted (afaik).
Not as simple but well worth the extra weight would be org-mode. I personally find the vim-orgmode a balance between the full power of org vs my reliance on vim for day-to-day operations but I must admit I'm sometimes jealous of the power I see in emacs for this.
I have been a long-time Emacs user and I finally just started learning org-mode. I wish I had started earlier. Previously, I had used Zim to do my note-taking, but org-mode is just so much better in every way.
I have a feeling it's going to be my gateway into more heavy LaTeX usage for all manner of documents. The ability to evaluate code during document generation is a big deal to me.
This is neat, and there's a lot of interesting comments and pointers elsewhere in these comment threads.
What I've been doing (for the last 25 years or so) is simple. I always keep a window open, visible in all virtual desktops, on the bottom right of my screen, with: vi ~/notes/notes
For somewhat less than the last 25 years, ~/notes is an encrypted git repo. I have a cron that, minutely, adds, commits, pulls and pushes to a couple of my servers on the Internet.
I generally have one of these for each company I work for, and another one that I've used for all things personal.
just as fast and you can actually edit when needed.
$ ed ~/.todo
a
this is a new bloat
.
s/bloat/note/
this is a new note
w
q
$ cat ~/.todo
this is a new note
$ ed ~/.todo
19
a
this is another note.
it goes across more lines.
woo!
.
w
q
$
Why not just have the flexibility of adding markdown whenever you feel like it (and not when you don't)? Now, you've got a file a markdown renderer can render whether or not you used markdown.
Combination of your improvements and the first commentor's in the link
- 'notes' by itself views the file (interactive shell only)
- 'notes' with args, the args are appended to file (original function)
- 'notes' with heredoc (or any piped data) allows for multiline notes
notes() {
if [ -n "$1" ]; then
echo $@ >> "$HOME/notes.md"
else
# detect if we're in a tty or a pipe
if [ -t 0 ]; then
less "$HOME/notes.md"
else
cat - >> "$HOME/notes.md"
fi
fi
}
usage:
$ notes 1
$ notes 1 2 3
$ notes <<EOF
> this is a
> multiline note
> EOF
$ uptime | notes
$ notes
(opens less with the following content)
1
1 2 3
this is a
multiline note
23:22:06 up 3 days, 11:41, 1 user, load average: 0.25, 0.15, 0.26
You still need quotes to prevent the shell from expanding $variables and globs. It’ll also mangle your spaces (try with `notes foo<space><space>bar`: it saves it as "foo<space>bar") due to the $@.
Such 'notes' function can seem 'useful' at first glance, but how You gonna 'organize these notes, for example after You have used it for about a year, or several years?
I prefer other approach.
Everytime I get to know some new switch for a command, or new use for them, or even a new command, I create ~/man/command file with examples and commends inside, like ~/man/tar or ~/man/gstat or ~/man/xorg.conf.
This way its already organized and you can grep -r 'something' ~/man for the thing you need.
It allows the editing of notes for a given day, listing of all notes, and display of a note for a given day, defaulting to today if no date is provided.
I keep meaning to add support for RCS or some other form of basic version control, but it's never been that much of an issue.
Would any such note-taking solution work across several ssh sessions?
I'm a small scale sysadmin, SSHing into multiple servers configured by my predecessors. I'd love to be able to some command | notes.txt or whatever.
And no, I don't have my home directory mounted at all locations the same way. I even need to login as different user for different machines.
The command factor is my Mac and Terminal.app
[+] [-] lucb1e|8 years ago|reply
[+] [-] dylanpyle|8 years ago|reply
[+] [-] jasonm23|8 years ago|reply
C-d remains constant, but it's irritating that there's no way to consistently abort.
To deal with this our edit target needs to be a temporary file which we subsequently bless, append to the notes file and then trash.
Keeping notes open in an editor buffer that I can jump to easily, and manually:
>> notes.md
From the command line gains me all the utility I need while using a modern machine and zsh.
Of course, if I time travel, the GP trick is useful on old ultrix machines.
[+] [-] corobo|8 years ago|reply
I prefer it over echoing into a file because it has more advanced display features - such as by date - and topics (hashtags [don't forget to escape the hash!], or @tags)
Got the journal files stored in Dropbox so they're everywhere I am
[+] [-] balladeer|8 years ago|reply
Mainly because I figured would rather use GUI for notes on both desktop and mobile. Maybe one of these days I should give Standard Notes a try (https://standardnotes.org). It’s OSS and client side encrypted (afaik).
[+] [-] pwelch|8 years ago|reply
[+] [-] overcast|8 years ago|reply
[+] [-] pweissbrod|8 years ago|reply
[+] [-] uep|8 years ago|reply
I have a feeling it's going to be my gateway into more heavy LaTeX usage for all manner of documents. The ability to evaluate code during document generation is a big deal to me.
[+] [-] unknown|8 years ago|reply
[deleted]
[+] [-] JoshMnem|8 years ago|reply
[+] [-] lysium|8 years ago|reply
[+] [-] Fletch137|8 years ago|reply
[+] [-] dheera|8 years ago|reply
[+] [-] Diederich|8 years ago|reply
What I've been doing (for the last 25 years or so) is simple. I always keep a window open, visible in all virtual desktops, on the bottom right of my screen, with: vi ~/notes/notes
For somewhat less than the last 25 years, ~/notes is an encrypted git repo. I have a cron that, minutely, adds, commits, pulls and pushes to a couple of my servers on the Internet.
I generally have one of these for each company I work for, and another one that I've used for all things personal.
[+] [-] perryprog|8 years ago|reply
[+] [-] cat199|8 years ago|reply
just as fast and you can actually edit when needed.
[+] [-] rhizome|8 years ago|reply
[+] [-] hathym|8 years ago|reply
[+] [-] lillesvin|8 years ago|reply
[+] [-] delinka|8 years ago|reply
[+] [-] lottin|8 years ago|reply
cat >> ~/notes
does the same thing.
[+] [-] ConfucianNardin|8 years ago|reply
[+] [-] tyingq|8 years ago|reply
Would give you some rudimentary readline editing capability.
[+] [-] nsb1|8 years ago|reply
notes() {
[+] [-] vacri|8 years ago|reply
- 'notes' by itself views the file (interactive shell only)
- 'notes' with args, the args are appended to file (original function)
- 'notes' with heredoc (or any piped data) allows for multiline notes
[+] [-] hk__2|8 years ago|reply
[+] [-] tincholio|8 years ago|reply
[+] [-] digitalsushi|8 years ago|reply
[+] [-] jaddood|8 years ago|reply
Take a look at https://news.ycombinator.com/item?id=14126006
I also add a few aliases to make it even quicker:
This will provide (in my opinion) both a very simple way to take notes and a somewhat mature and usable note taking 'program'.[+] [-] hk__2|8 years ago|reply
Direct link: https://github.com/jad-issa/mplan-sh. Why post a link to a 6-months years-old HN submission with no comments?
[+] [-] vermaden|8 years ago|reply
I prefer other approach.
Everytime I get to know some new switch for a command, or new use for them, or even a new command, I create ~/man/command file with examples and commends inside, like ~/man/tar or ~/man/gstat or ~/man/xorg.conf.
This way its already organized and you can grep -r 'something' ~/man for the thing you need.
My $0.02.
[+] [-] talideon|8 years ago|reply
It allows the editing of notes for a given day, listing of all notes, and display of a note for a given day, defaulting to today if no date is provided.
I keep meaning to add support for RCS or some other form of basic version control, but it's never been that much of an issue.
[+] [-] reacharavindh|8 years ago|reply
I'm a small scale sysadmin, SSHing into multiple servers configured by my predecessors. I'd love to be able to some command | notes.txt or whatever. And no, I don't have my home directory mounted at all locations the same way. I even need to login as different user for different machines. The command factor is my Mac and Terminal.app
[+] [-] amdavidson|8 years ago|reply
You could adjust it so that it uses a central notes store on one ssh host pretty easily with something like:
then you probably need something like[+] [-] catullus|8 years ago|reply
[+] [-] mdhughes|8 years ago|reply
http://markdamonhughes.com/thoughtpy/
Kindly email me bugs, not pull requests.
[+] [-] zer0th|8 years ago|reply
You can read about my method here:
https://news.ycombinator.com/item?id=10997410
[+] [-] Flimm|8 years ago|reply
[+] [-] stevekemp|8 years ago|reply
[+] [-] indigodaddy|8 years ago|reply