summaryrefslogtreecommitdiff
path: root/plugin/perso.vim
blob: fbfd8c4dcb09ca8ebbb4e1fa4285002059edbfc2 (plain)
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
set showcmd

set backspace=indent,eol,start

set clipboard=unnamed
set ruler
set t_Co=256
"map <leader>j <C-W>j
"map <leader>k <C-W>k
"map <leader>h <C-W>h
"map <leader>l <C-W>l




set encoding=utf-8
set fileencoding=utf-8


hi CursorLine term=bold cterm=bold ctermbg=black




filetype plugin indent on


nnoremap <silent><A-o> :set paste<CR>m`o<Esc>``:set nopaste<CR>
nnoremap <silent><A-O> :set paste<CR>m`O<Esc>``:set nopaste<CR>


inoremap <c-e> <Esc>A
inoremap <c-a> <Esc>0i


"inoremap {<CR> {<CR>}<up><C-o>$
"inoremap {{ {
"inoremap {} {}
"inoremap << <><left>
"inoremap [ []<left>
"inoremap [[ [
"inoremap [] []
"inoremap ( ()<left>
"inoremap (( (
"inoremap () ()
"inoremap " ""<left>
"inoremap "" ""
"inoremap ' ''<left>
"inoremap '' ''

"Perso C définition"
inoremap prt printf
inoremap swf printf
inoremap #in< #include <><left>
inoremap #in" #include ""<left>
inoremap #def #define 
inoremap #un #undef
inoremap #ifn #ifndef 
inoremap #ifd #ifdef 
inoremap #std #include <stdlib.h>
inoremap #io  #include <stdio.h>

inoremap #main int main(void) {<CR>}<Esc><Up>A
inoremap ##main int main(int argc, char* argv[]) {<CR>}<Esc><Up>A





" Personal shortcurts

" Copy clip
nnoremap <silent>èè__    :set paste<CR>mn"+p'n:set nopaste<CR>
" Select clip
nnoremap <silent>èèè_    :set paste<CR>mn"*p'n:set nopaste<CR>
nmap <C-X> :TagbarToggle<CR>

ca tn tabnew
ca tc tabc




"Allow vim clipboad <-> host clipboard to share data
set clipboard=unnamed


" Quick Comment :
autocmd FileType c,cpp,java,scala let b:comment_leader = '//'
autocmd FileType sh,ruby,python   let b:comment_leader = '#'
autocmd FileType conf,fstab       let b:comment_leader = '#'
autocmd FileType tex              let b:comment_leader = '%'
autocmd FileType mail             let b:comment_leader = '>'
autocmd FileType vim              let b:comment_leader = '"'

noremap <silent> ,cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> ,cu :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>


noremap <silent> <c-c><c-c>  :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> <c-c>c      :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>

nnoremap cd :cd %:p:h<CR>

:map <F5> :setlocal spell! spelllang=fr<CR>
:map <F6> :setlocal spell! spelllang=en_us<CR>
:map <F9> :make<CR>


noremap <silent> zv :!markdown % \| w3m -I utf-8 -T text/html