From 9d6dd348203b51de7fd61bf9a8d2e0c7a4d3e43e Mon Sep 17 00:00:00 2001 From: Romain Porte Date: Wed, 6 May 2020 11:34:08 +0200 Subject: initial commit --- LICENSE | 21 ++++++++++++ README.md | 10 ++++++ curl-install.sh | 8 +++++ plugin/bepo.vim | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ root-install.sh | 9 +++++ 5 files changed, 148 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100755 curl-install.sh create mode 100644 plugin/bepo.vim create mode 100755 root-install.sh diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d39576c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Romain Porte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2012d88 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# bepo.vim + +Inspiré de [vim-bepo](https://github.com/michamos/vim-bepo) avec quelques +modifications personnelles. + +# Install + +``` +curl https://git.microjoe.org/MicroJoe/bepo.vim/plain/curl-install.sh | sh +``` diff --git a/curl-install.sh b/curl-install.sh new file mode 100755 index 0000000..62b77ed --- /dev/null +++ b/curl-install.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +ORIGIN=https://git.microjoe.org/MicroJoe/bepo.vim +DESTDIR=~/.vim/pack/microjoe/start/ +REPODIR="$DESTDIR/bepo.vim" + +mkdir -p "$DESTDIR" +git clone "$ORIGIN" "$REPODIR" diff --git a/plugin/bepo.vim b/plugin/bepo.vim new file mode 100644 index 0000000..17865be --- /dev/null +++ b/plugin/bepo.vim @@ -0,0 +1,100 @@ +" 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 + +" É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 +noremap 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" +noremap gÉ :exe "silent! tablast" +" 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 j +noremap ws k +noremap wc h +noremap wr l + +" Raccourcis pratiques sur ^W +noremap wd c +noremap wo s +noremap wp o +noremap w :split +noremap w :vsplit diff --git a/root-install.sh b/root-install.sh new file mode 100755 index 0000000..c6811be --- /dev/null +++ b/root-install.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Install the bepo.vim plugin for root, without actually cloning the repository +# again but just by copying the plugin. + +DESTDIR=/root/.vim/pack/microjoe/start/bepo.vim/ + +sudo mkdir -vp "$DESTDIR" +sudo cp -vr plugin "$DESTDIR" -- cgit v1.2.3