2009年12月3日星期四

my .cshrc and vi configuration.

1, alias in .cshrc

alias setprompt 'set prompt="[`pwd`]"'
setprompt
alias cd 'chdir \!* && setprompt'

alias ll 'ls -l'
alias rm 'rm -i'
alias vii 'gvim'

2, .vimrc

" Added by Leon Liang.
"----------------------------------------------------------------
syntax on " turn on highlight
set hlsearch " highlight the searching word
set autoindent " always set autoindenting on
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set number
set wrap
set linebreak
set shiftwidth=4
set cmdheight=2
colo torte

"set expandtab "expand tab to n*blank
set tabstop=3
set expandtab

" or,
"autocmd FileType vera set tabstop=4
"autocmd FileType vera set expandtab
"autocmd FileType verilog set tabstop=4
"autocmd FileType verilog set expandtab
"autocmd FileType verilog_systemverilog set tabstop=4
"autocmd FileType verilog_systemverilog set expandtab

function FileHeading_perl()
let s:line=line(".")
call setline( s:line,"#############################################################################"
call append( s:line,"# File name: ")
call append(s:line+1,"# Author: Leon Liang")
call append(s:line+2,"# Date: ".strftime("%b %d %Y %H:%M:%S"))
call append(s:line+3,"# Description: ")
call append(s:line+4,"# ")
call append(s:line+5,"#############################################################################"
unlet s:line
endfunction

:autocmd BufNewFile *.pl execute FileHeading_perl()
iabbr fhpl :execute FileHeading_perl()

autocmd FileType verilog_systemverilog iabbr begin begin//{
autocmd FileType verilog_systemverilog iabbr end end//}


3, add following lines to .vim/filetype.vim for file type detection.

" Verilog HDL
au BufNewFile,BufRead *.v *.vh setf verilog

" SystemVerilog HDL "Added by Leon Liang.
au BufNewFile,BufRead *.sv,*.svh setf sverilog

"Note: download sverilog.vim from internet and put it in .vim/syntax/

没有评论:

发表评论