pacman db update
[cinan.git] / .vimrc
blob65180534b28223d1330a61326e413fc6f0bceb8c
1 if v:progname =~? "evim"
2   finish
3 endif
5 set nocompatible
7 set backspace=indent,eol,start
9 map Q gq
11 " so that you can undo CTRL-U after inserting a line break.
12 inoremap <C-U> <C-G>u<C-U>
14 "if has("gui_running")
15 "    colo darkspectrum
16 "else
17     colo mustang
18 "endif
19 if &t_Co > 2 || has("gui_running")
20   syntax on
21   set hlsearch
22 endif
24 if has("autocmd")
26   filetype plugin indent on
27   filetype plugin on 
28   augroup vimrcEx
29   au!
31   autocmd FileType text setlocal textwidth=78
33   autocmd BufReadPost *
34     \ if line("'\"") > 1 && line("'\"") <= line("$") |
35     \   exe "normal! g`\"" |
36     \ endif
38   augroup END
40 else
42   set autoindent                " always set autoindenting on
44 endif " has("autocmd")
46 if !exists(":DiffOrig")
47   command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
48                   \ | wincmd p | diffthis
49 endif
51 set showmatch
52 set incsearch
53 set number
54 set history=100
55 set ruler
56 set showcmd
57 set hlsearch
58 set smartindent
59 set smarttab
60 set smartcase
61 set expandtab
62 set wildmenu
63 set ignorecase
64 set shiftwidth=4
65 set nowrap
66 set showmode
67 set cursorline
68 set background=dark
69 set nojoinspaces
70 set mouse=r
71 "set paste
72 nnoremap <F12> :TlistToggle<CR>
73 "fix backspace
74 nmap \x7f hx
75 "nmap a i
76 "F2 = save file
77 map <F2> :w\r
78 "autocmd BufRead *.rb set foldmethod=syntax
79 "autocmd BufRead *.rb set foldcolumn=5
80 vmap <C-y> y:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR>
81 nmap <C-y> yw:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR>
82 nmap <C-v> :call setreg("\"",system("xclip -o -selection clipboard"))<CR>p
84 au BufRead /tmp/mutt* set tw=72
85 au BufRead /tmp/mutt* :normal G?--
86 au BufRead /tmp/mutt* :normal k
88 "F5 = run program
89 autocmd BufRead *.rb map <F5> :!clear; ruby % \r
90 au BufNewFile,BufRead *.srt setf srt
91 syntax on
92 if has("autocmd")
93   filetype indent on
94 endif
96 augroup templates
97   au!
98   " read in template files
99   autocmd BufNewFile *.* silent! execute '0r /home/cinan/.vim/templates/skeleton.'.expand("<afile>:e")
100   " autocmd BufNewFile * %substitute#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge
101   autocmd BufNewFile *.cs %substitute#\[:VIM_EVAL:\]FILENAME\[:END_EVAL:\]#\=expand("%:r")#ge
102 augroup END