vimrc
" Vim
" An example for a vimrc file.
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
set nocompatible " Use Vim defaults (much better!)
set bs=1 " allow backspacing over everything in insert mode
map _ :so $VIM/vim58/syntax/
map - :%!iso2ascii.pl
"set si " always set autoindenting on
set tw=78 " always limit the width of text to 78
" set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
" Añadido:
let myfiletypefile = "~/.myfiletypes.vim"
let myscriptsfile = "~/.myscripts.vim"
syntax on
" Añadido:
" Para el coñazo de los comentarios con "#"
set cinkeys=0{,0},:,0#,!^F,o,O,e
set wildmenu
set wildignore=*.o
" Para encontrar los principios de preguntas y exclamaciones
set matchpairs+=¿:?,¡:!
" Tipo de letra para el gvim
set guifont=-b&h-lucidatypewriter-medium-r-normal-*-*-120-*-*-m-*-iso8859-1
" Búsqueda incremental (nuevo en vim-5.7)
set incsearch
" Don't use Ex mode, use Q for formatting
" map Q gq
augroup cprog
" Remove all cprog autocommands
au!
" When starting to edit a file:
" For *.c and *.h files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd BufEnter * set formatoptions=tcql nocindent comments&
" autocmd BufEnter *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
autocmd BufEnter *.{c,cc,h,l,ll,y,java,m} so ~/.vimrc.c
autocmd BufEnter *.p{l,m} set formatoptions=crql ai si sm cin cinkeys-=0# shiftwidth=3 sts=3 et
autocmd BufEnter *.lsp set sm ai lisp
autocmd BufEnter *.htm*,*.content,*.news,*.p{html,hp,hp3},*.ej so ~/.vimrc.html
autocmd BufEnter *.sgm{,l} so ~/.vimrc.sgml
autocmd BufLeave *.{sg,ht}m*,*.content,*.news,*.p{html,hp,hp3},*.ej so ~/.vimrc.nohtml
autocmd BufEnter *.in so ~/.vimrc.html
autocmd BufLeave *.in so ~/.vimrc.nohtml
autocmd BufEnter *.adb set cinwords-=begin cinwords+=begin ai si sm sw=4 ts=4 formatoptions=crq comments=:--
autocmd BufEnter *.tex set sm
autocmd BufLeave *.tex set nosm
autocmd BufEnter *.latte set sm ai
autocmd BufLeave *.latte set nosm ai
" autocmd Syntax mason so $VIM/vim58/syntax/mason.vim
augroup END
augroup gzip
" Remove all gzip autocommands
au!
" Enable editing of gzipped files
" read: set binary mode before reading the file
" uncompress text in buffer after reading
" write: compress file after writing
" append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre *.gz set bin
autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
autocmd BufReadPost,FileReadPost *.gz set nobin
autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
autocmd FileAppendPre *.gz !gunzip <afile>
autocmd FileAppendPre *.gz !mv <afile>:r <afile>
autocmd FileAppendPost *.gz !mv <afile> <afile>:r
autocmd FileAppendPost *.gz !gzip <afile>:r
augroup END
vimrc.c
set formatoptions=crq smartindent cindent showmatch comments=sr:/*,mb:*,el:*/,:// shiftwidth=3 sts=3 tabstop=3 et
vimrc.html
map - !ejhtml.pl
map _ :%s/<font color="\(#......\)">\([^<]\+\)<\/font><font color="\1">/<font color="\1">\2/g
_
map! _gp_ <!-- _GP_ -->F_a
map! _gloss_ <!-- _GP_ <%%> -->F%i
map! _content_ <!-- _GP_ content("") -->F"i
map! terminal <code><b></b></code>bbbba
map! ahref <a href=""></a>F"i
map! ttype <tt></tt>F>a
map! <tabla> <table bgcolor=#BBBBFF width=100%><tr><td>
</td></tr></table>O
map! á á
map! é é
map! í í
map! ó ó
map! ú ú
map! ü ü
map! ñ ñ
map! Á Á
map! É É
map! Í Í
map! Ó Ó
map! Ú Ú
map! Ü Ü
map! Ñ Ñ
map! ¡ ¡
map! ¿ ¿
map! << «
map! >> »
set matchpairs-=<:>
set matchpairs+=<:>
set ai sw=2 softtabstop=2 ht=2
vimrc.nohtml
unmap -
unmap! _gp_
unmap! _gloss_
unmap! _content_
unmap! terminal
unmap! ahref
unmap! ttype
unmap! <tabla>
unmap! <>
unmap! á
unmap! é
unmap! í
unmap! ó
unmap! ú
unmap! ü
unmap! ñ
unmap! Á
unmap! É
unmap! Í
unmap! Ó
unmap! Ú
unmap! Ü
unmap! Ñ
unmap! ¡
unmap! ¿
unmap! <<
unmap! >>
vimrc.sgml
so $VIM/vim58/syntax/sgml.vim
map - :!make `basename % .sgml`.dvi
map! <url> <url url="" name="">F";;i
map! <> <Esc>F<yf>f>pF<a/<Esc>F>a
set matchpairs-=<:>
set matchpairs+=<:>
set ai sw=2 softtabstop=2 ht=2