" Language: Verilog HDL
" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
" Last Change: Mon Sep 5 11:05:54 CST 2005 and 2006 April 30
" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
" Undo the plugin effect
let b:undo_ftplugin = "setlocal fo< com< tw<"
\ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croqlm1
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
" Format comments to be up to 78 characters long
if &textwidth == 0
setlocal tw=78
endif
set cpo-=C
" Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
\ "All Files (*.*)\t*.*\n"
endif
"/***********************************************************/
"/* This code was tweaked by me to account for `ifndef ! */
"/* Wed Oct 27 13:18:16 PDT 2004 */
"/***********************************************************/
"
" Let the matchit plugin know what items can be matched.
if exists("loaded_matchit")
let b:match_ignorecase=0
let b:match_words=
\ '\<begin\>:\<end\>,' .
\ '\<case\>\|\<casex\>\|\<casez\>:\<endcase\>,' .
\ '\<module\>:\<endmodule\>,' .
\ '\<if\>:\<else\>,' .
\ '\<function\>:\<endfunction\>,' .
\ '`ifdef\>:`else\>:`endif\>,' .
\ '`ifndef\>:`else\>:`endif\>,' .
\ '\<task\>:\<endtask\>,' .
\ '\<specify\>:\<endspecify\>'
endif
Hi,
On Tue, Oct 19, 2010 at 08:24 PM PDT, googler wrote:
g> I am trying to use (g)vim to edit verilog files. I see proper syntax
g> highlighting, but keyword matching (for example, 'begin' is supposed
g> to match with 'end') is not working.
I have attached a file (verilog.vim) that you can place in
~/.vim/ftplugin/verilog and it should do what you need.
Regards,
--
Mun
g> I read up some of the earlier
g> posts in this group regarding usage of vim for verilog, but can't seem
g> to find the solution. Can someone please help me get vim working for
g> verilog files? I am using vim version 7.2. I do see the file
g> verilog.vim in ftplugin directory. This is what my .vimrc file looks
g> like.
g>
g> set nocompatible
g> filetype indent plugin on
g> syntax on
g> set hidden
g> set wildmenu
g> set showcmd
g> set hlsearch
g> set ignorecase
g> set smartcase
g> set backspace=indent,eol,start
g> set autoindent
g> set nostartofline
g> set ruler
g> set laststatus=2
g> set confirm
g> set visualbell
g> set t_vb=
g> set mouse=a
g> set cmdheight=2
g> set number
g> set notimeout ttimeout ttimeoutlen=200
g> set pastetoggle=<F11>
g> set shiftwidth=2
g> set softtabstop=2
g> set expandtab
g> map Y y$
g> nnoremap <C-L> :nohl<CR><C-L>
g>
g>
g> Also, from a more general standpoint, when we are trying to use a new
g> filetype/language in vim (like verilog), what are the different
g> features/plugins that we need to make sure are available? For example,
g> it should have syntax highlighting, keyword matching, etc.. and what
g> else? And where are the plugins for these features usually located?
g>
g> Thanks!
g>
g> --
g> You received this message from the "vim_use" maillist.
g> Do not top-post! Type your reply below the text you are replying to.
g> For more information, visit http://www.vim.org/maillist.php
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment