Skip to content

Commit 5b8bc21

Browse files
committed
Initial import
0 parents  commit 5b8bc21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+25912
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tags/cpp_src

.netrwhist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let g:netrw_dirhistmax =10
2+
let g:netrw_dirhist_cnt =0

.vimrc

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
"
2+
" _ _(_)_ __ ___ _ __ ___
3+
" / \ / / | '_ ` _ \| '__/ __|
4+
" \ V /| | | | | | | | | (__
5+
" \_/ |_|_| |_| |_|_| \___|
6+
"
7+
"
8+
" Paul ADENOT -- 2011
9+
10+
11+
set ch=2
12+
let c_comment_strings=1
13+
" Enable syntax highlighting
14+
syntax on
15+
" Highlight matched pattern when searching or replacing.
16+
set hlsearch
17+
" Show the line numbers.
18+
set number
19+
" Automatic indentation for C-like languages.
20+
set cindent
21+
" Write (=save) the file whenever it is compiled or when
22+
" the user changes files in a buffer.
23+
set autowrite
24+
" Automatic comments
25+
set formatoptions=tco
26+
set textwidth=80
27+
28+
" Incremental search : search befor return is typed
29+
set incsearch
30+
" Set the EOL format
31+
set fileformats=unix,dos
32+
" Tilda is set as an operator
33+
set tildeop
34+
" Search wrap around the entire file.
35+
set wrapscan
36+
" Wrap words, and break then between words only.
37+
set linebreak
38+
" Match pairs of symbols
39+
set matchpairs+=<:>":"`:`
40+
" Size of tabulatons
41+
set shiftwidth=2
42+
set softtabstop=2
43+
set tabstop=2
44+
set expandtab
45+
" Color scheme.
46+
color slate
47+
" Font in GUI mode.
48+
"set guifont=Monospace\ 8
49+
set guifont=Droid\ Sans\ Mono\ 8
50+
set guioptions=nomenu
51+
" Remove bottom scrolling bar.
52+
set guioptions-=b
53+
" Set the background of the line where the cursor is to grey.
54+
" set cursorline
55+
" Copy visual area to paste buffer
56+
set go+=a
57+
" Press F4 to turn off highlighting and clear any message already displayed.
58+
:noremap <silent> <F4> :silent noh<Bar>echo<CR>
59+
" Set the dictionnary to french
60+
set dictionary+="/usr/share/dict/french"
61+
62+
filetype indent on
63+
64+
" Enable spelling check on .tex and .latex files.
65+
augroup filetypedetect
66+
au BufNewFile,BufRead *.latex setlocal spell spelllang=fr
67+
au BufNewFile,BufRead *.tex setlocal spell spelllang=fr
68+
au BufNewFile,BufRead *.rst set syntax=rest
69+
au BufNewFile,BufRead *.rst setlocal spell spelllang=fr
70+
augroup END
71+
72+
" Set the GUI Size
73+
au GUIEnter * set lines=53 columns=84
74+
" Set the Doxygen style comments, to ease the writing of documentation
75+
set comments=s1:/**,mb:*,ex:*/
76+
77+
set nocp
78+
filetype plugin on
79+
80+
" configure tags - add additional tags here or comment out not-used ones
81+
set tags+=~/.vim/tags/cpp
82+
set tags+=~/.vim/tags/sqlite3
83+
" build tags of your own project with Ctrl-F12
84+
map <C-F12> :!ctags -R --sort=yes --c++-kinds=+lp --fields=+iaS --extra=+q .<CR>
85+
86+
87+
" OmniCppComplete
88+
let OmniCpp_NamespaceSearch = 1
89+
let OmniCpp_GlobalScopeSearch = 1
90+
let OmniCpp_ShowAccess = 1
91+
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
92+
let OmniCpp_MayCompleteDot = 1 " autocomplete after .
93+
let OmniCpp_MayCompleteArrow = 1 " autocomplete after ->
94+
let OmniCpp_MayCompleteScope = 1 " autocomplete after ::
95+
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
96+
" automatically open and close the popup menu / preview window
97+
au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
98+
set completeopt=menuone,menu,longest,preview
99+
100+
autocmd FileType python set omnifunc=pythoncomplete#Complete
101+
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
102+
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
103+
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
104+
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
105+
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
106+
autocmd FileType c set omnifunc=ccomplete#Complete
107+
108+
autocmd FileType * IndentGuidesEnable
109+
110+
let mapleader = ","
111+
112+
if exists(":Tabularize")
113+
nmap <Leader>a= :Tabularize /=<CR>
114+
vmap <Leader>a= :Tabularize /=<CR>
115+
vmap <Leader>z| :Tabularize /|<CR>
116+
vmap <Leader>z| :Tabularize /|<CR>
117+
endif
118+
119+
let g:indent_guides_auto_colors = 1
120+
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#222222
121+
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#333333
122+
123+
let g:indent_guides_guide_size = 2

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Paul's .vim direcotory
2+
3+
This is my ViM configuration, containing all my plugins, and my .vimrc file.

