From 9d20254e669914763739effaf07874469f1e7fbe Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 8 Jul 2011 14:57:16 +0200 Subject: [PATCH] [vim] add .bin and .iris filetype. .bin a read in hexa. .iris file are set to filetype=python .python file are set to filetype=python Use smarttab and smartindent --- .vimrc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index fc6cd32..0cd649f 100644 --- a/.vimrc +++ b/.vimrc @@ -96,8 +96,8 @@ highlight SpaceError ctermfg=235 cterm=reverse " INDENTATION " """"""""""""""" " use tabs at the start of a line, spaces elsewhere -" set smarttab -" set smartindent +set smarttab +set smartindent set autoindent " tab=4 set tabstop=4 @@ -118,12 +118,28 @@ if has("autocmd") autocmd BufRead,BufNewFile *.py set shiftwidth=4 autocmd BufRead,BufNewFile *.py set softtabstop=4 autocmd BufRead,BufNewFile *.py set modeline - + autocmd BufRead,BufNewFile *.py set ft=python endif +if has("autocmd") + autocmd BufRead,BufNewFile *.iris set ft=python +endif + +" vim -b : edit binary using xxd-format! +augroup Binary + au! + au BufReadPre *.bin let &bin=1 + au BufReadPost *.bin if &bin | %!xxd + au BufReadPost *.bin set ft=xxd | endif + au BufWritePre *.bin if &bin | %!xxd -r + au BufWritePre *.bin endif + au BufWritePost *.bin if &bin | %!xxd + au BufWritePost *.bin set nomod | endif +augroup END + if has("autocmd") " enable file type detection and do language-dependent indenting - " filetype plugin indent on + filetype indent on " detect indentation see http://www.freehackers.org/Indent_Finder autocmd BufReadPost * execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output "' . expand('%') . '"' ) @@ -137,10 +153,12 @@ else " indent-expr "set indentexpr "" endif - """""""""" " SEARCH " """""""""" + +set csprg=/home/mmaret/local/bin/cscope + " highlight search set hlsearch " unhighlight current search