vim as an encrypted cloud note manager

vim_compvim is one of the most popular editors on Linux. You can edit multiple notes in vim simultaneously. However, it is not a generic note manager by design. You can turn it into one using the vim-notes plugin, which also means you need to remember more commands. We already explored how to encrypt files with vim. Let’s try a simple way to turn vim into a note manager. I use it everyday for my notes.

This technique presents a single note as multiple notes. However, I figured a quick way to jump between notes (as if I have a clickable index of the notes to jump instantly to the required note). The only difference is, we will replace vim keybinds to replace the mouse click.

Let’s begin editing a new file in vim.

Here’s the index:

1. General
2. WordPress
3. Technical
4. Quick Notes

Nothing fancy yet. But wait! Let’s add the first few lines of the first note:

1. General
2. WordPress
3. Technical
4. Quick Notes


####################################################
1. General
*###################################################
To watch:
Big Bang Theory
Silicon Valley
True Detective
Sherlock
Mr. Robot

Note the *# immediately after the note name. Let’s add the second note:

1. General
2. WordPress
3. Technical
4. Quick Notes


####################################################
1. General
*###################################################
To watch:
Big Bang Theory
Silicon Valley
True Detective
Sherlock
Mr. Robot

####################################################
2. WordPress
*###################################################
Header color for Twenty Fourteen:
green: 5dce0c
bright blue: 00f2da

As you might have guessed, the *# works as the marker. You can use any sequence that’s not likely to occur frequently in your notes.

Add notes 3 and 4 the same way. The markers are very important as they work like bookmarks.

Sequence of keypresses in vim command mode to jump to note 3 (Technical):

  1. Jump to the beginning of the file with gg, as if to check the index
  2. Press the note number, in this case, 3
  3. Search the marker with /*#

In brief, the above sequence searches for the third occurrence of *# from the beginning of the file.

That’s vim as a note manager for you. To add a new note, add the entry in the index (makes it easier to figure out the marker number to jump to) and add the marker near the note title.

Encrypt the note using the technique in the earlier article.

Cloud synced, you say? That’s even simpler! Here’s the alias to open my note manager:

alias note='vi ~/Dropbox/Public/Docs/Notes/.note'

It’s a hidden file auto-synced to my Dropbox account! 😉

3 thoughts on “vim as an encrypted cloud note manager”

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s