summaryrefslogtreecommitdiff
path: root/src/Note-taking_with_Vim.ascii
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@iohq.net>2015-07-04 14:14:41 -0600
committerAaron Ball <nullspoon@iohq.net>2015-07-17 08:58:46 -0600
commit1885394214392349a92eaa959e5f6acdffcd2ca2 (patch)
tree77772c8eba7ba2b30805c81827eef36d47157974 /src/Note-taking_with_Vim.ascii
parent555db1fb0a22d9e0af9944504feb0ba5d759e926 (diff)
downloadoper.io-1885394214392349a92eaa959e5f6acdffcd2ca2.tar.gz
oper.io-1885394214392349a92eaa959e5f6acdffcd2ca2.tar.xz
Restructured all posts
Diffstat (limited to 'src/Note-taking_with_Vim.ascii')
-rw-r--r--src/Note-taking_with_Vim.ascii115
1 files changed, 0 insertions, 115 deletions
diff --git a/src/Note-taking_with_Vim.ascii b/src/Note-taking_with_Vim.ascii
deleted file mode 100644
index 4aea378..0000000
--- a/src/Note-taking_with_Vim.ascii
+++ /dev/null
@@ -1,115 +0,0 @@
-Note-taking with Vim
-====================
-:author: Aaron Ball
-:email: nullspoon@iohq.net
-
-
-== {doctitle}
-
-Two vim posts in one day!
-
-My task list at work has recently become so large (it's probably well over a
-year's worth of work now) that I now need to track my tasks somewhere other
-than in my head (documentation is always better than tribal knowledge anyways).
-I realy don't like task tracking becuase most of the applications out there are
-just so heavy for what note-taking actually is. I use vim almost all day, every
-day though, so why not use that (plus it's command line!)?
-
-I spent about thirty minutes writing this up today. It's inspired a bit by the
-LifeHacker article,
-http://lifehacker.com/5592047/turn-your-command-line-into-a-fast-and-simple-note+taking-tool[Turn
-Your Command Line into a Fast and Simple Note Taking Tool] (thanks
-http://mottr.am/[Jack Mottram]).
-
-This will automagically give all of your notes a .wiki extension, telling vim
-to use the mediawiki text syntax highlighter (I use MediaWiki a lot to so I
-figured I'd use that syntax for markup). This can be found
-http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim[here]. If you
-want to use something else like markdown, just change the $noteExt variable at
-the top to the extension associated with the highlighter you want.
-
-This addition will give you six new commands.
-
-* +**note** [NoteName]+: Opens a note for editing or creates
-a new note. If no note is specified, opens the most recent note.
-* +**mknote** NoteName "Note to append"+: Appends text to the
-requested note.
-* +**catnote** [NoteName]+: Prints the contents of the
-specified note.
-* +**lsnotes**+: Lists all notes by date modified
-* +**findnote** SearchTerm+: Searches all notes for the
-search term (case insensitive) and prints the results along with note
-title and line number on which the term was found.
-* +**mvnote** OldName NewName+: Renames a note
-* +**rmnote** NoteName+: Deletes the specified note.
-
-Add the following to your .bash_profile (or .profile if you're a ksh user)
-
-----
-export base=~/Documents/Notes
-export noteExt=wiki
-# This would be used for markdown
-# export noteExt=md
-note() {
- if [ ! -d $base ]; then
- mkdir -p $base
- fi
- # If note not specified, open most recent
- if [[ -z "$1" ]]; then
- vim $(ls -t $(find $base/ -type f) | head -n 1)
- else
- vim $base/$1.$noteExt
- fi
-}
-
-mknote() {
- echo $2 >> $base/$1.$noteExt
-}
-
-catnote() {
- # If note not specified, cat most recent
- if [[ -z "$1" ]]; then
- cat $(ls -t $(find $base/ -type f) | head -n 1)
- else
- cat $base/$1.$noteExt
- fi
-}
-
-lsnotes() {
- #ls -1 $base/ | sed "s/\(.*\).$noteExt/* \1/"
- echo
- echo -e "Last Modified\tName"
- ls -lt $base/ | tr -s ' ' | cut -d ' ' -f 6,7,8,9 | sed "s/^\(\w\+\) \(\w\w\) \(\w\w:\w\w\) \(.*\).wiki/\1 \2 \3\t\4/"
- echo
-}
-
-findnote() {
- if [[ -n "$1" ]]; then
- contents="Note:Line:Text\n\n"
- contents=$contents$(find $base/ -type f | xargs grep -n -i "$1" | sed "s/.*\/\(.*\)\.$noteExt:\([0-9]\+\):\(.*\)/\1:\2:\3/")
- echo -e "$contents" | column -s ":" -t
- else
- echo "Please specify a search term."
- fi
-}
-
-mvnote() {
- mv $base/$1.$noteExt ~/Documents/Notes/$2.$noteExt
-}
-
-rmnote() {
- if [[ -n "$1" ]]; then
- rm $base/$1.$noteExt
- else
- echo "Please specify a note."
- fi
-}
-----
-
-
-Category:Linux
-Category:Vim
-Category:Productivity
-
-
-// vim: set syntax=asciidoc:

Generated by cgit