diff --git a/README.md b/README.md index cfeca6b..88791fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ + +![Vimscode](/pictures/vimscode.jpg) + ## Sommaire - [Pourquoi VimsCode](#pourquoi-vimscode) diff --git a/pictures/vimscode.jpg b/pictures/vimscode.jpg new file mode 100644 index 0000000..e9f8a74 Binary files /dev/null and b/pictures/vimscode.jpg differ diff --git a/vimrc-conf b/vimrc-conf index eb8bf0f..e316c0a 100644 --- a/vimrc-conf +++ b/vimrc-conf @@ -22,6 +22,8 @@ Plugin 'liuchengxu/vim-which-key' Plugin 'mhinz/vim-startify' Plugin 'junegunn/fzf' Plugin 'junegunn/fzf.vim' +Plugin 'romgrk/winteract.vim' +Plugin 'kien/rainbow_parentheses.vim' call vundle#end() " required filetype plugin indent on " required @@ -44,6 +46,7 @@ set hlsearch set mouse=a set expandtab set tabstop=2 +let mapleader = ";" " Configurer Airline set laststatus=2 @@ -105,6 +108,9 @@ set number relativenumber "Theme vim colorscheme space-vim-dark +"Active ou désactive la surbillance de la recherche +nnoremap n :nohlsearch + "Permet la sauvegarde automatique de l'historique... set undofile set undodir=~/.vim/ @@ -122,6 +128,7 @@ nnoremap :NERDTreeToggle nnoremap :UndotreeToggle:wincmd p "Raccourci terminal +nnoremap :vertical term nnoremap :call OpenResizableTerminals(input('Taille du terminal : ', '10')) tnoremap N @@ -147,6 +154,34 @@ au VimEnter *.cpp :call OpenResizableTerminals(input('Taille du terminal : ', '1 au VimEnter *.ino :NERDTreeToggle au VimEnter *.ino :call OpenResizableTerminals(input('Taille du terminal : ', '10')) +" Parametre des couleurs pour les parentheses... +let g:rbpt_colorpairs = [ + \ ['brown', 'RoyalBlue3'], + \ ['Darkblue', 'SeaGreen3'], + \ ['darkgray', 'DarkOrchid3'], + \ ['darkgreen', 'firebrick3'], + \ ['darkcyan', 'RoyalBlue3'], + \ ['darkred', 'SeaGreen3'], + \ ['darkmagenta', 'DarkOrchid3'], + \ ['brown', 'firebrick3'], + \ ['gray', 'RoyalBlue3'], + \ ['black', 'SeaGreen3'], + \ ['darkmagenta', 'DarkOrchid3'], + \ ['Darkblue', 'firebrick3'], + \ ['darkgreen', 'RoyalBlue3'], + \ ['darkcyan', 'SeaGreen3'], + \ ['darkred', 'DarkOrchid3'], + \ ['red', 'firebrick3'], + \ ] + +let g:rbpt_max = 16 +let g:rbpt_loadcmd_toggle = 0 + +au VimEnter * RainbowParenthesesToggle +au Syntax * RainbowParenthesesLoadRound +au Syntax * RainbowParenthesesLoadSquare +au Syntax * RainbowParenthesesLoadBraces + " Exécuter la commande :PluginUpdate en arrière-plan chaque fois que Vim est ouvert au VimEnter * silent! execute ':PluginUpdate | redraw!' @@ -189,10 +224,83 @@ function! OpenFileInNewTab() endif endfunction +" Configuration pour les touches en mode interaction +nmap g :InteractiveWindow + +function! InitWinmap() + + let g:winmap = {} + + let g:winmap.normal = { + \ "h": "normal! \<" , "=": "normal! \=" , + \ "j": "normal! \-" , "f": "normal! \_" , + \ "k": "normal! \+" , "F": "normal! \|" , + \ "l": "normal! \>" , "o": "normal! \o" , + \ + \ "|": "exe g:winmode.count.'wincmd |'", + \ "\\": "exe g:winmode.count.'wincmd _'", + \ "&": "normal! :\=&tw\wincmd |\" , + \ + \ "\": "normal! \h" , "H": "normal! \H" , + \ "\": "normal! \j" , "J": "normal! \J" , + \ "\": "normal! \k" , "K": "normal! \K" , + \ "\": "normal! \l" , "L": "normal! \L" , + \ + \ "x": "normal! \c" , "n": "normal! :bn\" , + \ "c": "normal! \c" , "p": "normal! :bp\" , + \ "s": "normal! \s" , "\": "normal! :bn\" , + \ "v": "normal! \v" , "\": "normal! :bp\" , + \ + \ "w": "normal! \w" , "\": "normal! \p" , + \ "W": "normal! \W" , + \ "q": "normal! :copen\" , + \ + \ "m": "let g:winmode.submode='move'" , + \ ":": "let g:winmode.submode='set'" , + \ "t": "let g:winmode.submode='tab'" , + \ + \ "d": "bdelete" , + \ ";": "terminal" , + \ + \ "\": "let exitwin=1" , + \ "\": "let exitwin=1" , + \} + + let g:winmap.move = { + \ "h": "normal! \H" , + \ "j": "normal! \J" , + \ "k": "normal! \K" , + \ "l": "normal! \L" , + \ "x": "normal! \x" , + \ "r": "normal! \r" , + \ "\": "\" NOP" , + \ } + + let g:winmap.set = { + \ "w": "exe g:winmode.count.'wincmd |'", + \ "h": "exe g:winmode.count.'wincmd _'", + \ "W": "wincmd |", + \ "H": "wincmd _", + \ "\": "let resetmode=1" , + \ } + + let g:winmap.tab = { + \ "o": "tab sview %" , + \ "e": "tabnew" , + \ "x": "tabclose" , + \ "n": "tabnext" , + \ "p": "tabprevious" , + \ + \ "w": "let g:winmode.submode='normal'" , + \ "\": "let exitwin=1" , + \ } +endfunction + " Configuration de la page d'accueil vim let g:startify_lists = [ \ {'type': 'files', 'header': ['Fichiers récents']}, \ ] + let g:startify_custom_header = \ startify#center(split(system('figlet -w 100 VIMSCODE'), '\n')) @@ -202,19 +310,30 @@ nnoremap :WhichKey '' set timeoutlen=20 let g:which_key_map = { \ 'name' : 'Raccourcis VimsCode' , - \ '' : ['' , 'fait apparaitre une note'] , - \ '' : ['' , 'fait apparaitre l arborescence'] , - \ '' : ['' , 'historique de modification'] , - \ '' : ['' , 'fait apparaitre un terminal'] , - \ ' souris' : ['' , 'redimensionnable avec la souris'] , - \ '' : ['' , 'scroll dans le terminal'] , - \ '' : ['' , 'fait apparaitre un site aide'] , - \ '' : ['' , 'créer/ouvre une nouvel fenetre'] , - \ '' : ['<' , 'change de fenetre'] , - \ '' : ['' , 'ferme VimsCode'] , - \ 'Ctrl-a' : ['' , 'divise en deux vim'] , - \ '²' : ['²' , 'affiche les greffons'] , + \ '' : ['' , 'fait apparaitre une note'] , + \ '' : ['' , 'fait apparaitre l arborescence'] , + \ '' : ['' , 'historique de modification'] , + \ '' : ['' , 'fait apparaitre un terminal'] , + \ '' : ['' , 'scroll dans le terminal'] , + \ '' : ['' , 'fait apparaitre un site aide'] , + \ '' : ['' , 'créer/ouvre une nouvelle fenetre'] , + \ '' : ['<' , 'change de fenetre'] , + \ '' : ['' , 'ferme VimsCode'] , + \ 'Ctrl-a' : ['' , 'divise en deux vim verticalement'] , + \ 'Shift-n' : ['' , 'divise en deux vim horizontalement'] , + \ '²' : ['²' , 'affiche les greffons'] , + \ ';-n' : ['n', 'Enleve la surbrillance de la recherche'] , \ } + +let g:which_key_map.f = { + \ 'name' : 'Raccourcis FZF' , + \ 'Ctrl-p' : ['' , 'active la recherche FZF'] , + \ 'Shift-f' : ['' , 'marche pas'] , + \ 'Shift-b' : ['' , 'active la recherche buffers'] , + \ 'Shift-m' : ['' , 'active la recherche marque page'] , + \ 'Shift-t' : ['' , 'active la recherche tags'] , + \ } + let g:which_key_map.a = { \ 'name' : 'Raccourcis Vim' , \ 'Ctrl-w-w' : ['w' , 'other-window'] , @@ -230,3 +349,16 @@ let g:which_key_map.a = { \ 'Ctrl-w-=' : ['=' , 'balance-window'] , \ } +let g:which_key_map.g = { + \ 'name' : 'Mode fenetre' , + \ 'h/j/k/l' : ['' , 'rezise'] , + \ 'f/F' : ['' , 'plein ecran'] , + \ 'o' : ['' , 'plein ecran et ferme le reste'] , + \ '=' : ['' , 'egalise'] , + \ 's/v' : ['' , 'divise verticalement/horizontalement'] , + \ 'w/W' : ['' , 'change le focus'] , + \ 'H/J/K/L' : ['' , 'deplace les fenetres'] , + \ 'n/p' : ['' , 'change le buffer'] , + \ 'echap' : ['' , 'quitte le mode'] , + \ } +