App-Notes
view release on metacpan or search on metacpan
$ notes list
$ notes list <filter>
Lists all of your notes
=head2 replace
$ echo hola | notes replace hello
Replaces the contents of the given note with the contents from STDIN.
=head2 show
$ notes show
$ notes show <name | filter>
Displays the contents of your note.
With no arguments, displays the contents of your last note.
=head2 sync
$ notes sync
Syncs your notes by doing a git pull and push.
Normally this is not necesary, since by default syncs happen during each
command.
You can turn the auto sync off if you set the environment variable
C<APP_NOTES_AUTOSYNC=0>.
Then you have to remember to call sync manually.
=head1 PRO TIPS
=over
=item Using a github gist
A recommended way to use this app is with a github gist.
An advantage of this is that you get a nice user interface for free.
You can bookmark the gist in your browser and be able to view and edit your
notes from there if you like.
To get started, you need a L<github|http://github.com> account.
Then simply create a new L<gist|https://gist.github.com>.
It doesn't matter what you name your gist.
Also, github requires that your gist have some content in the main file.
Just type something in, it doesn't matter.
You can choose to create a public or private gist.
For this application, you most likely will want to create a private gist,
unless you want to make your notes public.
Once you have created your gist, copy it's url.
The url should be displayed at the top and it will be of the form:
C<git@gist.github.com:12343.git>.
Then run this on the command line:
git init <git url>
Now if you run C<notes list> and there should be one note listed.
This was the file you made when you created your gist.
Feel free to delete this note if you want.
Running C<notes add> will add a new note and it will show up in your gist as a
new file.
Try adding a note and verify that it shows up in your gist on github.
Changes you make via the notes tool should show up in your gist and vice versa.
Have fun!
=item Accessing your last note
If you want to edit your last note, simply call edit with no arguments:
$ notes edit
To see your last note, simply call show with no arguments:
$ notes show
=item Syncing
Every time a note is created, modified or removed, L<App::Notes> will commit
the change to the git repo.
By default, it will C<pull> before a command executes and C<push> when its done.
Except on commands where it doesn't make sense.
For example, a push will not happen after calling C<list> or C<show>.
To turn this behavior off, set C<APP_NOTES_AUTOSYNC=0>.
If you do this, make sure to remember to manually call C<notes sync>,
or your notes will get out of sync.
=item Aliasing
Create a shorter alias for notes, such as n.
Run C<which notes> on the command line to find the path that notes was
installed to.
Then create an alias in your ~/.bashrc:
alias n=</path/to/notes>
Now you can run notes by just typing n.
=item VimFu
Do some magic with vim.
Learn about vim filters if you haven't already by running C<:help filter>
inside of a vim session.
Once you understand vim filters, start using them to create and edit notes.
For example, type a note inside of vim.
Highlight the text you just wrote in visual mode.
Now type C<!notes add foo> to create a new note named foo with the contents
you had highlighted.
=GPG Encryption
Want to write notes about super secret stuff that needs to be secure? It's
incredibly easy to use vim + L<gnupg.vim|https://github.com/jamessan/vim-gnupg>
to create and edit encrypted notes. Just create a note with a C<.gpg> extension
and the plugin will pick it up.
notes add super-secret-stuff.gpg
Vim should open up a bottom window where you can enter GPG Recipients
(via ID, email, name, etc.)i to encrypt the note for. You can use your own
key here, and on save, the note will always be encrypted to disk.
The C<gnupg.vim> also ensures that vim does not write plaintext swap files
to disk when editing gpg encrypted files.
( run in 0.911 second using v1.01-cache-2.11-cpan-13bb782fe5a )