Add vimrc
This commit is contained in:
parent
4a5a78a41d
commit
39684faac1
@ -1,3 +1,7 @@
|
|||||||
# tp
|
# tp
|
||||||
|
|
||||||
config pour les tp linux
|
Config pour les tp linux :
|
||||||
|
|
||||||
|
Commande à lancer en tant qu’`etu`:
|
||||||
|
|
||||||
|
`curl --proto '=https' --tlsv1.2 -sSf https://git.flavien.ovh/louis_royer/tp | sh`
|
||||||
|
19
install.sh
Normal file
19
install.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env
|
||||||
|
|
||||||
|
echo "Setting keyboard to bepo (shift-left+shift-right to go back to azerty"
|
||||||
|
echo 'setxkbmap -layout "fr,fr" -variant bepo, -option "grp:shifts_toggle"' >> /home/etu/.bashrc
|
||||||
|
. /home/etu/.bashrc
|
||||||
|
|
||||||
|
echo "Installing some usefull softwares"
|
||||||
|
sudo apt install ripgrep exa git vim byobu -y
|
||||||
|
|
||||||
|
echo "Cloning git repository"
|
||||||
|
git clone https://git.flavien.ovh/louis_royer/tp --depth 1
|
||||||
|
|
||||||
|
echo "Installing .vimrc for root"
|
||||||
|
sudo cp tp/vim/vimrc /root/.vimrc
|
||||||
|
sudo cp tp/vim/vimrc.bepo /root/.vimrc.bepo
|
||||||
|
sudo chown root:root /root/.vimrc*
|
||||||
|
|
||||||
|
echo "End for installation, lets begin your work!"
|
||||||
|
|
71
vim/vimrc
Normal file
71
vim/vimrc
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
" Activation de vim-pathogen pour l’installation de plugins
|
||||||
|
execute pathogen#infect()
|
||||||
|
|
||||||
|
"Plugin pour rust
|
||||||
|
"rustfmt à chaque sauvegarde
|
||||||
|
let g:rustfmt_autosave = 1
|
||||||
|
|
||||||
|
" Appliquer automatiquement les modifications de ~/.vimrc
|
||||||
|
if has("autocmd")
|
||||||
|
autocmd! bufwritepost .vimrc source ~/.vimrc
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(system("setxkbmap -print|grep bepo"))
|
||||||
|
source ~/.vimrc.bepo
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Visualise les tabs
|
||||||
|
set list
|
||||||
|
set listchars=tab:▸
|
||||||
|
|
||||||
|
" [Esc] sur Tab
|
||||||
|
"" 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>
|
||||||
|
|
||||||
|
" encodage et coloration syntaxique
|
||||||
|
set encoding=utf-8
|
||||||
|
set fileencoding=utf-8
|
||||||
|
syntax on
|
||||||
|
set number "affiche les numéros de ligne
|
||||||
|
set relativenumber "affiche les numéros de ligne (relatif)
|
||||||
|
|
||||||
|
" python ident
|
||||||
|
filetype indent plugin on
|
||||||
|
set autoindent
|
||||||
|
set modeline
|
||||||
|
|
||||||
|
" Maintain undo history between sessions
|
||||||
|
set undofile
|
||||||
|
if ($XDG_DATA_HOME != '')
|
||||||
|
silent !mkdir $XDG_DATA_HOME/vim/undodir -p > /dev/null 2>&1
|
||||||
|
set undodir=$XDG_DATA_HOME/vim/undodir
|
||||||
|
else
|
||||||
|
if ($HOME != '')
|
||||||
|
silent !mkdir $HOME/.local/share/vim/undodir -p > /dev/null 2>&1
|
||||||
|
set undodir=$HOME/.local/share/vim/undodir
|
||||||
|
else
|
||||||
|
echo "Error: environment variable $HOME not set"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if &term =~ "xterm\\|rxvt"
|
||||||
|
" use an orange cursor in insert mode
|
||||||
|
let &t_SI = "\<Esc>]12;orange\x7"
|
||||||
|
" use a red cursor otherwise
|
||||||
|
let &t_EI = "\<Esc>]12;red\x7"
|
||||||
|
silent !echo -ne "\033]12;red\007"
|
||||||
|
" reset cursor when vim exits
|
||||||
|
autocmd VimLeave * silent !echo -ne "\033]112\007"
|
||||||
|
" use \003]12;gray\007 for gnome-terminal and rxvt up to version 9.21
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Colorise les nbsp
|
||||||
|
colorscheme koehler
|
||||||
|
highlight NbSp ctermbg=lightgray guibg=lightred
|
||||||
|
match NbSp /\%xa0/
|
||||||
|
|
||||||
|
|
110
vim/vimrc.bepo
Normal file
110
vim/vimrc.bepo
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
" {W} -> [É]
|
||||||
|
" ——————————
|
||||||
|
" 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>
|
||||||
|
|
||||||
|
" [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 » (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é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
|
||||||
|
|
||||||
|
" 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 *
|
||||||
|
|
||||||
|
" Remaper la gestion des fenêtres
|
||||||
|
" ———————————————————————————————
|
||||||
|
noremap wt <C-w>j
|
||||||
|
noremap ws <C-w>k
|
||||||
|
noremap wc <C-w>h
|
||||||
|
noremap wr <C-w>l
|
||||||
|
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>
|
||||||
|
|
||||||
|
" [PgUp] / [PgDn] plus accessibles
|
||||||
|
" ________________________________
|
||||||
|
noremap <BS> <PageUp>
|
||||||
|
noremap <Space> <PageDown>
|
||||||
|
noremap <Return> zz
|
||||||
|
|
||||||
|
" Fixer l’encodage des fichiers en utf-8
|
||||||
|
" ______________________________________
|
||||||
|
set encoding=utf-8
|
||||||
|
set fileencoding=utf-8
|
Loading…
Reference in New Issue
Block a user