summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2008-09-02 16:17:33 +0200
committerHugues Hiegel <hugues@hiegel.fr>2008-09-02 16:17:33 +0200
commit4dd682468bc3b5d2375637e082fb4f195f158c04 (patch)
tree3126eefb8c68b953940424931e4ead277e474cea
parente5be81ab60c0de287a083b8f7df4bec23ec99197 (diff)
Vim prêt pour le bépo !
-rw-r--r--bépo102
-rw-r--r--vimrc17
2 files changed, 113 insertions, 6 deletions
diff --git a/bépo b/bépo
new file mode 100644
index 0000000..394f199
--- /dev/null
+++ b/bépo
@@ -0,0 +1,102 @@
+" {W} -> [É]
+" ——————————
+" On remappe W sur É :
+noremap é w
+noremap É W
+" Corollaire, pour effacer/remplacer un mot quand on n’est pas au début (daé
+ " / laé).
+" (attention, cela diminue la réactivité du {A}…)
+noremap aé aw
+noremap aÉ aW
+" Pour faciliter les manipulations de fenêtres, on utilise {W} comme un Ctrl+W :
+noremap w <C-w>
+noremap W <C-w><C-w>
+
+" [HJKL] -> {CTSR}
+" ————————————————
+" {cr} = « gauche / droite »
+noremap c h
+noremap r l
+" {ts} = « haut / bas »
+noremap t j
+noremap s k
+" {CR} = « haut / bas de l'écran »
+noremap C H
+noremap R L
+" {TS} = « joindre / aide »
+noremap T J
+noremap S K
+" Corollaire : repli suivant / précédent
+noremap zs zj
+noremap zt zk
+
+" {HJKL} <- [CTSR]
+" ————————————————
+" {J} = « Jusqu'à » (j = suivant, J = précédant)
+noremap j t
+noremap J T
+" {L} = « Change » (h = bloc, H = jusqu'à la fin de ligne)
+noremap l c
+noremap L C
+" {H} = « Remplace » (l = caractère, L = texte)
+noremap h r
+noremap H R
+" {K} = « Substitue » (k = caractère, K = ligne)
+noremap k s
+noremap K S
+" Corollaire : correction orthographique
+noremap ]k ]s
+noremap [k [s
+
+" Désambiguation de {g}
+" —————————————————————
+" ligne écran précédente / suivante (à l'intérieur d'une phrase)
+noremap gs gk
+noremap gt gj
+" onglet précédant / suivant
+noremap gb gT
+noremap gé gt
+" optionnel : {gB} / {gÉ} pour aller au premier / dernier onglet
+noremap gB :exe "silent! tabfirst"<CR>
+noremap gÉ :exe "silent! tablast"<CR>
+" optionnel : {g"} pour aller au début de la ligne écran
+noremap g" g0
+
+" <> en direct
+" ————————————
+noremap « <
+
+" Chiffres en accès direct
+" ————————————————————————
+noremap " 1
+noremap 1 "
+noremap « 2
+noremap 2 <
+noremap » 3
+noremap 3 >
+noremap ( 4
+noremap 4 (
+noremap ) 5
+noremap 5 )
+noremap @ 6
+noremap 6 @
+noremap + 7
+noremap 7 +
+noremap - 8
+noremap 8 -
+noremap / 9
+noremap 9 /
+noremap * 0
+noremap 0 *
+
+" colorise les nbsp
+highlight NbSp ctermbg=lightgray guibg=lightred
+match NbSp /\%xa0/
+
+" Tab fait un Esc, Maj+Tab fait un Tab
+inoremap <Tab> <Esc>
+inoremap <S-Tab> <Tab>
+" Même chose, mais en mode visuel
+vnoremap <Tab> <Esc>
+vnoremap <S-Tab> <Tab>
+
diff --git a/vimrc b/vimrc
index b4ef3ab..ab31424 100644
--- a/vimrc
+++ b/vimrc
@@ -7,7 +7,6 @@ set bkc=no
"Set improve Backspace
set bs=2
-
"Show the current edition mode on last line, number of column and line
set showmode
set ruler
@@ -23,6 +22,8 @@ set ch=1
" Highlight search strings
set hlsearch
+" Incremental search
+set incsearch
" Hide mouse when typing
set mousehide
@@ -41,12 +42,17 @@ imap <F10> <Esc>:cn<CR>i
" set default error format
"set efm=\"%f\"\\,\ line\ %l:\ error\ %m,\"%f\"\\,\ line\ %l:\ warning\ %m
+" remaps C-j & C-k to C-y and C-e
+noremap <C-j> <C-y>
+noremap <C-k> <C-e>
+
"Macros
-map <F2> :Printcheader
-map <F3> :Printfheader
-map <F4> :Printhheader
+map <F2> :source ~/.vim/bépo
+"map <F2> :Printcheader
+"map <F3> :Printfheader
+"map <F4> :Printhheader
map <F5> ^i/* <C-[>$a */<C-[>
-map <F6> ^3x$2h3x
+map <F6> ^./\/\* <C-[>3x^./ \*\/<C-[>3x
" folding
map <F8> :SwitchFoldState<CR>
@@ -94,7 +100,6 @@ set noexpandtab
map U yyp:s/[^ ]/-/g<CR>:noh<CR>
map <ESC>Q v/$\n\n<CR>J:.!fmt -tcw78<CR>:noh<CR>
-map <ESC>A :!aspell -c %<CR>:e %<CR>
" Function
" Erase_Sig_but_Your()