forked from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
138 lines (121 loc) · 3.25 KB
/
vimrc
File metadata and controls
138 lines (121 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
" general "
set nu
set hlsearch
set incsearch
set nocompatible
set nomodeline
set nobackup
set noswapfile
" code "
syntax on
let c_space_errors = 1
set completeopt=menu,preview
set shiftwidth=2
set foldnestmax=1
set foldmethod=syntax
set nofoldenable
if has("cscope")
set cscopequickfix=s-,c-,d-,i-,t-,e-
set cscopetag " Use cscope and ctags
set cscopetagorder=0 " Search cscope first
if filereadable("cscope.out")
cs add cscope.out
endif
endif
" plugin syntastic pour C++11
let g:syntastic_cpp_compiler_options = ' -std=c++11 -Wall -W -Wextra'
let g:syntastic_cpp_include_dirs = [ 'includes', 'include', '../include' ]
" espace insequable utf8
highlight BadSpace ctermbg=magenta guibg=magenta
match BadSpace / /
autocmd WinEnter * match BadSpace / /
" Interface "
set background=dark
set mouse=a
"set cul
if has("gui_running")
set guifont=DejaVu\ Sans\ Mono:h10
colorscheme koehler
set guioptions-=T
set guioptions-=m
endif
set ruler
" Autocmd "
filetype on
filetype plugin on
autocmd FileType c,cpp,hh,cc,hxx :set cindent
autocmd FileType yy,ll :set syntax=cpp
autocmd FileType mail :set tw=72
augroup filetypedetect
au BufNewFile,BufRead *.tex setlocal spell spelllang=fr
augroup end
augroup filetype " google protocol buffers
au! BufRead,BufNewFile *.proto setfiletype proto
augroup end
augroup filetypedetect
" Mail
autocmd BufRead,BufNewFile *mutt-* setfiletype mail
augroup END
function s:spell_fr()
if !exists("s:spell_check") || s:spell_check == 0
echo "Correction orthographique activée (français)"
let s:spell_check = 1
setlocal spell spelllang=fr
else
echo "Correction orthographique désactivée"
let s:spell_check = 0
setlocal spell spelllang=
endif
endfunction
" for English
function s:spell_en()
if !exists("s:spell_check") || s:spell_check == 0
echo "Correction orthographique activée (anglais)"
let s:spell_check = 1
setlocal spell spelllang=en
else
echo "Correction orthographique désactivée"
let s:spell_check = 0
setlocal spell spelllang=
endif
endfunction
" mapping français
noremap <F3> :call <SID>spell_fr()<CR>
inoremap <F3> <C-o>:call <SID>spell_fr()<CR>
vnoremap <F3> <C-o>:call <SID>spell_fr()<CR>
" mapping English
noremap <F4> :call <SID>spell_en()<CR>
inoremap <F4> <C-o>:call <SID>spell_en()<CR>
vnoremap <F4> <C-o>:call <SID>spell_en()<CR>
" http://nvie.com/posts/how-i-boosted-my-vim/
fun! s:ToggleMouse()
if !exists("s:old_mouse")
let s:old_mouse = "a"
endif
if &mouse == ""
let &mouse = s:old_mouse
echo "Mouse is for Vim (" . &mouse . ")"
else
let s:old_mouse = &mouse
let &mouse=""
echo "Mouse is for terminal"
endif
endfunction
noremap <F2> :call <SID>ToggleMouse()<CR>
inoremap <F2> <C-o>:call <SID>ToggleMouse()<CR>
vnoremap <F2> <C-o>:call <SID>ToggleMouse()<CR>
set pastetoggle=<F5>
noremap <F6> :match Ignore /\r$/<CR>
inoremap <F6> :match Ignore /\r$/<CR>
vnoremap <F6> :match Ignore /\r$/<CR>
" pathogen
runtime bundle/vim-pathogen/autoload/pathogen.vim
call pathogen#infect()
" title tmux
if &term == "screen"
set t_ts=k[
set t_fs=]\
endif
if &term == "screen" || &term == "xterm"
set title
endif