Mise a jour du readme + Changement Majeur dans VimsCode
This commit is contained in:
parent
9008561fbb
commit
081da8a840
140
README-ENG.md
Normal file
140
README-ENG.md
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Why VimsCode](#why-vimscode)
|
||||||
|
- [About](#about)
|
||||||
|
- [Quick Start](#quick-start)
|
||||||
|
- [Documentation](#documentation)
|
||||||
|
- [Update](#update)
|
||||||
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
|
||||||
|
## Why VimsCode
|
||||||
|
|
||||||
|
### VimsCode, it's beautiful :
|
||||||
|
|
||||||
|
To write or edit computer code, program an arduino etc... we use IDE (integrated development environment)
|
||||||
|
Many very complete graphic software exist to do that like VScode from microsoft or Atom.
|
||||||
|
|
||||||
|
So why not use them ?
|
||||||
|
|
||||||
|
**drawbacks :**
|
||||||
|
|
||||||
|
* They are resource intensive, lots of RAM (~1.3 GB, about 18,000 times more than the Apollo 11 mission that sent the first men to the moon :/ )
|
||||||
|
* They are quite difficult to debug because of the large abstraction layers that make them up
|
||||||
|
* They don't work without a graphical system (through ssh, on a server or a Raspberry Pi)
|
||||||
|
* It is sometimes difficult to make them do something simple if it was not planned by the developers
|
||||||
|
* Its frequent updates sometimes impose changes in working habits (new interfaces, new default configuration, new paths etc.)
|
||||||
|
|
||||||
|
So which solution? We suggest you use one of the historical command line text editors (vi, Vim) to make your own IDE :)
|
||||||
|
|
||||||
|
**Advantages :**
|
||||||
|
|
||||||
|
* Lightweight, ~15Kb which is 4.6 x less than Apollo 11 and 83000 times less than VSCODE!!!
|
||||||
|
* Configurable, you can configure everything in text files from already shared and popular configurations
|
||||||
|
* Stable, it only evolves without breaking the ergonomic continuity (always the same commands and shortcuts since 1991 for vim and 1976 for vi :) same for the configurations which remain valid since the beginning...)
|
||||||
|
* Usable through SSH on servers or very light computers (Raspberry Pi, etc.)
|
||||||
|
* Rock solid, crashes must exist, but I've never even heard of them
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
VimsCode is an IDE with vim for beginner or expert :
|
||||||
|
|
||||||
|
* VimsCode use arduino-cli, idf-esp and platform.io-cli for remplace VScode only in terminal
|
||||||
|
* Very easy to use
|
||||||
|
* Very easy to install
|
||||||
|
|
||||||
|
![Example-picture](/pictures/image.png)
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
### Introduction :
|
||||||
|
|
||||||
|
Installation requires :
|
||||||
|
```
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install git elinks
|
||||||
|
```
|
||||||
|
|
||||||
|
### Set up VimsCode :
|
||||||
|
|
||||||
|
|
||||||
|
After clone don't forgot to rename "vimrc-conf" -> ".vimrc" :
|
||||||
|
|
||||||
|
```
|
||||||
|
cd Vimscode
|
||||||
|
chmod +x install.sh
|
||||||
|
./install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Alias :
|
||||||
|
|
||||||
|
When you load vim, you have 1 error with vim-colorschemes, its totally normal, because your vimrc use theme but you dont have load this theme.
|
||||||
|
|
||||||
|
Edit your bashrc or zshrc and copie/paste this ligne at the end :
|
||||||
|
```
|
||||||
|
vim ~/.zshrc or vim ~/.bashrc
|
||||||
|
alias vimscode="~/.vim/vimscode.sh"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install Plugins :
|
||||||
|
|
||||||
|
Launch `vim` and run `:PluginInstall`
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
### Short-cute VimsCode :
|
||||||
|
|
||||||
|
This short-cute are totally switchable in .vimrc.
|
||||||
|
|
||||||
|
```
|
||||||
|
"F2" Shows a vim note
|
||||||
|
"F3" Shows the tree structure
|
||||||
|
"F4" Shows the history of changes made
|
||||||
|
"F5" Shows a terminal at the bottom
|
||||||
|
"F6" Allows scrolling in the terminal
|
||||||
|
"F7" Brings up a help site for vim and terminal
|
||||||
|
"F8" created a new vim tab
|
||||||
|
"F9" navigate between vim tabs
|
||||||
|
"c-s" vertical split of the window
|
||||||
|
"F10" "F10" close vimscode
|
||||||
|
```
|
||||||
|
|
||||||
|
* Shortcut in visual mode, when you highlight a word, do a duckduckgo search, on press "g".
|
||||||
|
* You can change the hight of window with mouse.
|
||||||
|
|
||||||
|
Finally you can run vimscode with this alias :
|
||||||
|
```
|
||||||
|
vimscode -e "file" # for ESP ide
|
||||||
|
vimscode -a "file" # for Arduino ide
|
||||||
|
vimscode -p "file" # for platform.io ide
|
||||||
|
vimscode # help vimscode
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want change theme of vimscode, you can just change this line :
|
||||||
|
```
|
||||||
|
colorscheme space-vim-dark
|
||||||
|
colorscheme cool
|
||||||
|
colorscheme elda
|
||||||
|
colorscheme space-vim-dark
|
||||||
|
colorscheme black_angus
|
||||||
|
```
|
||||||
|
And other theme : [Theme](https://github.com/flazz/vim-colorschemes/tree/master/colors)
|
||||||
|
|
||||||
|
|
||||||
|
### More Doc :
|
||||||
|
|
||||||
|
[Documentation](https://projets.cohabit.fr/redmine/projects/accueil/wiki/Documentation_IDE_Vim)
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
For update it's very simple you juste have to pull and do some mv:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd ~/.vim
|
||||||
|
chmod +x update-vimscode
|
||||||
|
./update-vimscode
|
||||||
|
```
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
For troubleshooting and common problems see [TROUBLESHOOTING](https://git.cohabit.fr/bastien/VimsCode/wiki/Troubleshooting).
|
||||||
|
|
117
README.md
117
README.md
|
@ -1,63 +1,62 @@
|
||||||
## Table of Contents
|
## Sommaire
|
||||||
|
|
||||||
- [Why VimsCode](#why-vimscode)
|
- [Pourquoi VimsCode](#pourquoi-vimscode)
|
||||||
- [About](#about)
|
- [A propose](#a-propos)
|
||||||
- [Quick Start](#quick-start)
|
- [Installation](#installation)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Update](#update)
|
- [Mise à jour](#mise-a-jour)
|
||||||
- [Troubleshooting](#troubleshooting)
|
|
||||||
|
|
||||||
## Why VimsCode
|
## Pourquoi VimsCode
|
||||||
|
|
||||||
### VimsCode, it's beautiful :
|
### VimsCode, C'est magnifique :
|
||||||
|
|
||||||
To write or edit computer code, program an arduino etc... we use IDE (integrated development environment)
|
Pour écrire ou éditer du code informatique, programmer un arduino etc... on utilise des IDE (environnement de développement intégré)
|
||||||
Many very complete graphic software exist to do that like VScode from microsoft or Atom.
|
Bien des logiciels graphiques très complets existent pour faire ça comme VScode de microsoft ou Atom.
|
||||||
|
|
||||||
So why not use them ?
|
Alors pourquoi pas les utiliser ? Ils ont des inconvénients
|
||||||
|
|
||||||
**drawbacks :**
|
**Inconvénients :**
|
||||||
|
|
||||||
* They are resource intensive, lots of RAM (~1.3 GB, about 18,000 times more than the Apollo 11 mission that sent the first men to the moon :/ )
|
* Ils sont gourmands en ressources, beaucoup de RAM (~1,3 Go, soit environ 18 000 fois plus que la mission Apollo 11 qui a envoyé les premiers hommes sur la lune :/ )
|
||||||
* They are quite difficult to debug because of the large abstraction layers that make them up
|
* Ils ont assez difficiles à déboguer du fait des grandes couches d'abstraction qui les composent
|
||||||
* They don't work without a graphical system (through ssh, on a server or a Raspberry Pi)
|
* Ils ne fonctionnent pas sans système graphique (à travers ssh, sur un serveur ou une Raspberry Pi)
|
||||||
* It is sometimes difficult to make them do something simple if it was not planned by the developers
|
* Il est difficile parfois de leur faire faire une chose simple si elle n'a pas été prévue par ses développeurs
|
||||||
* Its frequent updates sometimes impose changes in working habits (new interfaces, new default configuration, new paths etc.)
|
* Ses mises à jour fréquentes imposent parfois des changements dans les habitudes de travail (nouvelles interfaces, nouvelle configuration par défaut, nouveaux chemins etc.)
|
||||||
|
|
||||||
So which solution? We suggest you use one of the historical command line text editors (vi, Vim) to make your own IDE :)
|
Alors quelle solution ? Nous vous proposons d'utiliser un des éditeurs de texte historiques en ligne de commande (vi, Vim) pour vous faire votre propre IDE :)
|
||||||
|
|
||||||
**Advantages :**
|
**Advantages :**
|
||||||
|
|
||||||
* Lightweight, ~15Kb which is 4.6 x less than Apollo 11 and 83000 times less than VSCODE!!!
|
|
||||||
* Configurable, you can configure everything in text files from already shared and popular configurations
|
|
||||||
* Stable, it only evolves without breaking the ergonomic continuity (always the same commands and shortcuts since 1991 for vim and 1976 for vi :) same for the configurations which remain valid since the beginning...)
|
|
||||||
* Usable through SSH on servers or very light computers (Raspberry Pi, etc.)
|
|
||||||
* Rock solid, crashes must exist, but I've never even heard of them
|
|
||||||
|
|
||||||
## About
|
* Léger, ~15Ko soit 4,6 x moins qu'Apollo 11 et 83000 fois moins que VSCODE!!!
|
||||||
|
* Configurable, on peut tout configurer dans des fichiers textes à partir de configurations déjà très partagées et répendues
|
||||||
|
* Stabilité, il ne fait qu'évoluer sans rompre la continuité ergonomique (toujours les mêmes commandes et raccourcis depuis 1991 pour vim et 1976 pour vi :) de même pour les configurations qui restent valides depuis le début...)
|
||||||
|
* Utilisable à travers SSH sur des serveurs ou des ordis très légers (Raspberry Pi, etc.)
|
||||||
|
* Rock solide, les plantages doivent exister, mais je n'en ai jamais même entendu parler
|
||||||
|
|
||||||
VimsCode is an IDE with vim for beginner or expert :
|
## A propos de VimsCode
|
||||||
|
|
||||||
* VimsCode use arduino-cli, idf-esp and platform.io-cli for remplace VScode only in terminal
|
VimsCode est un IDE avec vim pour les débutant ou les expert :
|
||||||
* Very easy to use
|
|
||||||
* Very easy to install
|
* VimsCode utilise arduino-cli, idf-esp et platform.io-cli pour remplacer VScode uniquement dans le terminal
|
||||||
|
* Très facile à utliser
|
||||||
|
* Très facile à installer
|
||||||
|
|
||||||
![Example-picture](/pictures/image.png)
|
![Example-picture](/pictures/image.png)
|
||||||
|
|
||||||
## Quick Start
|
## Installation
|
||||||
|
|
||||||
### Introduction :
|
### Introduction :
|
||||||
|
|
||||||
Installation requires :
|
Prérequis :
|
||||||
```
|
```
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install git elinks
|
sudo apt install git elinks
|
||||||
```
|
```
|
||||||
|
|
||||||
### Set up VimsCode :
|
### Installation de VimsCode :
|
||||||
|
|
||||||
|
Après le clone, lancer juste le script d'installation
|
||||||
After clone don't forgot to rename "vimrc-conf" -> ".vimrc" :
|
|
||||||
|
|
||||||
```
|
```
|
||||||
cd Vimscode
|
cd Vimscode
|
||||||
|
@ -67,49 +66,41 @@ chmod +x install.sh
|
||||||
|
|
||||||
### Alias :
|
### Alias :
|
||||||
|
|
||||||
When you load vim, you have 1 error with vim-colorschemes, its totally normal, because your vimrc use theme but you dont have load this theme.
|
Quand vous chargez vim pour la première fois apres l'installation, ce dernier vous mettra plusieurs erreurs car vous n'avez pas encore installer les greffons nécessaire à son bon fonctionnement.
|
||||||
|
|
||||||
Edit your bashrc or zshrc and copie/paste this ligne at the end :
|
Editer votre bashrc ou zshrc pour ajouter l'alias VimsCode :
|
||||||
```
|
```
|
||||||
vim ~/.zshrc or vim ~/.bashrc
|
vim ~/.zshrc or vim ~/.bashrc
|
||||||
alias vimscode="~/.vim/vimscode.sh"
|
alias vimscode="~/.vim/vimscode.sh"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install Plugins :
|
### Installations des Greffons :
|
||||||
|
|
||||||
Launch `vim` and run `:PluginInstall`
|
Lancer `vim` et taper la commande `:PluginInstall`
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
### Short-cute VimsCode :
|
### Raccourcis VimsCode :
|
||||||
|
|
||||||
This short-cute are totally switchable in .vimrc.
|
Tous les raccourcis VimsCode sont totalement configurable dans le fichier .vimrc dans votre /home :
|
||||||
|
|
||||||
```
|
```
|
||||||
"F2" Shows a vim note
|
"Ctrl+l" Montre tout les raccourcis VimsCode et quelques raccourcis Vim
|
||||||
"F3" Shows the tree structure
|
|
||||||
"F4" Shows the history of changes made
|
|
||||||
"F5" Shows a terminal at the bottom
|
|
||||||
"F6" Allows scrolling in the terminal
|
|
||||||
"F7" Brings up a help site for vim and terminal
|
|
||||||
"F8" created a new vim tab
|
|
||||||
"F9" navigate between vim tabs
|
|
||||||
"c-s" vertical split of the window
|
|
||||||
"F10" "F10" close vimscode
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Shortcut in visual mode, when you highlight a word, do a duckduckgo search, on press "g".
|
* Le raccourcis en mode visuel vous permet de faire des chercher internet sur le mot sélection en appuyant sur "g".
|
||||||
* You can change the hight of window with mouse.
|
* Vous pouvez utiliser la souris dans VimsCode, pour changer des éléments ou autres...
|
||||||
|
|
||||||
Finally you can run vimscode with this alias :
|
Pour finir vous pouvez lancer VimsCode avec ces alias ou juste si vous préferez, vous pouvez le lancer juste avec vim mais vous n'aurez pas l'interface VimsCode de déclencher :
|
||||||
```
|
```
|
||||||
vimscode -e "file" # for ESP ide
|
vimscode -e "fichier" # pour ESP ide
|
||||||
vimscode -a "file" # for Arduino ide
|
vimscode -a "fichier" # pour Arduino ide
|
||||||
vimscode -p "file" # for platform.io ide
|
vimscode -p "fichier" # pour platform.io ide
|
||||||
vimscode # help vimscode
|
vimscode # aide vimscode
|
||||||
|
vim # sans affichage de VimsCode
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want change theme of vimscode, you can just change this line :
|
Si vous voulez changer de theme VimsCode, vous pouvez changer cette ligne :
|
||||||
```
|
```
|
||||||
colorscheme space-vim-dark
|
colorscheme space-vim-dark
|
||||||
colorscheme cool
|
colorscheme cool
|
||||||
|
@ -117,23 +108,19 @@ colorscheme elda
|
||||||
colorscheme space-vim-dark
|
colorscheme space-vim-dark
|
||||||
colorscheme black_angus
|
colorscheme black_angus
|
||||||
```
|
```
|
||||||
And other theme : [Theme](https://github.com/flazz/vim-colorschemes/tree/master/colors)
|
Et pour voir d'autres thèmes : [Theme](https://github.com/flazz/vim-colorschemes/tree/master/colors)
|
||||||
|
|
||||||
|
|
||||||
### More Doc :
|
### Plus de documentation :
|
||||||
|
|
||||||
[Documentation](https://projets.cohabit.fr/redmine/projects/accueil/wiki/Documentation_IDE_Vim)
|
[Documentation](https://projets.cohabit.fr/redmine/projects/accueil/wiki/Documentation_IDE_Vim)
|
||||||
|
|
||||||
## Update
|
## Mise à jour
|
||||||
|
|
||||||
For update it's very simple you juste have to pull and do some mv:
|
Pour mettre à jour VimsCode, taper simple ces commandes :
|
||||||
|
|
||||||
```
|
```
|
||||||
cd ~/.vim
|
cd ~/.vim
|
||||||
chmod +x update-vimscode
|
chmod +x update-vimscode
|
||||||
./update-vimscode
|
./update-vimscode
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
For troubleshooting and common problems see [TROUBLESHOOTING](https://git.cohabit.fr/bastien/VimsCode/wiki/Troubleshooting).
|
|
||||||
|
|
167
vimrc-conf
167
vimrc-conf
|
@ -5,18 +5,21 @@ set rtp+=~/.vim/bundle/Vundle.vim
|
||||||
call vundle#begin()
|
call vundle#begin()
|
||||||
Plugin 'VundleVim/Vundle.vim'
|
Plugin 'VundleVim/Vundle.vim'
|
||||||
|
|
||||||
"Plugins installés depuis Vim Awesome
|
"Plugins installés depuis Vim Awesome avec le gestionnaire Vundle
|
||||||
Plugin 'preservim/nerdtree'
|
Plugin 'preservim/nerdtree'
|
||||||
Plugin 'junegunn/fzf.vim'
|
Plugin 'mbbill/undotree'
|
||||||
Plugin 'jeffkreeftmeijer/vim-numbertoggle'
|
Plugin 'jeffkreeftmeijer/vim-numbertoggle'
|
||||||
Plugin 'sheerun/vim-polyglot'
|
|
||||||
Plugin 'rip-rip/clang_complete'
|
|
||||||
Plugin 'jodosha/vim-devnotes'
|
Plugin 'jodosha/vim-devnotes'
|
||||||
Plugin 'joshdick/onedark.vim'
|
Plugin 'joshdick/onedark.vim'
|
||||||
Plugin 'mbbill/undotree'
|
|
||||||
Plugin 'flazz/vim-colorschemes'
|
Plugin 'flazz/vim-colorschemes'
|
||||||
Plugin 'ervandew/supertab'
|
Plugin 'ervandew/supertab'
|
||||||
Plugin 'itspriddle/vim-shellcheck'
|
Plugin 'tpope/vim-fugitive'
|
||||||
|
Plugin 'jiangmiao/auto-pairs'
|
||||||
|
Plugin 'tpope/vim-commentary'
|
||||||
|
Plugin 'vim-airline/vim-airline'
|
||||||
|
Plugin 'vim-airline/vim-airline-themes'
|
||||||
|
Plugin 'liuchengxu/vim-which-key'
|
||||||
|
Plugin 'mhinz/vim-startify'
|
||||||
|
|
||||||
call vundle#end() " required
|
call vundle#end() " required
|
||||||
filetype plugin indent on " required
|
filetype plugin indent on " required
|
||||||
|
@ -25,13 +28,73 @@ filetype plugin indent on " required
|
||||||
syntax on
|
syntax on
|
||||||
set smartindent
|
set smartindent
|
||||||
set shiftround
|
set shiftround
|
||||||
set cindent
|
|
||||||
set wildmenu
|
set wildmenu
|
||||||
set cursorline
|
set cursorline
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set hlsearch
|
set hlsearch
|
||||||
|
set autowrite
|
||||||
set mouse=a
|
set mouse=a
|
||||||
set termwinsize=10x150 " Permet de réguler la taille du terminal
|
|
||||||
|
" Configuration du terminal extensible
|
||||||
|
function! OpenResizableTerminals(size)
|
||||||
|
let size_arg = a:size != '' ? '++rows=' . a:size : ''
|
||||||
|
execute 'bot term ' . size_arg
|
||||||
|
endfunction
|
||||||
|
nnoremap <F5> :call OpenResizableTerminals(input('Taille du terminal : ', '10'))<CR>
|
||||||
|
|
||||||
|
" Configurer Airline
|
||||||
|
set laststatus=2
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
let g:airline_theme='onedark'
|
||||||
|
|
||||||
|
" Stocker le nom d'utilisateur dans une variable
|
||||||
|
let g:username = substitute(system('whoami'), '\n', '', '')
|
||||||
|
|
||||||
|
" Fonction pour mapper les modes
|
||||||
|
function! Mode()
|
||||||
|
let mode = mode()
|
||||||
|
if mode ==# 'n'
|
||||||
|
return 'NORMAL'
|
||||||
|
elseif mode ==# 'i'
|
||||||
|
return 'INSERT'
|
||||||
|
elseif mode ==# 'v'
|
||||||
|
return 'VISUAL'
|
||||||
|
elseif mode ==# "\<C-V>"
|
||||||
|
return 'VISUAL BLOCK'
|
||||||
|
elseif mode ==# 'V'
|
||||||
|
return 'VISUAL LINE'
|
||||||
|
elseif mode ==# 'R'
|
||||||
|
return 'REPLACE'
|
||||||
|
else
|
||||||
|
return mode()
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Configurer les sections personnalisées dans la barre d'état
|
||||||
|
let g:airline_section_a = '%<%{Mode()}'
|
||||||
|
let g:airline_section_b = '%#StatusLine#' . g:username . ' | %f'
|
||||||
|
let g:airline_section_c = '%#StatusLineNC#%{strftime("%H:%M")}'
|
||||||
|
|
||||||
|
" Configurer les symboles de séparation
|
||||||
|
let g:airline_left_sep = ''
|
||||||
|
let g:airline_right_sep = ''
|
||||||
|
let g:airline_left_alt_sep = ''
|
||||||
|
let g:airline_right_alt_sep = ''
|
||||||
|
|
||||||
|
" Configurer les couleurs
|
||||||
|
hi StatusLine guifg=#ebdbb2 guibg=#3c3836 gui=NONE ctermfg=180 ctermbg=237 cterm=NONE
|
||||||
|
hi StatusLineNC guifg=#928374 guibg=#3c3836 gui=NONE ctermfg=146 ctermbg=237 cterm=NONE
|
||||||
|
hi User1 guifg=#282828 guibg=#98971a gui=NONE ctermfg=234 ctermbg=142 cterm=NONE
|
||||||
|
hi User2 guifg=#928374 guibg=NONE gui=NONE ctermfg=146 ctermbg=NONE cterm=NONE
|
||||||
|
hi User3 guifg=#d5c4a1 guibg=#3c3836 gui=NONE ctermfg=223 ctermbg=237 cterm=NONE
|
||||||
|
hi User4 guifg=#1d2021 guibg=NONE gui=NONE ctermfg=234 ctermbg=NONE cterm=NONE
|
||||||
|
hi User5 guifg=#689d6a guibg=NONE gui=NONE ctermfg=108 ctermbg=NONE cterm=NONE
|
||||||
|
hi User6 guifg=#fabd2f guibg=NONE gui=NONE ctermfg=214 ctermbg=NONE cterm=NONE
|
||||||
|
|
||||||
|
" Activer auto-pairs
|
||||||
|
let g:AutoPairsFlyMode = 1
|
||||||
|
let g:AutoPairsShortcutBackInsert = '<M-b>'
|
||||||
|
au FileType * let b:AutoPairs = AutoPairsDefine({'(':')', '[':']', '{':'}', '"':'"', "'":"'", '`':'`'})
|
||||||
|
|
||||||
"Numérotation avec numbertoggle
|
"Numérotation avec numbertoggle
|
||||||
set number relativenumber
|
set number relativenumber
|
||||||
|
@ -39,11 +102,12 @@ set number relativenumber
|
||||||
"Theme vim
|
"Theme vim
|
||||||
colorscheme space-vim-dark
|
colorscheme space-vim-dark
|
||||||
|
|
||||||
"Language vim
|
"Permet la sauvegarde automatique de l'historique...
|
||||||
let g:polyglot_enabled = ['sh', 'git', 'blade','scss','html5']
|
set undofile
|
||||||
|
set undodir=~/.vim/
|
||||||
|
|
||||||
"Raccourci vertical split
|
"Raccourci vertical split
|
||||||
nmap <c-s> :vsplit<cr>
|
nnoremap <c-a> :vsp<CR>
|
||||||
|
|
||||||
"Raccourci Note
|
"Raccourci Note
|
||||||
nmap <F2> :call DevNotes()<CR>
|
nmap <F2> :call DevNotes()<CR>
|
||||||
|
@ -52,10 +116,9 @@ nmap <F2> :call DevNotes()<CR>
|
||||||
nnoremap <F3> :NERDTreeToggle<CR>
|
nnoremap <F3> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
"Raccourci historique
|
"Raccourci historique
|
||||||
nnoremap <F4> :UndotreeToggle<CR>
|
nnoremap <F4> :UndotreeToggle<CR>:wincmd p<CR>
|
||||||
|
|
||||||
"Raccourci terminal
|
"Raccourci terminal
|
||||||
nnoremap <F5> :bot term<CR>
|
|
||||||
tnoremap <F6> <c-w>N
|
tnoremap <F6> <c-w>N
|
||||||
|
|
||||||
"Raccourci vers une recherche duckduckgo
|
"Raccourci vers une recherche duckduckgo
|
||||||
|
@ -65,19 +128,83 @@ vmap g :<C-U> !firefox "https://duckduckgo.com/?q=<cword>&t=newext&atb=v372-6&ia
|
||||||
nmap <F7> :!elinks https://agreugr.eu<CR>
|
nmap <F7> :!elinks https://agreugr.eu<CR>
|
||||||
|
|
||||||
"Raccourci onglet
|
"Raccourci onglet
|
||||||
nmap <F8> :tabnew<CR>
|
nnoremap <F8> :call OpenFileInNewTab()<CR>
|
||||||
nmap <F9> :tabnext<CR>
|
nmap <F9> :tabnext<CR>
|
||||||
|
|
||||||
"Fermeture de vimscode
|
" Sauvegarde et Fermeture de vimscode
|
||||||
tnoremap <F10> <c-d>
|
function! SaveAndQuit()
|
||||||
nnoremap <F10> :NERDTreeToggle<cr> > :x<cr>
|
wa
|
||||||
|
qall!
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <F10> :call SaveAndQuit()<CR>
|
||||||
|
|
||||||
"Raccourci plugin installer
|
"Raccourci plugin installer
|
||||||
nmap œ :PluginList<CR>
|
nmap ² :PluginList<CR>
|
||||||
|
|
||||||
"Raccourci au lancement de vim
|
"Raccourci au lancement de vim
|
||||||
au VimEnter *.cpp :NERDTreeFocus
|
au VimEnter *.cpp :NERDTreeFocus
|
||||||
au VimEnter *.cpp :bot term
|
au VimEnter *.cpp :call OpenResizableTerminals(input('Taille du terminal : ', '10'))<CR>
|
||||||
|
|
||||||
au VimEnter *.ino :NERDTreeFocus
|
au VimEnter *.ino :NERDTreeFocus
|
||||||
au VimEnter *.ino :bot term
|
au VimEnter *.ino :call OpenResizableTerminals(input('Taille du terminal : ', '10'))<CR>
|
||||||
|
|
||||||
|
" Fonction pour la création d'un nouvel onglet
|
||||||
|
function! OpenFileInNewTab()
|
||||||
|
let user_choice = input("Voulez-vous ouvrir un fichier existant ? (o/n): ")
|
||||||
|
if user_choice == 'o'
|
||||||
|
let file_name = input("Choisir un fichier à ouvrir : ", '', 'file')
|
||||||
|
if filereadable(file_name)
|
||||||
|
execute "tabnew " . fnameescape(file_name)
|
||||||
|
else
|
||||||
|
echo "Le fichier spécifié n'existe pas : " . file_name
|
||||||
|
endif
|
||||||
|
elseif user_choice == 't'
|
||||||
|
execute "tabnew "
|
||||||
|
elseif user_choice == 'n'
|
||||||
|
let new_file = input("Nouveau nom de fichier : ")
|
||||||
|
execute "tabnew " . new_file
|
||||||
|
else
|
||||||
|
echo "\nChoix invalide. Veuillez saisir 'o' pour ouvrir un fichier existant, ou 'n' pour créer un fichier."
|
||||||
|
endif
|
||||||
|
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'))
|
||||||
|
|
||||||
|
" Configuration WhichKey
|
||||||
|
call which_key#register('<Space>', "g:which_key_map")
|
||||||
|
nnoremap <silent> <c-l> :<c-u>WhichKey '<Space>'<CR>
|
||||||
|
set timeoutlen=20
|
||||||
|
let g:which_key_map = {
|
||||||
|
\ 'name' : 'Raccourcis VimsCode' ,
|
||||||
|
\ '<F2>' : ['<C-W>w' , 'fait apparaitre une note'] ,
|
||||||
|
\ '<F3>' : ['<C-W>c' , 'fait apparaitre l arborescence'] ,
|
||||||
|
\ '<F4>' : ['<C-W>s' , 'historique de modification'] ,
|
||||||
|
\ '<F5>' : ['<C-W>v' , 'fait apparaitre un terminal'] ,
|
||||||
|
\ '<F6>' : ['<C-W>v' , 'scroll dans le terminal'] ,
|
||||||
|
\ '<F7>' : ['<C-W>h' , 'fait apparaitre un site aide'] ,
|
||||||
|
\ '<F8>' : ['<C-W>j' , 'créer une nouvel fenetre'] ,
|
||||||
|
\ '<F9>' : ['<C-W>l' , 'change de fenetre'] ,
|
||||||
|
\ '<F10>' : ['<C-W>5<' , 'ferme VimsCode'] ,
|
||||||
|
\ 'Ctrl-s' : [':resize +5' , 'divise en deux vim'] ,
|
||||||
|
\ '²' : ['<C-W>5>' , 'affiche les greffons'] ,
|
||||||
|
\ }
|
||||||
|
let g:which_key_map.o = {
|
||||||
|
\ 'name' : 'Raccourcis Vim' ,
|
||||||
|
\ 'Ctrl-w-w' : ['<C-W>w' , 'other-window'] ,
|
||||||
|
\ 'Ctrl-w-c' : ['<C-W>c' , 'delete-window'] ,
|
||||||
|
\ 'Ctrl-w-s' : ['<C-W>s' , 'split-window-below'] ,
|
||||||
|
\ 'Ctrl-w-v' : ['<C-W>v' , 'split-window-right'] ,
|
||||||
|
\ 'Ctrl-w-h' : ['<C-W>h' , 'window-left'] ,
|
||||||
|
\ 'Ctrl-w-j' : ['<C-W>j' , 'window-below'] ,
|
||||||
|
\ 'Ctrl-w-l' : ['<C-W>l' , 'window-right'] ,
|
||||||
|
\ 'Ctrl-w-k' : ['<C-W>k' , 'window-up'] ,
|
||||||
|
\ ':resize +5' : [':resize +5' , 'expand-window-below'] ,
|
||||||
|
\ ':resize -5' : [':resize -5' , 'expand-window-up'] ,
|
||||||
|
\ 'Ctrl-w-=' : ['<C-W>=' , 'balance-window'] ,
|
||||||
|
\ }
|
||||||
|
|
Loading…
Reference in a new issue