1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,70 @@ |
1 |
+https://www.atlassian.com/git/tutorials/saving-changes/gitignore |
|
2 |
+https://www.pierre-giraud.com/git-github-apprendre-cours/ |
|
3 |
+ |
|
4 |
+https://learngitbranching.js.org/?locale=fr_FR |
|
5 |
+ |
|
6 |
+ |
|
7 |
+** INITIER UN DEPOT GIT ** |
|
8 |
+mkdir <projet> |
|
9 |
+cd <projet> |
|
10 |
+git init |
|
11 |
+ |
|
12 |
+** EVOLUTION ** |
|
13 |
+git add |
|
14 |
+git mv <fichier> <newfichier> |
|
15 |
+git rm |
|
16 |
+git status |
|
17 |
+ |
|
18 |
+** REVENIR A LA VERSION DU DERNIER COMMIT ** |
|
19 |
+git reset HEAD <fichier> |
|
20 |
+ |
|
21 |
+** COMMIT ** |
|
22 |
+git commit -m "info du commit" -- Ne pas oublier de faire des git add sur toutes les modifs |
|
23 |
+git commit -a -- Pour ajouter automatiquement tous les fichiers modifiés sans git add |
|
24 |
+git commit --amend |
|
25 |
+ |
|
26 |
+** CLONE & REFRESH ** |
|
27 |
+git clone |
|
28 |
+git fetch -- Refresh uniquement |
|
29 |
+git pull -- Merge le refresh de l'origin avec mes modifs en local |
|
30 |
+ |
|
31 |
+** BRANCHES ** |
|
32 |
+git branch <nombranche> -- Creer la branche |
|
33 |
+git checkout <nombranche> -- Aller a la branche |
|
34 |
+git merge <branch> -- Fusionne la branche dans la branche courante (à faire avant : git co master) |
|
35 |
+? récupérer les dernieres modifs d'une autre branche dans ma branche actuelle ? |
|
36 |
+ |
|
37 |
+** TAG ** |
|
38 |
+git tag maVersion1 <commit-id> |
|
39 |
+ |
|
40 |
+** INFOS ** |
|
41 |
+git log |
|
42 |
+ |
|
43 |
+** TRAVAIL A DISTANCE ** |
|
44 |
+git clone <git distant> <repertoire local> -- Récupérer le git distant en local |
|
45 |
+git push / git push origin master -- Transfert les modifs au git distant |
|
46 |
+git pull / git pull origin master -- Recupere les modifs du git distant |
|
47 |
+ |
|
48 |
+ |
|
49 |
+ |
|
50 |
+** SPECIFIQUE : DEBUG ** |
|
51 |
+1. créer branche de debug : git branch debut; git checkout debug |
|
52 |
+2. ajouter plein de "printf", commit -m "debug: printf" : git commit |
|
53 |
+3. debuguer, commit : git commit -m "debug: fix" |
|
54 |
+4. publier uniquement le "commit fix" dans la branche master : git co master; git cherry-pick <commit-id ou from-commit-id to-commit-id> |
|
55 |
+ |
|
56 |
+ |
|
57 |
+ |
|
58 |
+ |
|
59 |
+ |
|
60 |
+** Infos d'utilisation des branches ** |
|
61 |
+ |
|
62 |
+Si tu fais une branche pour une évolution, dans ce cas là tu as 2 possibilités : |
|
63 |
+- Tu fais un merge dans ta branche principale, donc tu garde ta branche d'evolution avec tous ces commit dessus |
|
64 |
+- Tu fais un rebase dynamique en sélectionnant 1 commit en "Pick" et tous les autres commits de la branche évolution en "squash". Ca va donc te créer un seul nouveau commit dans ta branche principale qui est un condensé de ta branche d'évolution. Ta branche évolution n'est donc plus utile et tu peux la supprimer. |
|
65 |
+ |
|
66 |
+La bonne pratique c'est : |
|
67 |
+- si tu fais un merge d'une branche dans l'autre ça veut dire que tu veux garder les 2 branches pour de l'historique |
|
68 |
+- si tu fais du rebase tu veux juste alléger ton historique et donc ne plus avoir ta branche d'évolution |
|
69 |
+ |
|
70 |
+ |
0 | 71 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,148 @@ |
1 |
+S'il y a probleme de couleurs, ajouter au .bashrc : |
|
2 |
+ export TERM=xterm-256color |
|
3 |
+ (verifier avec 'tput colors' que ca retourne bien 256) |
|
4 |
+ |
|
5 |
+ |
|
6 |
+ |
|
7 |
+ |
|
8 |
+ |
|
9 |
+https://l.messenger.com/l.php?u=https%3A%2F%2Fftp.traduc.org%2Fdoc-vf%2Fgazette-linux%2Fhtml%2F2008%2F152%2Flg152-C.html&h=AT0olcNyj2hovnCwhdEz4TzB0oStACDAEz4dTK6OO9nonvJHHwqrtYMCUeLMolVhdBQz_GN2ciUbAfquT9pgZnK9mi8CmaZTVaQSGzPg1Vv2NdEE-fdc4g07pzmLbxlfqfrvSSmpYMKknXLsLbw |
|
10 |
+ |
|
11 |
+https://www.tictech.info/post/vim_basic |
|
12 |
+https://www.tictech.info/post/vim_avance_p1 |
|
13 |
+https://www.tictech.info/post/vim_avance_p2 |
|
14 |
+ |
|
15 |
+https://arolla.developpez.com/tutoriels/programmation/editeurs-code/dompter-vim-en-trois-temps/ |
|
16 |
+https://borntocode.fr/ameliorer-votre-productivite-avec-vim/ |
|
17 |
+ |
|
18 |
+https://artisan.karma-lab.net/vim-plugins-indispensables |
|
19 |
+https://vimawesome.com/ |
|
20 |
+https://medium.com/@brunojorge11/vim-as-php-ide-83310dddbf03 |
|
21 |
+ |
|
22 |
+https://github.com/ycm-core/YouCompleteMe |
|
23 |
+ |
|
24 |
+https://github.com/mmozuras/vimfiles/blob/master/vimrc |
|
25 |
+https://borntocode.fr/ameliorer-votre-productivite-avec-vim/ |
|
26 |
+https://github.com/JakobGM/dotfiles/blob/master/config/nvim/init.vim |
|
27 |
+https://gist.github.com/millermedeiros/1262085 |
|
28 |
+ |
|
29 |
+https://www.youtube.com/watch?v=XA2WjJbmmoM |
|
30 |
+ |
|
31 |
+ |
|
32 |
+ |
|
33 |
+Gestion des plugins : |
|
34 |
+ |
|
35 |
+https://github.com/junegunn/vim-plug |
|
36 |
+ |
|
37 |
+ |
|
38 |
+ |
|
39 |
+Autres plugins interessants a regarder : |
|
40 |
+ |
|
41 |
+"Plug 'ryanoasis/vim-devicons' " Lot d'icones pour NerdTree |
|
42 |
+"Plug 'majutsushi/tagbar' " Barre d'affichage des objets du code en cours |
|
43 |
+"Plug 'ycm-core/YouCompleteMe' " Autocompletion de code |
|
44 |
+"Plug 'cakebaker/scss-syntax.vim' |
|
45 |
+"Plug 'othree/html5.vim' |
|
46 |
+ |
|
47 |
+ludovicchabant/vim-gutentags -- ctags |
|
48 |
+majutsushi/tagbar -- Menu de ctags |
|
49 |
+cohama/lexima.vim -- Clos auto les {([ ... |
|
50 |
+honza/vim-snippets -- Gestion de snippets (template de bouts de code) |
|
51 |
+Valloric/YouCompleteMe -- Autocompletion |
|
52 |
+spell correction orthographe |
|
53 |
+mbbill/undotree |
|
54 |
+ |
|
55 |
+ |
|
56 |
+ |
|
57 |
+ |
|
58 |
+ |
|
59 |
+ |
|
60 |
+ |
|
61 |
+ |
|
62 |
+ |
|
63 |
+ |
|
64 |
+ MEMO DES COMMANDES |
|
65 |
+ |
|
66 |
+ |
|
67 |
+ |
|
68 |
+** Plugins |
|
69 |
+ :PlugInstall -- Installer les plugins ajoutes dans la liste ci-dessous |
|
70 |
+ :PlugClean -- Nettoyer les plugins supprimes de la liste |
|
71 |
+ :PlugUpdate -- Update les plugins installes |
|
72 |
+ |
|
73 |
+** Souris |
|
74 |
+ <Shift><Mouse-Selection> -- Pour copier du texte |
|
75 |
+ <Shift><Mouse-Right> -- Coller du texte |
|
76 |
+ |
|
77 |
+** Touches initiales |
|
78 |
+ i / a -- Passer en mode insertion |
|
79 |
+ A -- Passer en mode insertion a la fin de la ligne |
|
80 |
+ d / y / p -- Delete / Yank / Paste |
|
81 |
+ o / O -- Ajoute une ligne vide dessous/dessus |
|
82 |
+ w / W -- Se deplacer de mot/MOT en mot/MOT |
|
83 |
+ % -- Passer de l'ouverture a la fermeture d'un ({[ <=> ]}) |
|
84 |
+ :w/<filename> -- Enregistrer sous |
|
85 |
+ |
|
86 |
+** Folds |
|
87 |
+ zf3j -- Creer un fold des 3 lignes en dessous |
|
88 |
+ za -- Toggle le fold |
|
89 |
+ zM / zR -- Ferme/Ouvre tous les folds |
|
90 |
+ zd / zE -- Supprime un/tous les fold(s) |
|
91 |
+ |
|
92 |
+** Completion |
|
93 |
+ C-n / C-p -- Lister les completions possibles |
|
94 |
+ C-i C-o -- Omni-completion |
|
95 |
+ |
|
96 |
+** Marques |
|
97 |
+ ma -- Poser le marqueur 'a' |
|
98 |
+ 'a -- Aller au marqueur 'a' |
|
99 |
+ :marks -- Lister les marqueurs |
|
100 |
+ |
|
101 |
+** Persos |
|
102 |
+ ; -- Ajoute un ';' en fin de ligne |
|
103 |
+ |
|
104 |
+ C-f / <leader><Up> -- Cree un fold ?{ to %} |
|
105 |
+ <leader><Down> -- Cree un fold /{ to %} |
|
106 |
+ <F9> -- Toogle fold |
|
107 |
+ <leader><PageUp> -- Ferme tous les folds |
|
108 |
+ <leader><PageDown> -- Ouvre tous les folds |
|
109 |
+ |
|
110 |
+ <F7> -- Syntaxe : Infos |
|
111 |
+ <F8> -- Syntaxe : Errors |
|
112 |
+ |
|
113 |
+ <leader><Left>/<Right> -- Ajoute/Enleve 1 indentation |
|
114 |
+ |
|
115 |
+ <leader>q -- Quitte et cree une session |
|
116 |
+ <leader>d -- Supprime la session en cours |
|
117 |
+ <leader>w -- Enregistre tous les onglets |
|
118 |
+ |
|
119 |
+ <leader><leader> -- Commente la ligne |
|
120 |
+ |
|
121 |
+ <leader>e -- Toogle NerdTree |
|
122 |
+ |
|
123 |
+ <F3>/<leader>t -- Cree un nouvel onglet, et ouvre NerdTree |
|
124 |
+ <F2>/<F4> -- Navigue dans les tab |
|
125 |
+ <leader><F2>/<F4> -- Deplace le tab courant |
|
126 |
+ |
|
127 |
+ <F12> -- Paste Toggle : Desactive l'autoindent pour coller du code |
|
128 |
+ |
|
129 |
+ <ESC><ESC> -- Quitter le search highlighting |
|
130 |
+ |
|
131 |
+ <TAB> -- Autocompletion |
|
132 |
+ |
|
133 |
+** Plugin : NerdTree |
|
134 |
+ m -- Affiche le menu pour creer/deplacer/suppimer des fichiers/repertoies |
|
135 |
+ |
|
136 |
+** Plugin : Vimagit |
|
137 |
+ <F6>/:Magit -- Affiche l'interface. Puis commandes : |
|
138 |
+ S -- Pour staged une modif |
|
139 |
+ CC -- Commit (mettre le commentaire puis refaire CC) |
|
140 |
+ q -- Quitter Magit |
|
141 |
+ |
|
142 |
+ |
|
143 |
+** Plugin : Gitgutter |
|
144 |
+ ]c / [c -- Aller a la suivante/precedente modification (map <MON SHORTCUT> <Plug>(GitGutterNextHunk) / PrevHunk) |
|
145 |
+ <leader>hs -- Stage la modif |
|
146 |
+ <leader>hu -- Annuler la modif |
|
147 |
+ |
|
148 |
+ |
... | ... |
@@ -1,332 +1,269 @@ |
1 |
-" |
|
2 |
-" VIMRC - Seb |
|
3 |
-" |
|
4 |
-" |
|
5 |
-" |
|
6 |
-" S'il y a probleme de couleurs, ajouter au .bashrc : |
|
7 |
-" export TERM=xterm-256color |
|
8 |
-" (verifier avec 'tput colors' que ca retourne bien 256) |
|
9 |
-" |
|
10 |
-" |
|
11 |
- |
|
12 |
-" |
|
13 |
-" Docs : |
|
14 |
-" |
|
15 |
-" https://l.messenger.com/l.php?u=https%3A%2F%2Fftp.traduc.org%2Fdoc-vf%2Fgazette-linux%2Fhtml%2F2008%2F152%2Flg152-C.html&h=AT0olcNyj2hovnCwhdEz4TzB0oStACDAEz4dTK6OO9nonvJHHwqrtYMCUeLMolVhdBQz_GN2ciUbAfquT9pgZnK9mi8CmaZTVaQSGzPg1Vv2NdEE-fdc4g07pzmLbxlfqfrvSSmpYMKknXLsLbw |
|
16 |
-" |
|
17 |
-" https://www.tictech.info/post/vim_basic |
|
18 |
-" https://www.tictech.info/post/vim_avance_p1 |
|
19 |
-" https://www.tictech.info/post/vim_avance_p2 |
|
20 |
-" |
|
21 |
-" https://arolla.developpez.com/tutoriels/programmation/editeurs-code/dompter-vim-en-trois-temps/ |
|
22 |
-" https://borntocode.fr/ameliorer-votre-productivite-avec-vim/ |
|
23 |
-" |
|
24 |
-" https://artisan.karma-lab.net/vim-plugins-indispensables |
|
25 |
-" https://vimawesome.com/ |
|
26 |
-" https://medium.com/@brunojorge11/vim-as-php-ide-83310dddbf03 |
|
27 |
-" |
|
28 |
-" https://github.com/ycm-core/YouCompleteMe |
|
29 |
-" |
|
30 |
-" https://github.com/mmozuras/vimfiles/blob/master/vimrc |
|
31 |
-" https://borntocode.fr/ameliorer-votre-productivite-avec-vim/ |
|
32 |
-" https://github.com/JakobGM/dotfiles/blob/master/config/nvim/init.vim |
|
33 |
-" https://gist.github.com/millermedeiros/1262085 |
|
34 |
-" |
|
35 |
-" https://www.youtube.com/watch?v=XA2WjJbmmoM |
|
36 |
-" |
|
37 |
-" |
|
38 |
- |
|
39 |
- |
|
40 |
-" |
|
41 |
-" Autres plugins interessants a regarder : |
|
42 |
-" |
|
43 |
-" ludovicchabant/vim-gutentags -- ctags |
|
44 |
-" majutsushi/tagbar -- Menu de ctags |
|
45 |
-" cohama/lexima.vim -- Clos auto les {([ ... |
|
46 |
-" honza/vim-snippets -- Gestion de snippets (template de bouts de code) |
|
47 |
-" Valloric/YouCompleteMe -- Autocompletion |
|
48 |
-" spell correction orthographe |
|
49 |
-" mbbill/undotree |
|
50 |
-" |
|
51 |
- |
|
52 |
- |
|
53 |
- |
|
54 |
- |
|
55 |
- |
|
56 |
- |
|
57 |
- |
|
58 |
- |
|
59 |
-" |
|
60 |
-" MEMO DES COMMANDES |
|
61 |
-" |
|
62 |
-" |
|
63 |
- |
|
64 |
-" ** Plugins |
|
65 |
-" :PlugInstall -- Installer les plugins ajoutes dans la liste ci-dessous |
|
66 |
-" :PlugClean -- Nettoyer les plugins supprimes de la liste |
|
67 |
-" :PlugUpdate -- Update les plugins installes |
|
68 |
- |
|
69 |
-" ** Souris |
|
70 |
-" <Shift><Mouse-Selection> -- Pour copier du texte |
|
71 |
-" <Shift><Mouse-Right> -- Coller du texte |
|
72 |
- |
|
73 |
-" ** Touches initiales |
|
74 |
-" i / a -- Passer en mode insertion |
|
75 |
-" A -- Passer en mode insertion a la fin de la ligne |
|
76 |
-" d / y / p -- Delete / Yank / Paste |
|
77 |
-" o / O -- Ajoute une ligne vide dessous/dessus |
|
78 |
-" w / W -- Se deplacer de mot/MOT en mot/MOT |
|
79 |
-" % -- Passer de l'ouverture a la fermeture d'un ({[ <=> ]}) |
|
80 |
-" :w/<filename> -- Enregistrer sous |
|
81 |
- |
|
82 |
-" ** Folds |
|
83 |
-" zf3j -- Creer un fold des 3 lignes en dessous |
|
84 |
-" za -- Toggle le fold |
|
85 |
-" zM / zR -- Ferme/Ouvre tous les folds |
|
86 |
-" zd / zE -- Supprime un/tous les fold(s) |
|
87 |
- |
|
88 |
-" ** Completion |
|
89 |
-" C-n / C-p -- Lister les completions possibles |
|
90 |
-" C-i C-o -- Omni-completion |
|
91 |
- |
|
92 |
-" ** Marques |
|
93 |
-" ma -- Poser le marqueur 'a' |
|
94 |
-" 'a -- Aller au marqueur 'a' |
|
95 |
-" :marks -- Lister les marqueurs |
|
96 |
- |
|
97 |
-" ** Persos |
|
98 |
-" ; -- Ajoute un ';' en fin de ligne |
|
99 |
-" |
|
100 |
-" C-f / <leader><Up> -- Cree un fold ?{ to %} |
|
101 |
-" <leader><Down> -- Cree un fold /{ to %} |
|
102 |
-" <F9> -- Toogle fold |
|
103 |
-" <leader><PageUp> -- Ferme tous les folds |
|
104 |
-" <leader><PageDown> -- Ouvre tous les folds |
|
105 |
-" |
|
106 |
-" <F7> -- Syntaxe : Infos |
|
107 |
-" <F8> -- Syntaxe : Errors |
|
108 |
-" |
|
109 |
-" <leader><Left>/<Right> -- Ajoute/Enleve 1 indentation |
|
110 |
-" |
|
111 |
-" <leader>q -- Quitte et cree une session |
|
112 |
-" <leader>d -- Supprime la session en cours |
|
113 |
-" <leader>w -- Enregistre tous les onglets |
|
114 |
-" |
|
115 |
-" <leader><leader> -- Commente la ligne |
|
116 |
-" |
|
117 |
-" <leader>e -- Toogle NerdTree |
|
118 |
-" |
|
119 |
-" <F3>/<leader>t -- Cree un nouvel onglet, et ouvre NerdTree |
|
120 |
-" <F2>/<F4> -- Navigue dans les tab |
|
121 |
-" <leader><F2>/<F4> -- Deplace le tab courant |
|
122 |
-" |
|
123 |
-" <F12> -- Paste Toggle : Desactive l'autoindent pour coller du code |
|
124 |
-" |
|
125 |
-" <ESC><ESC> -- Quitter le search highlighting |
|
126 |
-" |
|
127 |
-" <TAB> -- Autocompletion |
|
128 |
- |
|
129 |
-" ** Plugin : NerdTree |
|
130 |
-" m -- Affiche le menu pour creer/deplacer/suppimer des fichiers/repertoies |
|
131 |
- |
|
132 |
-" ** Plugin : Vimagit |
|
133 |
-" <F6>/:Magit -- Affiche l'interface. Puis commandes : |
|
134 |
-" S -- Pour staged une modif |
|
135 |
-" CC -- Commit (mettre le commentaire puis refaire CC) |
|
136 |
-" q -- Quitter Magit |
|
137 |
-" |
|
138 |
- |
|
139 |
-" ** Plugin : Gitgutter |
|
140 |
-" ]c / [c -- Aller a la suivante/precedente modification (map <MON SHORTCUT> <Plug>(GitGutterNextHunk) / PrevHunk) |
|
141 |
-" <leader>hs -- Stage la modif |
|
142 |
-" <leader>hu -- Annuler la modif |
|
143 |
- |
|
144 |
- |
|
145 |
- |
|
146 |
-" |
|
147 |
-" PLUGINS |
|
148 |
-" |
|
149 |
- |
|
150 |
- |
|
151 |
-"https://github.com/junegunn/vim-plug |
|
152 |
-"Deploie l'environnement vim avec installation des plugins, |
|
153 |
-" si c'est le premier lancement de ce vimrc |
|
1 |
+" ------- PLUGINS ------- |
|
2 |
+ |
|
3 |
+" First init : installation des plugins |
|
154 | 4 |
if empty(glob('~/.vim/autoload/plug.vim')) |
155 | 5 |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs |
156 | 6 |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |
157 | 7 |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC |
158 | 8 |
endif |
159 | 9 |
|
160 |
-call plug#begin('~/.vim/plugged') " Debut de chargement des plugins |
|
161 |
- |
|
162 |
-Plug 'scrooloose/syntastic' " Verif de la syntaxe du code |
|
163 |
-Plug 'preservim/nerdtree' " Navigateur de fichiers |
|
164 |
-"Plug 'majutsushi/tagbar' " Barre d'affichage des objets du code en cours |
|
165 |
-"Plug 'ycm-core/YouCompleteMe' " Autocompletion de code |
|
166 |
-Plug 'mhinz/vim-startify' " Gestion des sessions |
|
10 |
+" Debut de chargement des plugins |
|
11 |
+call plug#begin('~/.vim/plugged') |
|
167 | 12 |
|
168 |
-Plug 'tpope/vim-fugitive' " Git plugin with commands 'G<command>' |
|
169 |
-Plug 'jreybert/vimagit' " Modal git editing with <leader>g |
|
170 |
-Plug 'airblade/vim-gitgutter' " Affiche les symboles de modifs git dans la marge |
|
13 |
+" Verif de la syntaxe du code |
|
14 |
+Plug 'scrooloose/syntastic' |
|
15 |
+" Navigateur de fichiers |
|
16 |
+Plug 'preservim/nerdtree' |
|
17 |
+" Gestion des sessions |
|
18 |
+Plug 'mhinz/vim-startify' |
|
171 | 19 |
|
172 |
-Plug 'drewtempelmeyer/palenight.vim' " Theme |
|
173 |
-Plug 'itchyny/lightline.vim' " Theme de barre de statut en bas |
|
20 |
+" Git plugin with commands 'G<command>' |
|
21 |
+Plug 'tpope/vim-fugitive' |
|
22 |
+" Modal git editing with <leader>g |
|
23 |
+Plug 'jreybert/vimagit' |
|
24 |
+" Affiche les symboles de modifs git dans la marge |
|
25 |
+Plug 'airblade/vim-gitgutter' |
|
174 | 26 |
|
175 |
-"Plug 'ryanoasis/vim-devicons' " Lot d'icones pour NerdTree |
|
27 |
+" Theme |
|
28 |
+Plug 'drewtempelmeyer/palenight.vim' |
|
29 |
+" Theme de barre de statut en bas |
|
30 |
+Plug 'itchyny/lightline.vim' |
|
176 | 31 |
|
177 |
-Plug 'sheerun/vim-polyglot' " Add syntax highlighting for a large range of filetypes |
|
178 |
-"Plug 'cakebaker/scss-syntax.vim' |
|
179 |
-"Plug 'othree/html5.vim' |
|
32 |
+" Add syntax highlighting for a large range of filetypes |
|
33 |
+Plug 'sheerun/vim-polyglot' |
|
180 | 34 |
|
181 | 35 |
call plug#end() |
182 | 36 |
|
183 | 37 |
|
184 | 38 |
|
185 | 39 |
|
40 |
+" ------- TRUE COLORS ------- |
|
186 | 41 |
|
187 |
-" |
|
188 |
-" TRUE COLORS |
|
189 |
-" |
|
190 |
- |
|
191 |
-"il faut ajouter 'export TERM=xterm-256color' dans .bashrc |
|
192 |
-"(v�rifier avec 'tput colors' que �a retourne bien 256) |
|
193 | 42 |
if (has("nvim")) |
194 | 43 |
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 |
195 | 44 |
endif |
196 | 45 |
if (has("termguicolors")) |
197 | 46 |
set termguicolors |
198 | 47 |
endif |
199 |
-"set t_8b=^[[48;2;%lu;%lu;%lum |
|
200 |
-"set t_8f=^[[38;2;%lu;%lu;%lum |
|
201 | 48 |
|
202 | 49 |
|
203 | 50 |
|
204 | 51 |
|
52 |
+" ------- CONF ------- |
|
205 | 53 |
|
206 |
-" |
|
207 |
-" CONFIGURATIONS |
|
208 |
-" |
|
54 |
+" Use Vim settings, rather than Vi |
|
55 |
+set nocompatible |
|
209 | 56 |
|
57 |
+" Encodage |
|
58 |
+set encoding=UTF-8 |
|
210 | 59 |
|
211 | 60 |
" Ouvre les fichiers sur plusieurs onglets au lieu de plusieurs buffers |
212 | 61 |
if !&diff | silent tab all | tabfirst | endif |
213 | 62 |
|
214 |
-set encoding=UTF-8 |
|
215 | 63 |
|
216 |
-set laststatus=2 " Affiche une barre de status en bas de l'�cran |
|
217 |
-set textwidth=0 " Largeur maxi du texte ins�r� : '0' d�sactive la fonction |
|
218 |
-set history=50 " Nombre de commandes dans l'historique |
|
219 |
-set viminfo='20,\"50 " Options du fichier ~/.viminfo |
|
220 |
-set backspace=2 " Active la touche Backspace |
|
221 |
-set scrolloff=5 " Garde toujours X ligne(s) visible(s) � l'�cran au dessus du curseur |
|
222 |
-set showcmd " Affiche les commandes dans la barre de status |
|
223 |
-set showmatch " Affiche la paire de parenth�ses |
|
224 |
-set nostartofline " Essaye de garder le curseur dans la m�me colonne quand on change de ligne |
|
225 |
- |
|
226 |
-set wildmode=list:full " Option de la compl�tion automatique |
|
227 |
-"set wildmode=list:longest " Option de la compl�tion automatique |
|
64 |
+" Affiche la barre d'info en bas |
|
65 |
+set laststatus=2 |
|
66 |
+" Largeur maxi : 0 = desactive |
|
67 |
+set textwidth=0 |
|
68 |
+" Nombre de cmd dans l'historique |
|
69 |
+set history=50 |
|
70 |
+" Options du fichier ~/.viminfo |
|
71 |
+set viminfo='20,\"50 |
|
72 |
+" Active la touche Backspace |
|
73 |
+set backspace=2 |
|
74 |
+" Garde toujours X ligne(s) visible(s) à l'écran au dessus du curseur |
|
75 |
+set scrolloff=5 |
|
76 |
+" Affiche les commandes dans la barre de status |
|
77 |
+set showcmd |
|
78 |
+" Affiche la paire de parenthèses |
|
79 |
+set showmatch |
|
80 |
+" Essaye de garder le curseur dans la même colonne quand on change de ligne |
|
81 |
+set nostartofline |
|
82 |
+ |
|
83 |
+" Option de la complétion automatique |
|
84 |
+set wildmode=list:full |
|
228 | 85 |
set wildignore+=*.o,*.obj,*.exe,*.so,*.dll,*.pyc,*.swp,*.jpg,*.png,*.gif,*.pdf,*.bak,.svn,.hg,.bzr,.git, |
229 | 86 |
|
230 |
-set nocompatible "use Vim settings, rather than Vi |
|
231 |
- |
|
232 |
-set incsearch "find the next match as we type the search |
|
233 |
-set hlsearch "highlight searches by default |
|
87 |
+"find the next match as we type the search |
|
88 |
+set incsearch |
|
89 |
+"highlight searches by default |
|
90 |
+set hlsearch |
|
234 | 91 |
|
235 |
-set ignorecase "set search to be case insensitive |
|
236 |
-set smartcase "unless you typed uppercase letters in your query |
|
92 |
+"set search to be case insensitive |
|
93 |
+set ignorecase |
|
94 |
+"unless you typed uppercase letters in your query |
|
95 |
+set smartcase |
|
237 | 96 |
|
238 |
-set number "add line numbers |
|
97 |
+"add line numbers |
|
98 |
+set number |
|
239 | 99 |
|
240 |
-syntax on "turn on syntax highlighting |
|
100 |
+"turn on syntax highlighting |
|
101 |
+syntax on |
|
102 |
+filetype plugin on |
|
241 | 103 |
|
242 |
-set visualbell t_vb= " Desactive le visualbell |
|
104 |
+" Desactive le visualbell |
|
105 |
+set visualbell t_vb= |
|
243 | 106 |
|
107 |
+" Active la souris |
|
244 | 108 |
set mouse=a |
245 | 109 |
|
246 |
-"Performances |
|
247 |
-set hidden " can put buffer to the background without writing |
|
248 |
- " to disk, will remember history/marks. |
|
249 |
-set lazyredraw " don't update the display while executing macros |
|
250 |
-set ttyfast " Send more characters at a given time. |
|
251 | 110 |
|
252 | 111 |
|
112 |
+" Performances |
|
113 |
+set hidden |
|
114 |
+set lazyredraw |
|
115 |
+set ttyfast |
|
253 | 116 |
|
254 |
-" |
|
255 |
-" THEME |
|
256 |
-" |
|
257 | 117 |
|
258 |
-set background=dark |
|
259 | 118 |
|
260 |
-colorscheme palenight |
|
261 |
-"let g:lightline = { 'colorscheme': 'palenight' } |
|
262 |
-"let g:airline_theme = "palenight" |
|
263 |
-let g:palenight_terminal_italics=1 |
|
264 | 119 |
|
265 |
-set cursorline " Surligne la ligne en cours |
|
266 |
-set noshowmode " N'affiche pas le mode en cours en bas, vu qu'il est sur la lightline |
|
120 |
+" ------- THEME ------- |
|
267 | 121 |
|
122 |
+set background=dark |
|
123 |
+colorscheme palenight |
|
124 |
+"let g:palenight_terminal_italics=1 |
|
125 |
+ |
|
126 |
+" Surligne la ligne en cours |
|
127 |
+set cursorline |
|
128 |
+" N'affiche pas le mode en cours en bas, vu qu'il est sur la lightline |
|
129 |
+set noshowmode |
|
268 | 130 |
|
269 |
-"let g:lightline = { 'colorscheme': 'powerline' } |
|
270 | 131 |
let g:lightline = { |
271 |
- \ 'colorscheme': 'wombat', |
|
272 |
- \ 'active': { |
|
273 |
- \ 'left': [ [ 'mode', 'paste' ], |
|
274 |
- \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] |
|
275 |
- \ }, |
|
276 |
- \ 'component_function': { |
|
277 |
- \ 'gitbranch': 'FugitiveHead' |
|
278 |
- \ }, |
|
279 |
- \ } |
|
280 |
- |
|
281 |
- |
|
282 |
-" |
|
283 |
-" INDENTATION & AUTOCOMPLETION |
|
284 |
-" |
|
285 |
- |
|
286 |
-"indent settings |
|
132 |
+ \ 'colorscheme': 'wombat', |
|
133 |
+ \ 'active': { |
|
134 |
+ \ 'left': [ [ 'mode', 'paste' ], |
|
135 |
+ \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] |
|
136 |
+ \ }, |
|
137 |
+ \ 'component_function': { |
|
138 |
+ \ 'gitbranch': 'FugitiveHead' |
|
139 |
+ \ }, |
|
140 |
+ \ } |
|
141 |
+ |
|
142 |
+ |
|
143 |
+ |
|
144 |
+ |
|
145 |
+" ------- INDENTATION ------- |
|
146 |
+ |
|
287 | 147 |
set shiftwidth=2 |
288 | 148 |
set tabstop=2 |
289 | 149 |
set softtabstop=2 |
290 | 150 |
set expandtab |
291 |
-set autoindent |
|
292 |
-"set noautoindent |
|
293 |
-"set nocindent |
|
294 |
-"set nosmartindent |
|
295 |
-"set indentexpr= |
|
296 |
-"filetype indent plugin off |
|
151 |
+filetype indent plugin on |
|
297 | 152 |
|
153 |
+" Desactive l'autoindent le temps d'un copier-coller |
|
154 |
+set pastetoggle=<F12> |
|
155 |
+ |
|
156 |
+" Change l'indentation |
|
157 |
+nnoremap <leader><Right> >> |
|
158 |
+vnoremap <leader><Right> >gv |
|
159 |
+nnoremap <leader><Left> << |
|
160 |
+vnoremap <leader><Left> <gv |
|
161 |
+vnoremap < <gv |
|
162 |
+vnoremap > >gv |
|
163 |
+ |
|
164 |
+ |
|
165 |
+ |
|
166 |
+ |
|
167 |
+" ------- AUTOCOMPLETION ------- |
|
298 | 168 |
|
299 |
-filetype plugin on |
|
300 | 169 |
set omnifunc=syntaxcomplete#Complete |
301 | 170 |
set completeopt=menuone |
302 |
-"set completeopt=longest,menu,preview |
|
303 | 171 |
|
172 |
+" Autocompletion avec la touche <TAB> |
|
173 |
+function! Smart_TabComplete() |
|
174 |
+ " Current line |
|
175 |
+ let line = getline('.') |
|
176 |
+ |
|
177 |
+ " from the start of the current line to one character right of the cursor |
|
178 |
+ let substr = strpart(line, -1, col('.')+1) |
|
179 |
+ " word till cursor |
|
180 |
+ let substr = matchstr(substr, "[^ \t]*$") |
|
181 |
+ " nothing to match on empty string |
|
182 |
+ if (strlen(substr)==0) |
|
183 |
+ return "\<tab>" |
|
184 |
+ endif |
|
185 |
+ " position of slash, if any |
|
186 |
+ let has_slash = match(substr, '\/') != -1 |
|
187 |
+ if (has_slash) |
|
188 |
+ " file matching |
|
189 |
+ return "\<C-X>\<C-F>" |
|
190 |
+ else |
|
191 |
+ " plugin matching |
|
192 |
+ return "\<C-X>\<C-O>" |
|
193 |
+ endif |
|
194 |
+endfunction |
|
195 |
+ |
|
196 |
+inoremap <tab> <c-r>=Smart_TabComplete()<CR> |
|
304 | 197 |
|
305 | 198 |
|
306 |
-"fold settings |
|
199 |
+ |
|
200 |
+ |
|
201 |
+ |
|
202 |
+" ------- FOLDS SETTINGS ------- |
|
203 |
+ |
|
307 | 204 |
set foldcolumn=3 |
308 | 205 |
set foldmethod=manual |
309 |
-"set foldlevel=99 |
|
310 | 206 |
set foldlevelstart=99 |
311 | 207 |
autocmd BufWinLeave *.php,*.htm,*.html,*.css,*.c,*.cc,*.h,*.cpp,*.py,*.rb,*.js mkview |
312 | 208 |
autocmd BufWinEnter *.php,*.htm,*.html,*.css,*.c,*.cc,*.h,*.cpp,*.py,*.rb,*.js silent loadview |
313 | 209 |
|
210 |
+" Cree un fold du prochain/precedent {, jusqu'au } de fermeture |
|
211 |
+nmap <C-f> ?{<CR>zf%za:noh<CR> |
|
212 |
+nmap <leader><Down> /{<CR>zf%za:noh<CR> |
|
213 |
+nnoremap <leader><Up> ?{<CR>zf%za:noh<CR> |
|
214 |
+" Toggle le fold en cours |
|
215 |
+nmap <F9> za |
|
216 |
+" Ouvre tous les folds |
|
217 |
+nnoremap <leader><PageDown> zR |
|
218 |
+" Ferme tous les folds |
|
219 |
+nnoremap <leader><PageUp> zM |
|
314 | 220 |
|
315 | 221 |
|
316 | 222 |
|
317 | 223 |
|
318 |
- |
|
319 |
-" |
|
320 |
-" CONF DES PLUGINS |
|
321 |
-" |
|
224 |
+" ------- PLUGIN: NerdTree ------- |
|
322 | 225 |
|
323 | 226 |
let NERDTreeQuitOnOpen=1 |
324 | 227 |
let NERDTreeShowHidden=1 |
325 | 228 |
|
229 |
+" Affiche/Cache l'explorateur NerdTree |
|
230 |
+noremap <leader>e :NERDTreeToggle<CR> |
|
231 |
+ |
|
232 |
+ |
|
233 |
+ |
|
234 |
+ |
|
235 |
+" ------- PLUGIN: Syntastic ------- |
|
236 |
+ |
|
326 | 237 |
let g:syntastic_always_populate_loc_list = 1 |
327 | 238 |
let g:syntastic_check_on_open = 1 |
328 | 239 |
let g:syntastic_check_on_wq = 0 |
329 | 240 |
|
241 |
+" Infos de syntaxe |
|
242 |
+nmap <F7> :SyntasticInfo<CR> |
|
243 |
+nmap <F8> :Errors<CR> |
|
244 |
+ |
|
245 |
+ |
|
246 |
+ |
|
247 |
+ |
|
248 |
+" ------- PLUGIN: GitGutter ------- |
|
249 |
+ |
|
250 |
+let g:gitgutter_terminal_reports_focus = 0 |
|
251 |
+let g:gitgutter_async = 0 |
|
252 |
+autocmd BufWritePost * GitGutter |
|
253 |
+ |
|
254 |
+ |
|
255 |
+ |
|
256 |
+ |
|
257 |
+" ------- PLUGIN: Magit ------- |
|
258 |
+ |
|
259 |
+map <F6> :Magit<CR> |
|
260 |
+imap <F6> <Esc>:Magit<CR> |
|
261 |
+ |
|
262 |
+ |
|
263 |
+ |
|
264 |
+ |
|
265 |
+" ------- PLUGIN: Startify (sessions) ------- |
|
266 |
+ |
|
330 | 267 |
let g:startify_session_persistence = 1 |
331 | 268 |
let g:startify_enable_special = 0 |
332 | 269 |
let g:startify_files_number = 10 |
... | ... |
@@ -347,7 +284,6 @@ let g:startify_session_before_save = [ |
347 | 284 |
\ 'silent! NERDTreeTabsClose' |
348 | 285 |
\ ] |
349 | 286 |
|
350 |
- |
|
351 | 287 |
function! SessionCreate() |
352 | 288 |
if empty(v:this_session) |
353 | 289 |
if tabpagenr("$") > 1 |
... | ... |
@@ -356,63 +292,18 @@ function! SessionCreate() |
356 | 292 |
endif |
357 | 293 |
endfunction |
358 | 294 |
|
295 |
+" Quitte quand plusieurs onglets sont ouverts, et cree une session si elle n'existe pas |
|
296 |
+noremap <leader>q :call SessionCreate()<CR>:qa<CR> |
|
297 |
+" Supprime la session en cours |
|
298 |
+noremap <leader>d :SDelete<CR> |
|
359 | 299 |
|
360 |
-let g:gitgutter_terminal_reports_focus = 0 |
|
361 |
-let g:gitgutter_async = 0 |
|
362 |
-autocmd BufWritePost * GitGutter |
|
363 |
- |
|
364 |
- |
|
365 |
- |
|
366 |
-"let g:tagbar_autofocus=1 |
|
367 |
- |
|
368 |
- |
|
369 |
- |
|
370 |
-" |
|
371 |
-" RACCOURCIS CLAVIER |
|
372 |
-" |
|
373 |
- |
|
374 |
-set whichwrap=<,>,[,] " Autorise le passage d'une ligne � l'autre avec les fl�ches gauche et droite |
|
375 |
- |
|
376 |
-" Definition de la touche <leader> |
|
377 |
-let g:mapleader = " " |
|
378 | 300 |
|
379 | 301 |
|
380 | 302 |
|
381 |
-"map <C-x> :TagbarToggle<CR> |
|
303 |
+" ------- CLAVIER ------- |
|
382 | 304 |
|
383 | 305 |
map ; A;<ESC> |
384 | 306 |
|
385 |
-" Cree un fold du prochain/precedent {, jusqu'au } de fermeture |
|
386 |
-"map <C-f> f{zf%za |
|
387 |
-nmap <C-f> ?{<CR>zf%za:noh<CR> |
|
388 |
-nmap <leader><Down> /{<CR>zf%za:noh<CR> |
|
389 |
-nnoremap <leader><Up> ?{<CR>zf%za:noh<CR> |
|
390 |
-" Toggle le fold en cours |
|
391 |
-nmap <F9> za |
|
392 |
-" Ouvre tous les folds |
|
393 |
-nnoremap <leader><PageDown> zR |
|
394 |
-" Ferme tous les folds |
|
395 |
-nnoremap <leader><PageUp> zM |
|
396 |
- |
|
397 |
-" Infos de syntaxe |
|
398 |
-nmap <F7> :SyntasticInfo<CR> |
|
399 |
-nmap <F8> :Errors<CR> |
|
400 |
- |
|
401 |
- |
|
402 |
- |
|
403 |
-" Change l'indentation |
|
404 |
-nnoremap <leader><Right> >> |
|
405 |
-vnoremap <leader><Right> >gv |
|
406 |
-nnoremap <leader><Left> << |
|
407 |
-vnoremap <leader><Left> <gv |
|
408 |
-vnoremap < <gv |
|
409 |
-vnoremap > >gv |
|
410 |
- |
|
411 |
-" Quitte quand plusieurs onglets sont ouverts, et cree une session si elle n'existe pas |
|
412 |
-noremap <leader>q :call SessionCreate()<CR>:qa<CR> |
|
413 |
-" Supprime la session en cours |
|
414 |
-noremap <leader>d :SDelete<CR> |
|
415 |
- |
|
416 | 307 |
" Enregistre tous les onglets en meme temps |
417 | 308 |
noremap <leader>w :wa<CR> |
418 | 309 |
|
... | ... |
@@ -420,9 +311,13 @@ noremap <leader>w :wa<CR> |
420 | 311 |
autocmd VimEnter *.php,*.js,*.c,*.cc,*.h,*.cpp noremap <leader><leader> 0i//<ESC> |
421 | 312 |
autocmd VimEnter *.sh noremap <leader><leader> 0i#<ESC> |
422 | 313 |
|
423 |
-" Affiche/Cache l'explorateur NerdTree |
|
424 |
-noremap <leader>e :NERDTreeToggle<CR> |
|
314 |
+" Clear search highlighting |
|
315 |
+nnoremap <Esc><Esc> :noh<CR> |
|
316 |
+ |
|
317 |
+ |
|
318 |
+ |
|
425 | 319 |
|
320 |
+" ------- TABS ------- |
|
426 | 321 |
|
427 | 322 |
" Creer un nouveau tab et ouvre l'explorateur NerdTree |
428 | 323 |
noremap <leader>t :$tabe<CR>:NERDTreeToggle<CR> |
... | ... |
@@ -437,39 +332,4 @@ inoremap <F4> <Esc>gt |
437 | 332 |
noremap <leader><F2> :tabm -1<CR> |
438 | 333 |
noremap <leader><F4> :tabm +1<CR> |
439 | 334 |
|
440 |
-imap <F10> <C-x><C-o> |
|
441 |
- |
|
442 |
-" Desactive l'autoindent le temps d'un copier-coller |
|
443 |
-set pastetoggle=<F12> |
|
444 |
- |
|
445 |
-" Clear search highlighting |
|
446 |
-nnoremap <Esc><Esc> :noh<CR> |
|
447 |
- |
|
448 |
- |
|
449 |
-map <F6> :Magit<CR> |
|
450 |
-imap <F6> <Esc>:Magit<CR> |
|
451 |
- |
|
452 |
- |
|
453 |
- |
|
454 |
-" Autocompletion avec la touche <TAB> |
|
455 |
-function! Smart_TabComplete() |
|
456 |
- let line = getline('.') " current line |
|
457 |
- |
|
458 |
- let substr = strpart(line, -1, col('.')+1) " from the start of the current |
|
459 |
- " line to one character right |
|
460 |
- " of the cursor |
|
461 |
- let substr = matchstr(substr, "[^ \t]*$") " word till cursor |
|
462 |
- if (strlen(substr)==0) " nothing to match on empty string |
|
463 |
- return "\<tab>" |
|
464 |
- endif |
|
465 |
- let has_slash = match(substr, '\/') != -1 " position of slash, if any |
|
466 |
- if (has_slash) |
|
467 |
- return "\<C-X>\<C-F>" " file matching |
|
468 |
- else |
|
469 |
- return "\<C-X>\<C-O>" " plugin matching |
|
470 |
- endif |
|
471 |
-endfunction |
|
472 |
-inoremap <tab> <c-r>=Smart_TabComplete()<CR> |
|
473 |
- |
|
474 |
- |
|
475 | 335 |
|