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

Re: vb syntax highlighting for vim

Expand Messages
  • Tim Chase
    ... If it s something she does frequently, you can make it even easier for her by either mapping it to a single keypress in your vimrc file: nnoremap :set
    Message 1 of 7 , Sep 2, 2005
      > For the time being I've got the user doing :set syntax=vb, and she is
      > happy. If it becomes something she has to use a lot, and it gets
      > cumbersome, then I'll pester you further.

      If it's something she does frequently, you can make it even
      easier for her by either mapping it to a single keypress in your
      vimrc file:

      nnoremap <f4> :set syntax=vb<cr>

      (all characters typed literally). That way, it's as simple as
      hitting <f4> (or whatever your key of choice is.

      Or, you can actually get vim to properly detect the file type.
      This is where I rely on the other smart folks on the list :) I
      never remember *where* to put the filetype detection. IIRC, it
      goes in something like ~/.vim/filetype.vim and would contain
      something along the lines of

      " other VB extensions...
      augroup filetypedetect
      au! BufRead,BufNewFile *.frm,*.bas setfiletype vb
      augroup END

      (at least according to the help: ":help new-filetype"). This
      should at least correctly set the file type for *.frm and *.bas
      files. If you're opening an empty buffer without a file name,
      Vim doesn't give it a filetype by default, so if you paste VB
      code into it, you'll have to set type filetype manually, as per
      the above mapping.

      > Thank you for your assistance in making such a fine tool work a little
      > bit better for us.

      Always glad to lend a hand.

      -tim
    • Hakim
      ... That s always annoyed me: having to edit a single monolithic file like that means that it s hard to automatically install a plugin to deal with a
      Message 2 of 7 , Sep 2, 2005
        Tim Chase wrote:

        > Or, you can actually get vim to properly detect the file type. This is
        > where I rely on the other smart folks on the list :) I never remember
        > *where* to put the filetype detection. IIRC, it goes in something
        > like ~/.vim/filetype.vim and would contain something along the lines of

        That's always annoyed me: having to edit a single monolithic file like
        that means that it's hard to automatically install a plugin to deal with
        a particular language or app. (So for example, the viki plugin - or
        some vim wiki plugin if not that one - has manual steps to edit
        filetype.vim).
        I *think* there's an option though to have multiple .vim files that do
        filetype checking, which could be cleaner, but dunno where this is
        documented. Any ideas?

        --
        osfameron
      • Tofer Chagnon
        ... Try :help new-filetype Tofer
        Message 3 of 7 , Sep 2, 2005
          On 9/2/05, Hakim <hakim@...> wrote:

          > I *think* there's an option though to have multiple .vim files that do
          > filetype checking, which could be cleaner, but dunno where this is
          > documented. Any ideas?
          >

          Try :help new-filetype

          Tofer
        Your message has been successfully submitted and would be delivered to recipients shortly.