summaryrefslogtreecommitdiffstats
path: root/plugin/bepo.vim
blob: 3b5d53041f9c6091f5cb8a3fbb825c50af84ff89 (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
112
113
114
115
116
" bepo.vim - plugin vim pour disposition de clavier bépo
"
" vim: foldmethod=marker

if exists('g:loaded_bepo') || &compatible
	finish
else
	let g:loaded_bepo = 1
endif

" vim-surround {{{1
let g:surround_no_mappings = 1
nmap dè  <Plug>Dsurround
nmap lè  <Plug>Csurround
nmap yè  <Plug>Ysurround
nmap yÈ  <Plug>YSurround
nmap yèè <Plug>Yssurround
nmap yÈè <Plug>YSsurround
nmap yÈÈ <Plug>YSsurround
xmap È   <Plug>VSurround
xmap gÈ  <Plug>VgSurround

imap    <C-È> <Plug>Isurround
imap      <C-G>è <Plug>Isurround
imap      <C-G>È <Plug>ISurround

" Échange É et W{{{1
" ------------------

" On remappe W sur É :
noremap é w
noremap É W
" Corollaire: on remplace les text objects aw, aW, iw et iW
" pour effacer/remplacer un mot quand on n’est pas au début (daé / laé).
onoremap aé aw
onoremap aÉ aW
onoremap ié iw
onoremap iÉ iW

" Pour faciliter les manipulations de fenêtres, on utilise {W} comme un Ctrl+W :
noremap w <C-w>
noremap W <C-w><C-w>

" Échange [HJKL] -> {CTSR}{{{1
" ----------------------------

" {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 zt zj
noremap zs zk

" Échange {HJKL} <- [CTSR]{{{1
" ----------------------------

" {J} = « Jusqu'à »            (j = suivant, J = précédant)
noremap j t
noremap J T
" {L} = « Change »             (l = attend un mvt, L = jusqu'à la fin de ligne)
noremap l c
noremap L C
" {H} = « Remplace »           (h = un caractère slt, H = reste en « Remplace »)
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ésambiguïsation de {g}{{{1
" ---------------------------

" 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

" Chevrons <> en direct{{{1
" -------------------------
noremap « <
noremap » >

" Réaffecter la gestion des fenêtres{{{1
" --------------------------------------

" Directions
noremap wt <C-w>j
noremap ws <C-w>k
noremap wc <C-w>h
noremap wr <C-w>l

" Raccourcis pratiques sur ^W
noremap wd <C-w>c
noremap wo <C-w>s
noremap wp <C-w>o
noremap w<SPACE> :split<CR>
noremap w<CR> :vsplit<CR>