Invalid Article

Turn on syntax highlighting for editing .thtml files in Vim

This article is also available in the following languages:
By dvoita
If you use Vim to edit your Views, here's how to turn on syntax highlighting.
If you use VIm as your text editor like I do, you probably find the syntax highlighting helpful. Unfortunately, files ending in *.thtml aren't recognized by Vim. Here's how to fix that:

(Examples are for Unix)

1. Create a user runtime directory:

mkdir ~/.vim

2. Create the following file:

vi ~/.vim/filetype.vim

It should contain:

" my filetype file
    if exists("did_load_filetypes")
      finish
    endif
    augroup filetypedetect
      au! BufRead,BufNewFile *.thtml     setfiletype html
    augroup END

3. Restart Vim, if need be.

This should make editing your Views with Vim a little easier.

Sources:

http://www.vim.org/htmldoc/filetype.html

Comments

  • Posted 12/31/06 11:46:43 PM
    I found this on the internet:

    Open
    c:\Program Files\Macromedia\Dreamweaver MX\Configuration\DocumentTypes\MMDocumentTypes.xml
    Look for winfileextension="php,php3" ܡםr^t񍽑屔􉍽而)ѕͥ̈(𽍽 if you're on a mac and simply add "thtml" (or "ctp" for 1.2) to the list so you have:

    winfileextension="php,php3,thtml" or
    macfileextension="php,php3,thtml"
    Save it, and restart Dreamweaver and you should be good to go.

    Hope this helps someone.

    Source:
    http://www.phpbuilder.com/board/archive/index.php/t-10224922.html
    • Posted 04/23/07 02:15:23 AM
      Look for winfileextension="php,php3" or macfileextension="php,php3" if you're on a mac and simply add inc to the list so you have:

      winfileextension="php,php3,inc"
      I'm sure you meant "thtml" (or "ctp" for 1.2) instead of "inc" :D
  • Posted 11/17/06 08:11:21 PM
    Just put this line in your ~/.vimrc file:

    au BufNewFile,BufRead *.thtml setfiletype php

    (I prefer php synax rather than just html)

Comments are closed for articles over a year old