Browse Source

vimrc: pushed lingering changes

master
Alejandro Mery 15 years ago
parent
commit
42a7dcf064
6 changed files with 92 additions and 1 deletions
  1. +27
    -0
      .vim/c.vim
  2. +19
    -0
      .vim/lua.vim
  3. +3
    -0
      .vim/python.vim
  4. +3
    -0
      .vim/sh.vim
  5. +19
    -0
      .vim/xml.vim
  6. +21
    -1
      .vimrc

+ 27
- 0
.vim/c.vim

@ -0,0 +1,27 @@
set textwidth=95
set cinoptions=(0:0
" C99 keywords
syn keyword cType uint64_t uint32_t uint16_t uint8_t bool
syn keyword cType int64_t int32_t int16_t int8_t
" Linux keywords
syn keyword cType __u64 __u32 __u16 __u8
syn keyword cType u64 u32 u16 u8
syn keyword cOperator likely unlikely
" make invisible errors, very visible
"
" no trailing whitespacing, no spaces at the begging of the line.
" and no tabs after spaces.
syn match WrongWhitespace /\s\+$\|^ \+\| \+\t/
" no more than 7 spaces for aligning
"
" NOTE: aligning after `int ab(` would break this rule, as 6 or 7
" spaces would be needed without a previous tab. but two letters
" as a function name, please don't.
syn match WrongWhitespace /\t \{8,}/
"match WrongWhitespace / \+\ze\t/ " what is this?
highlight WrongWhitespace ctermbg=red guibg=red

+ 19
- 0
.vim/lua.vim

@ -0,0 +1,19 @@
set ts=4
set sw=4
" make invisible errors, very visible
"
" no trailing whitespacing, no spaces at the begging of the line.
" and no tabs after spaces.
syn match WrongWhitespace /\s\+$\|^ \+\| \+\t/
" no more than 7 spaces for aligning
"
" NOTE: aligning after `int ab(` would break this rule, as 6 or 7
" spaces would be needed without a previous tab. but two letters
" as a function name, please don't.
syn match WrongWhitespace /\t \{8,}/
"match WrongWhitespace / \+\ze\t/ " what is this?
highlight WrongWhitespace ctermbg=red guibg=red

+ 3
- 0
.vim/python.vim

@ -0,0 +1,3 @@
set expandtab
set tabstop=4
set shiftwidth=4

+ 3
- 0
.vim/sh.vim

@ -0,0 +1,3 @@
syn match WrongWhitespace /\s\+$\|^ \+\|\t \+\| \+\t/
highlight WrongWhitespace ctermbg=red guibg=red

+ 19
- 0
.vim/xml.vim

@ -0,0 +1,19 @@
set ts=4
set sw=4
" make invisible errors, very visible
"
" no trailing whitespacing, no spaces at the begging of the line.
" and no tabs after spaces.
syn match WrongWhitespace /\s\+$\|^ \+\| \+\t/
" no more than 7 spaces for aligning
"
" NOTE: aligning after `int ab(` would break this rule, as 6 or 7
" spaces would be needed without a previous tab. but two letters
" as a function name, please don't.
syn match WrongWhitespace /\t \{8,}/
"match WrongWhitespace / \+\ze\t/ " what is this?
highlight WrongWhitespace ctermbg=red guibg=red

+ 21
- 1
.vimrc

@ -1,16 +1,36 @@
set nocompatible
colorscheme koehler
set guifont=DejaVu\ Sans\ Mono\ 8
"set guifont=DejaVu\ Sans\ Mono\ 7
set guifont=Terminus\ 7
filetype indent on
syntax on
set nu!
set hlsearch
if has("autocmd")
" OpenSDE
autocmd BufEnter *.in,*.conf,parse-config* set filetype=sh
autocmd BufEnter *.h set filetype=c
autocmd filetype c source ~/.vim/c.vim
autocmd filetype sh source ~/.vim/sh.vim
autocmd filetype xml source ~/.vim/xml.vim
autocmd filetype lua source ~/.vim/lua.vim
" autocmd filetype python source ~/.vim/python.vim
endif
" , #perl # comments
map ,# :s/^/#/<CR>
" ,/ C/C++/C#/Java // comments
map ,/ :s/^/\/\//<CR>
" ,< HTML comment
map ,< :s/^\(.*\)$/<!-- \1 -->/<CR><Esc>:nohlsearch<CR>
" c++ java style comments
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR><Esc>:nohlsearch<CR>

Loading…
Cancel
Save