Loading ...
Sorry, an error occurred while loading the content.

editing NoteTab's *.otl files in vim or gvim

Expand Messages
  • rpdooling
    For vim (or gvim) users who move between Linux and Windows and want to be able to exploit NoteTab s outline features in either place. Or for NoteTab users who
    Message 1 of 1 , Jul 8, 2006
    • 0 Attachment
      For vim (or gvim) users who move between Linux and Windows and want to
      be able to exploit NoteTab's outline features in either place. Or for
      NoteTab users who want to play with gvim and customizable color syntax
      highlighting.

      Vim is easily configured to "fold" NoteTab's .otl sections into outlines.

      Vim or "vi improved" is a popular text editor that runs on Linux and
      Windows and virtually every other platform in the world (the gui
      version is called gvim). It has a steep learning curve, but can
      basically be configured to do anything, including handle .otl files.

      Vim configures its filetype options in a file called: filetype.vim

      (1) Add these two auto commands somewhere in filetype.vim, or just add
      the second line if you already have an augroup named filetypedetect:

      augroup filetypedetect
      autocmd! BufRead,BufNewFile *.otl setfiletype otl

      The second line tells vim or gvim to look in its ftplugin directory
      for a file called otl.vim, which will tell vim how to handle *.otl files.

      (2) Create the otl.vim file in your ftplugin directory. You can tell
      it to wrap wherever, set fonts, syntax coloring, any features you
      want, but somewhere include these two lines:

      setlocal foldmethod=expr
      setlocal foldexpr=getline(v:lnum)!~\"H=\"

      These two lines tell vim to use a regex to determine where it folds
      its outlines and that expression is H= (or any other regex you'd care
      to use).

      Since NoteTab's .otl files have headings that look like this:
      H="blah blah heading" vim now knows to fold all text in between.

      Your headings remain intact with all text between them "folded" out of
      sight until you wish to open and edit them.

      rd
      http://dooling.com
    Your message has been successfully submitted and would be delivered to recipients shortly.