after/ftplugin/c.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
" OmniCppComplete initialization
2+
call omni#cpp#complete#Init()

after/ftplugin/cpp.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
" OmniCppComplete initialization
2+
call omni#cpp#complete#Init()

after/plugin/TabularMaps.vim

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
if !exists(':Tabularize')
2+
finish " Tabular.vim wasn't loaded
3+
endif
4+
5+
let s:save_cpo = &cpo
6+
set cpo&vim
7+
8+
AddTabularPattern! assignment /[|&+*/%<>=!~-]\@<!\([<>!=]=\|=\~\)\@![|&+*/%<>=!~-]*=/l1r1
9+
AddTabularPattern! two_spaces / /l0
10+
11+
AddTabularPipeline! multiple_spaces / / map(a:lines, "substitute(v:val, ' *', ' ', 'g')") | tabular#TabularizeStrings(a:lines, ' ', 'l0')
12+
13+
AddTabularPipeline! argument_list /(.*)/ map(a:lines, 'substitute(v:val, ''\s*\([(,)]\)\s*'', ''\1'', ''g'')')
14+
\ | tabular#TabularizeStrings(a:lines, '[(,)]', 'l0')
15+
\ | map(a:lines, 'substitute(v:val, ''\(\s*\),'', '',\1 '', "g")')
16+
\ | map(a:lines, 'substitute(v:val, ''\s*)'', ")", "g")')
17+
18+
function! SplitCDeclarations(lines)
19+
let rv = []
20+
for line in a:lines
21+
" split the line into declaractions
22+
let split = split(line, '\s*[,;]\s*')
23+
" separate the type from the first declaration
24+
let type = substitute(split[0], '\%(\%([&*]\s*\)*\)\=\k\+$', '', '')
25+
" add the ; back on every declaration
26+
call map(split, 'v:val . ";"')
27+
" add the first element to the return as-is, and remove it from the list
28+
let rv += [ remove(split, 0) ]
29+
" transform the other elements by adding the type on at the beginning
30+
call map(split, 'type . v:val')
31+
" and add them all to the return
32+
let rv += split
33+
endfor
34+
return rv
35+
endfunction
36+
37+
AddTabularPipeline! split_declarations /,.*;/ SplitCDeclarations(a:lines)
38+
39+
AddTabularPattern! ternary_operator /^.\{-}\zs?\|:/l1
40+
41+
AddTabularPattern! cpp_io /<<\|>>/l1
42+
43+
AddTabularPattern! pascal_assign /:=/l1
44+
45+
AddTabularPattern! trailing_c_comments /\/\*\|\*\/\|\/\//l1
46+
47+
let &cpo = s:save_cpo
48+
unlet s:save_cpo

0 commit comments

Comments
 (0)