" vim-bepo - Plugin vim pour disposition de clavier bépo " Maintainer: Micha Moskovic if exists('g:loaded_bepo') || &compatible finish else let g:loaded_bepo = 1 endif "s:tomap is for text-objects function! s:tomap(key, target) abort if maparg(a:key, 'o') ==# '' execute "onoremap" a:key a:target endif if maparg(a:key, 'x') ==# '' execute "xnoremap" a:key a:target endif endfunction "s:amap is for the rest function! s:amap(key, target) abort if maparg(a:key, 'n') ==# '' execute "nnoremap" a:key a:target endif call s:tomap(a:key, a:target) endfunction call s:amap( 'c', 'h' ) "on préserve {hjkl} pour les directions call s:amap( 't', 'j' ) "on préserve {hjkl} pour les directions call s:amap( 's', 'k' ) "on préserve {hjkl} pour les directions call s:amap( 'r', 'l' ) "on préserve {hjkl} pour les directions call s:amap( 'C', 'H' ) "{HJKL} devient [CTSR] call s:amap( 'T', 'J' ) "{HJKL} devient [CTSR] call s:amap( 'S', 'K' ) "{HJKL} devient [CTSR] call s:amap( 'R', 'L' ) "{HJKL} devient [CTSR] call s:amap( 'gt', 'gj' ) "on préserve les variantes avec 'g' call s:amap( 'gs', 'gk' ) "on préserve les variantes avec 'g' call s:amap( 'zt', 'zj' ) "on préserve les variantes avec 'z' call s:amap( 'zs', 'zk' ) "on préserve les variantes avec 'z' call s:amap( 'h', 't' ) "{t} devient [h] pour être proche de [f] call s:amap( 'H', 'T' ) "idem pour {T} et [H] call s:amap( 'l', 'c' ) "{c} devient [l] call s:amap( 'L', 'C' ) "{C} devient [L] call s:amap( 'j', 'r' ) "{j} devient [r] call s:amap( 'J', 'R' ) "{J} devient [R] call s:amap( 'k', 's' ) "{k} devient [s] call s:amap( 'K', 'S' ) "{h} devient [S] call s:amap( 'gb', 'gT' ) "le couple [gb]/[gé] agit sur les tabs call s:amap( 'gé', 'gt' ) "le couple [gb]/[gé] agit sur les tabs call s:amap( 'gB', ':execute "silent! tabfirst"' ) "[gB] va au premier tab call s:amap( 'gÉ', ':execute "silent! tablast" ' ) "[gÉ] au dernier call s:amap( 'gT', '' ) "[gT] est libéré et peut agir sur les tags call s:amap( '«', '<' ) "[<] est moins accessible que [«] call s:amap( '»', '>' ) "idem pour [»] et [>] call s:amap( ';', ',' ) "idem pour [,] et [;] call s:amap( ',', ';' ) "qui sont permutés call s:amap( 'g,', 'g;' ) "idem pour [g,] et [g;] call s:amap( 'g;', 'g,' ) "qui sont permutés call s:amap( 'é', 'w' ) "[w] est peu accessible, on utilise [é] call s:amap( 'É', 'W' ) "idem pour [W] et [É] call s:tomap( 'aé', 'aw' ) "idem pour [aw] et [aé] call s:tomap( 'aÉ', 'aW' ) "idem pour [aW] et [aÉ] call s:tomap( 'ié', 'iw' ) "idem pour [iw] et [ié] call s:tomap( 'iÉ', 'iW' ) "idem pour [iW] et [iÉ] call s:amap( 'w', '' ) "[w] est libre pour faire call s:amap( 'W', '') "et [w] pour faire call s:amap( 'wc', 'h' ) "on map [w]+direction call s:amap( 'wt', 'j' ) "on map [w]+direction call s:amap( 'ws', 'k' ) "on map [w]+direction call s:amap( 'wr', 'l' ) "on map [w]+direction call s:amap( 'wC', 'H' ) "idem pour les majuscules call s:amap( 'wT', 'J' ) "idem pour les majuscules call s:amap( 'wS', 'K' ) "idem pour les majuscules call s:amap( 'wR', 'L' ) "idem pour les majuscules call s:amap( 'wh', 's' ) "crée un split _h_orizontal call s:amap( 'wé', 't' ) "va en haut à gauche call s:amap( 'wÉ', 'T' ) "déplace sur un nouveau tab