On Sep 25, 2:14 pm, aaronj1335 <[email protected]> wrote:
> I have system for keeping notes on my computer that uses "*.note"
> files. I would like to add a bit of syntax highlighting, so I added a
> line to my ~/.vim/filetype.vim and made a ~/.vim/ftplugin/note.vim
> file, but where can I find a good reference on how to write this
> file? the syntax looks like this:
>
> ================================================================
> | Thu Sep 24 09:11:52 2009 |
> ----------------------------------------------------------------
>
> some note
>
> ----------------------------------------------------------------
>
> ================================================================
> | Wed Sep 23 16:35:33 2009 |
> ----------------------------------------------------------------
>
> some other note
>
> ----------------------------------------------------------------
>
> I just want highlighting for the delimiter lines and the date/time
> string. Thanks.
Aaron,
I would suggest...
:help syn-define
...for starters.
I've done something along these lines for my own electronic journal
entries. The syntax may be a bit more complex than what you're looking
for. For example, a journal entry header looks like this...
>>
title: Beginning to work with the PPC target (again), now that I've
been
assigned the Command Processor
ctime: 2009/09/11-14:15:03
mtime: 2009/09/11-14:15:03
stags: sensitive,rot13
->
The dates are highlighted specially, with invalid dates highlighted as
Error. It may be overkill, but I could send it to you later if you're
interested.
Alternatively, Hari Krishna Dara has written a Notes plugin that makes
it easy to create, maintain, search, etc... a system of notes in Vim.
The Notes plugin stores the notes as files in a common directory, and
allows you to specify the filetype you wish to use for the files via
the g:notesFileType option. There is another plugin, Txtfmt, which
allows you to do arbitrary, rtf-style highlighting within plain text
files. Setting g:notesFileType = 'txtfmt' would allow you to highlight
your notes with underline, bold, italic, etc..., as well as a
configurable set of foreground and background colors. Since Txtfmt can
be nested within other syntaxes, you could even use a filetype such as
'mynote.txtfmt', where mynote provides the highlighting for the note
headers, and txtfmt permits arbitrary highlighting within the body.
(This is how I do it with my electronic journal.) It's an option to
keep in mind if defining your own syntax proves to be more work than
you had in mind.
Notes:
http://www.vim.org/scripts/script.php?script_id=2732
Txtfmt:
http://www.vim.org/scripts/script.php?script_id=2208
Hope it helps...
Brett Stahlman
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---