-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc_recupgitmerge
1771 lines (1453 loc) · 67.4 KB
/
.vimrc_recupgitmerge
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
" Les touches de fonctions avec des raccourcis (à maintenir):
" F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20
" - - | | | | | | | | | | - - - - - - - -
" F2 \_ (libre)
" F3 \_ ouvre une fenêtre au-dessus avec l'occurrence précédente du mot sous le curseur
" F4 \_ (libre)
" F5 \_ sauver et faire tourner le fichier courant par rebol, ou plutôt par le shebang
" F6 \_ faire tourner le paragraphe courant par rebol
" ctrl-F6 \_ faire tourner le paragraphe courant par python3
" shift-F6 \_ faire tourner le paragraphe courant par javascript
" ctrl-shift-F6 \_ faire tourner le paragraphe courant par une compilation de C et une exécution
" F7 \_ insertion de timestamp, comme dans le bon vieux ultraedit
" F8 \_ faire tourner le paragraphe courant par bash
" F9 \_ dictée du paragraphe en cours
" shift-F9 \_ shift => idem en anglais
" F10 \_ correction orthographique du paragraphe courant
" F11 \_ aller à l'étiquette _______________ENCOURS_______________ précédente
" F12 \_ dernière macro
" Pour le débogage du présent féchier:
" il faut faire:
" set foldmarker=[[[[,]]]]
let va1="oui"
let va2="oui"
let va3="oui"
let va4="oui"
let va5="oui"
let va6="oui"
let va7="oui"
let va8="oui"
if va1 == "oui" "@# début de code désactivé #############################################[[[[
" Des trucs assez bateau:{{{
syntax on
set noautoindent
"set autoindent
set noerrorbells
set ignorecase
set ruler
set showmatch
set showmode
set hlsearch
set incsearch
set scrolloff=5
set mouse=a
set infercase
" changes special characters in search patterns (default)
" set magic
set esckeys " Required to be able to use keypad keys and map missed escape sequences
" get easier to use and more user friendly vim defaults
" CAUTION: This option breaks some vi compatibility.
" Switch it off if you prefer real vi compatibility
set nocompatible
" Complete longest common string, then each full match
" enable this for bash compatible behaviour
" set wildmode=longest,full
"}}}
" Try to get the correct main terminal type/*{{{*/
if &term =~ "xterm"
let myterm = "xterm"
else
let myterm = &term
endif
let myterm = substitute(myterm, "cons[0-9][0-9].*$", "linux", "")
let myterm = substitute(myterm, "vt1[0-9][0-9].*$", "vt100", "")
let myterm = substitute(myterm, "vt2[0-9][0-9].*$", "vt220", "")
let myterm = substitute(myterm, "\\([^-]*\\)[_-].*$", "\\1", "")
"/*}}}*/
" Here we define the keys of the NumLock in keyboard transmit mode of xterm/*{{{*/
" which misses or hasn't activated Alt/NumLock Modifiers. Often not defined
" within termcap/terminfo and we should map the character printed on the keys.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
noremap! <ESC>Oo :
noremap! <ESC>Oj *
noremap! <ESC>Om -
noremap! <ESC>Ok +
noremap! <ESC>Ol ,
noremap! <ESC>OM
noremap! <ESC>Ow 7
noremap! <ESC>Ox 8
noremap! <ESC>Oy 9
noremap! <ESC>Ot 4
noremap! <ESC>Ou 5
noremap! <ESC>Ov 6
noremap! <ESC>Oq 1
noremap! <ESC>Or 2
noremap! <ESC>Os 3
noremap! <ESC>Op 0
noremap! <ESC>On .
" keys in normal mode
noremap <ESC>Oo :
noremap <ESC>Oj *
noremap <ESC>Om -
noremap <ESC>Ok +
noremap <ESC>Ol ,
noremap <ESC>OM
noremap <ESC>Ow 7
noremap <ESC>Ox 8
noremap <ESC>Oy 9
noremap <ESC>Ot 4
noremap <ESC>Ou 5
noremap <ESC>Ov 6
noremap <ESC>Oq 1
noremap <ESC>Or 2
noremap <ESC>Os 3
noremap <ESC>Op 0
noremap <ESC>On .
endif
"/*}}}*/
" xterm but without activated keyboard transmit mode/*{{{*/
" and therefore not defined in termcap/terminfo.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
noremap! <Esc>[H <Home>
noremap! <Esc>[F <End>
" Home/End: older xterms do not fit termcap/terminfo.
noremap! <Esc>[1~ <Home>
noremap! <Esc>[4~ <End>
" Up/Down/Right/Left
noremap! <Esc>[A <Up>
noremap! <Esc>[B <Down>
noremap! <Esc>[C <Right>
noremap! <Esc>[D <Left>
" KP_5 (NumLock off)
noremap! <Esc>[E <Insert>
" PageUp/PageDown
noremap <ESC>[5~ <PageUp>
noremap <ESC>[6~ <PageDown>
noremap <ESC>[5;2~ <PageUp>
noremap <ESC>[6;2~ <PageDown>
noremap <ESC>[5;5~ <PageUp>
noremap <ESC>[6;5~ <PageDown>
" keys in normal mode
noremap <ESC>[H 0
noremap <ESC>[F $
" Home/End: older xterms do not fit termcap/terminfo.
noremap <ESC>[1~ 0
noremap <ESC>[4~ $
" Up/Down/Right/Left
noremap <ESC>[A k
noremap <ESC>[B j
noremap <ESC>[C l
noremap <ESC>[D h
" KP_5 (NumLock off)
noremap <ESC>[E i
" PageUp/PageDown
noremap <ESC>[5~
noremap <ESC>[6~
noremap <ESC>[5;2~
noremap <ESC>[6;2~
noremap <ESC>[5;5~
noremap <ESC>[6;5~
endif
"/*}}}*/
" xterm/kvt but with activated keyboard transmit mode./*{{{*/
" Sometimes not or wrong defined within termcap/terminfo.
if myterm == "xterm" || myterm == "kvt" || myterm == "gnome"
" keys in insert/command mode.
noremap! <Esc>OH <Home>
noremap! <Esc>OF <End>
noremap! <ESC>O2H <Home>
noremap! <ESC>O2F <End>
noremap! <ESC>O5H <Home>
noremap! <ESC>O5F <End>
" Cursor keys which works mostly
" map! <Esc>OA <Up>
" map! <Esc>OB <Down>
" map! <Esc>OC <Right>
" map! <Esc>OD <Left>
noremap! <Esc>[2;2~ <Insert>
noremap! <Esc>[3;2~ <Delete>
noremap! <Esc>[2;5~ <Insert>
noremap! <Esc>[3;5~ <Delete>
noremap! <Esc>O2A <PageUp>
noremap! <Esc>O2B <PageDown>
noremap! <Esc>O2C <S-Right>
noremap! <Esc>O2D <S-Left>
noremap! <Esc>O5A <PageUp>
noremap! <Esc>O5B <PageDown>
noremap! <Esc>O5C <S-Right>
noremap! <Esc>O5D <S-Left>
" KP_5 (NumLock off)
noremap! <Esc>OE <Insert>
" keys in normal mode
noremap <ESC>OH 0
noremap <ESC>OF $
noremap <ESC>O2H 0
noremap <ESC>O2F $
noremap <ESC>O5H 0
noremap <ESC>O5F $
" Cursor keys which works mostly
" map <ESC>OA k
" map <ESC>OB j
" map <ESC>OD h
" map <ESC>OC l
noremap <Esc>[2;2~ i
noremap <Esc>[3;2~ x
noremap <Esc>[2;5~ i
noremap <Esc>[3;5~ x
noremap <ESC>O2A ^B
noremap <ESC>O2B ^F
noremap <ESC>O2D b
noremap <ESC>O2C w
noremap <ESC>O5A ^B
noremap <ESC>O5B ^F
noremap <ESC>O5D b
noremap <ESC>O5C w
" KP_5 (NumLock off)
noremap <ESC>OE i
endif
"/*}}}*/
" Tentative pour faire fonctionner <C-j> dans vim dans screen:
" En suivant les conseils de https://vim.fandom.com/wiki/GNU_Screen_integration :
" if match($TERM, "screen")!=-1
" " On est dans un screen
" set term=xterm
" map [1~ <Home>
" " Tentative de remapper Ctrl-j:
" "noremap <C-j>
" " => ne fonctionne pas
" let g:GNU_Screen_used = 1
" else
" " Hors screen
" map OH <Home>
" let g:GNU_Screen_used = 0
" endif
if myterm == "linux"
" keys in insert/command mode.
noremap! <Esc>[G <Insert>
" KP_5 (NumLock off)
" keys in normal mode
" KP_5 (NumLock off)
noremap <ESC>[G i
endif
" " This escape sequence is the well known ANSI sequence for
" " Remove Character Under The Cursor (RCUTC[tm])
" noremap! <Esc>[3~ <Delete>
" noremap <ESC>[3~ x
endif "@# fin de code désactivé #############################################]]]]
if va2 == "oui" "@# début de code désactivé #############################################[[[[
" Only do this part when compiled with support for autocommands. /*{{{*/
if has("autocmd")
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
"/*}}}*/
" Changed default required by SuSE security team--be aware if enabling this
" that it potentially can open for malicious users to do harmful things.
set modelines=0
" get easier to use and more user friendly vim defaults
" /etc/vimrc ends here
" F10 - La correction orthographique, c'est très très bien {{{
noremap ,c :w<CR>:!aspell -c %<CR>:e %<CR>
" Pour le paragraphe en cours:
noremap <F10> vip :w! /tmp/tmp_current_paragraph<cr>dip<up>:!aspell -c /tmp/tmp_current_paragraph<cr> :r /tmp/tmp_current_paragraph<cr>
" i<cr>
"}}}
" F9 - La dictée, c'est très très bien aussi, pour le paragraphe en cours:{{{
noremap <F9> vip :w! /tmp/tmp_vim_block<cr> :!espeak -v fr -s 200 -f /tmp/tmp_vim_block &<cr>
" Pareil, en anglais:
noremap <S-F9> vip :w! /tmp/tmp_vim_block<cr> :!espeak -v en -s 200 -f /tmp/tmp_vim_block &<cr>
"}}}
"copié depuis /usr/share/doc/hibernate/examples/hibernate.vim.gz{{{
augroup filetypedetect
au BufNewFile,BufRead hibernate.conf set filetype=hibernate
au BufNewFile,BufRead common.conf set filetype=hibernate
au BufNewFile,BufRead suspend2.conf set filetype=hibernate
au BufNewFile,BufRead disk.conf set filetype=hibernate
au BufNewFile,BufRead ram.conf set filetype=hibernate
au BufNewFile,BufRead .vimrc set syntax=vim
augroup END
"}}}
set keymodel=startsel,stopsel
"Complétion par tabulation: à partir d'un vimrc trouvé sur la Toile:/*{{{*/
""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""
" Fichier .vimrc de Nicolas Gressier
" Créé le 11 mai 2006
" Mise à jour : 03/06/2009
" Version 2.6
""""""""""""""""""""""""""""""""""""""""""""""""""
"Complétion par tabulation:{{{
""""""""""""""""""""""""""""""""""""""""""""""""""
function! CleverTab()
"check if at beginning of line of after a space
if strpart(getline('.'), 0, col('.')-1) =~ '^\s*$'
return "\<Tab>"
else
"use know-word completion
"return "\<C-N>"
"use know-word completion, mais plutôt à l'envers
return "\<C-P>"
endif
endfunction
function! CleverTabShift()
"check if at beginning of line or after a space
if strpart(getline('.'), 0, col('.')-1) =~ '^\s*$'
return "\<S-Tab>"
else
"use known-word completion, à l'endroit
return "\<C-N>"
endif
endfunction
"Mapping sur la touche Tab
inoremap <Tab> <C-R>=CleverTab()<CR>
"et pareil sur la combinaison de touches Shift Tab:
inoremap <S-Tab> <C-R>=CleverTabShift()<CR>
"}}}
"Ctrl-Tab pour naviguer entre les fenêtres (bof, peu usité, abandonné le 2022_03_24__18_26_16 avec un " devant):{{{
""MARCHE PAS :
" map <C-Tab> <C-w><C-w>
" 2023_08_03__18_30_38 => si, ça fonctionne, mais ça n'est pas ce que je souhaite
""Marche =>
"" http://stackoverflow.com/questions/2686766/mapping-c-tab-in-my-vimrc-fails-in-ubuntu
"" ...
"" Put this in your .vimrc:
"" !! Important - instead of XXXX you must type CTRL-V and then Esc OR copy-paste the whole text and run %s/\(set <F1[34]>=\)XXXX/\=submatch(1) . "\33"/g which is copy-pastable (insert it with <CTRL-R> +).
"set timeout timeoutlen=1000 ttimeoutlen=100
"set <F13>=[27;5;9~
""nnoremap <F13> gt
"map <F13> <C-w><C-w>
"set <F14>=[27;6;9~
""nnoremap <F14> gT
""map <F14> :tabNext<CR>
"map <F14> <C-w><S-w>
""And restart vim.
""Done.
"" Pareil, pour le mode insertion (c'est quand même commode):
"inoremap <F13> <Esc><C-w><C-w>i
"inoremap <F14> <Esc><C-w><S-w>i
"}}}
" "Alt-flèches pour naviguer entre les fenêtres, à la mode de chez terminator:{{{
" " 2023_08_28__12_36_18 Annulé, pour le tmux_navigator, voir à cet autre horodatage
" noremap <A-Up> :wincmd k<cr>
" noremap <A-Down> :wincmd j<cr>
" noremap <A-Left> :wincmd h<cr>
" noremap <A-Right> :wincmd l<cr>
" inoremap <A-Up> <esc>:wincmd k<cr>i
" inoremap <A-Down> <esc>:wincmd j<cr>i
" inoremap <A-Left> <esc>:wincmd h<cr>i
" inoremap <A-Right> <esc>:wincmd l<cr>i
"
" "Alt-hjkl pour naviguer de même:
" noremap <A-k> :wincmd k<cr>
" noremap <A-j> :wincmd j<cr>
" noremap <A-h> :wincmd h<cr>
" noremap <A-l> :wincmd l<cr>
" " inoremap <A-k> <Esc>mz:wincmd k<cr>`zi
" " inoremap <A-j> <Esc>mz:wincmd j<cr>`zi
" " inoremap <A-h> <Esc>mz:wincmd h<cr>`zi
" " inoremap <A-l> <Esc>mz:wincmd l<cr>`zi
" " => annulé les 4 derni:wincmd h
" " res lignes, car voilà ce qu'elles induisaient, m:wincmd j
" " me si l'on n'était pas dans un screen...
" 2023_08_28__12_36_18
if empty($TMUX)
" Touches capturées dans vim SANS tmux avec C-V:
"
"
"
"
noremap <A-Up> :TmuxNavigateUp<cr>
noremap <A-Down> :TmuxNavigateDown<cr>
noremap <A-Left> :TmuxNavigateLeft<cr>
noremap <A-Right> :TmuxNavigateRight<cr>
inoremap <A-Up> <esc>:TmuxNavigateUp<cr>i
inoremap <A-Down> <esc>:TmuxNavigateDown<cr>i
inoremap <A-Left> <esc>:TmuxNavigateLeft<cr>i
inoremap <A-Right> <esc>:TmuxNavigateRight<cr>i
"Alt-hjkl pour naviguer de même:
noremap <A-k> :TmuxNavigateUp<cr>
noremap <A-j> :TmuxNavigateDown<cr>
noremap <A-h> :TmuxNavigateLeft<cr>
noremap <A-l> :TmuxNavigateRight<cr>
inoremap <A-k> <Esc>mz:TmuxNavigateUp<cr>`zi
inoremap <A-j> <Esc>mz:TmuxNavigateDown<cr>`zi
inoremap <A-h> <Esc>mz:TmuxNavigateLeft<cr>`zi
inoremap <A-l> <Esc>mz:TmuxNavigateRight<cr>`zi
else
" Touches capturées dans vim dans tmux avec C-V:
" k
" j
" h
" l
" Ah bé si je refais ça, c'est différent: ???
" ê
" ë
" è
" ì
" => à ne SURTOUT pas mettre en inoremap...
" TODO vérifier que tout aille bien avec les flèches
noremap k :TmuxNavigateUp<cr>
noremap j :TmuxNavigateDown<cr>
noremap h :TmuxNavigateLeft<cr>
noremap l :TmuxNavigateRight<cr>
inoremap k <esc>:TmuxNavigateUp<cr>i
inoremap j <esc>:TmuxNavigateDown<cr>i
inoremap h <esc>:TmuxNavigateLeft<cr>i
inoremap l <esc>:TmuxNavigateRight<cr>i
"Alt-hjkl pour naviguer de même:
noremap k :TmuxNavigateUp<cr>
noremap j :TmuxNavigateDown<cr>
noremap h :TmuxNavigateLeft<cr>
noremap l :TmuxNavigateRight<cr>
inoremap k <Esc>mz:TmuxNavigateUp<cr>`zi
inoremap j <Esc>mz:TmuxNavigateDown<cr>`zi
inoremap h <Esc>mz:TmuxNavigateLeft<cr>`zi
inoremap l <Esc>mz:TmuxNavigateRight<cr>`zi
"Alt-hjkl pour naviguer de même, avec l'autre mappage dans tmux (??), SANS le mode insertion:
noremap ê :TmuxNavigateUp<cr>
noremap ë :TmuxNavigateDown<cr>
noremap è :TmuxNavigateLeft<cr>
noremap ì :TmuxNavigateRight<cr>
endif
"}}}
"}}}
" Pareil, avec les touches telles que reçues dans le xterm en regardant avec
" sed -n l
" nnoremap ë :wincmd k<cr>
" nnoremap ê :wincmd j<cr>
" nnoremap è :wincmd h<cr>
" nnoremap ì :wincmd l<cr>
" Cela ne fonctionne pas en mode insertion, bien sûr.
" => mais si!! Ça prend le pas et ça marque :wincmd h quand on tape sur la touche e avec accent grave!! => annulé!
" " Alors, maintenant, pour vivre avec tmux (selon config/.vim/pack/plugins/start/vim-tmux-navigator/README.md):{{{
" " 2023_08_28__12_36_18
" let g:tmux_navigator_no_mappings = 1
" noremap <silent> <A-Left> :<C-U>TmuxNavigateLeft<cr>
" noremap <silent> <A-Down> :<C-U>TmuxNavigateDown<cr>
" noremap <silent> <A-Up> :<C-U>TmuxNavigateUp<cr>
" noremap <silent> <A-Right> :<C-U>TmuxNavigateRight<cr>
" " noremap <silent> {Previous-Mapping} :<C-U>TmuxNavigatePrevious<cr>
" noremap <silent> <A-h> :<C-U>TmuxNavigateLeft<cr>
" noremap <silent> <A-j> :<C-U>TmuxNavigateDown<cr>
" noremap <silent> <A-k> :<C-U>TmuxNavigateUp<cr>
" noremap <silent> <A-l> :<C-U>TmuxNavigateRight<cr>
" *Note* Each instance of `{Left-Mapping}` or `{Down-Mapping}` must be replaced
" in the above code with the desired mapping. Ie, the mapping for `<ctrl-h>` =>
" Left would be created with `noremap <silent> <c-h> :<C-U>TmuxNavigateLeft<cr>`.
" }}}
" # => ça ne fonctionne point...
" # Autre essai, selon https://www.codeography.com/2013/06/19/navigating-vim-and-tmux-splits : {{{
if exists('$TMUX')
function! TmuxOrSplitSwitch(wincmd, tmuxdir)
let previous_winnr = winnr()
silent! execute "wincmd " . a:wincmd
if previous_winnr == winnr()
call system("tmux select-pane -" . a:tmuxdir)
redraw!
endif
endfunction
let previous_title = substitute(system("tmux display-message -p '#{pane_title}'"), '\n', '', '')
let &t_ti = "\<Esc>]2;vim\<Esc>\\" . &t_ti
let &t_te = "\<Esc>]2;". previous_title . "\<Esc>\\" . &t_te
nnoremap <silent> <A-h> :call TmuxOrSplitSwitch('h', 'L')<cr>
nnoremap <silent> <A-j> :call TmuxOrSplitSwitch('j', 'D')<cr>
nnoremap <silent> <A-k> :call TmuxOrSplitSwitch('k', 'U')<cr>
nnoremap <silent> <A-l> :call TmuxOrSplitSwitch('l', 'R')<cr>
inoremap <silent> <A-h> <esc>:call TmuxOrSplitSwitch('h', 'L')<cr>i
inoremap <silent> <A-j> <esc>:call TmuxOrSplitSwitch('j', 'D')<cr>i
inoremap <silent> <A-k> <esc>:call TmuxOrSplitSwitch('k', 'U')<cr>i
inoremap <silent> <A-l> <esc>:call TmuxOrSplitSwitch('l', 'R')<cr>i
nnoremap <silent> <A-Left> :call TmuxOrSplitSwitch('h', 'L')<cr>
nnoremap <silent> <A-Down> :call TmuxOrSplitSwitch('j', 'D')<cr>
nnoremap <silent> <A-Up> :call TmuxOrSplitSwitch('k', 'U')<cr>
nnoremap <silent> <A-Right> :call TmuxOrSplitSwitch('l', 'R')<cr>
inoremap <silent> <A-Left> <esc>:call TmuxOrSplitSwitch('h', 'L')<cr>i
inoremap <silent> <A-Down> <esc>:call TmuxOrSplitSwitch('j', 'D')<cr>i
inoremap <silent> <A-Up> <esc>:call TmuxOrSplitSwitch('k', 'U')<cr>i
inoremap <silent> <A-Right> <esc>:call TmuxOrSplitSwitch('l', 'R')<cr>i
else
nnoremap <A-h> :wincmd h<cr>
nnoremap <A-j> :wincmd j<cr>
nnoremap <A-k> :wincmd k<cr>
nnoremap <A-l> :wincmd l<cr>
nnoremap <A-Left> :wincmd h<cr>
nnoremap <A-Down> :wincmd j<cr>
nnoremap <A-Up> :wincmd k<cr>
nnoremap <A-Right> :wincmd l<cr>
inoremap <A-h> <esc>:wincmd h<cr>i
inoremap <A-j> <esc>:wincmd j<cr>i
inoremap <A-k> <esc>:wincmd k<cr>i
inoremap <A-l> <esc>:wincmd l<cr>i
inoremap <A-Left> <esc>:wincmd h<cr>i
inoremap <A-Down> <esc>:wincmd j<cr>i
inoremap <A-Up> <esc>:wincmd k<cr>i
inoremap <A-Right> <esc>:wincmd l<cr>i
endif
"}}}
"Alt-+- pour retailler les fenêtres: (ne fonctionne pas)
"noremap <A-+> :vertical resize +5<cr>
"noremap <A--> :vertical resize -5<cr>
"noremap <A-kPlus> :vertical resize +5<cr>
"noremap <A-kMinus> :vertical resize -5<cr>
" Pour naviguer dans les onglets (bof => non, retenté le 2022_03_24__18_26_16):{{{
noremap <C-tab> :tabnext<cr>
noremap <C-S-tab> :tabprevious<cr>
noremap <C-t> :tabnew<cr>
"noremap <C-tab> :tabnext<cr>
"""map <C-w> :tabclose<cr> "Surtout pas! Quand on commence à jouer avec les fenêtres, ça interfère, mal!
inoremap <C-S-tab> <ESC>:tabprevious<cr>i
inoremap <C-tab> <ESC>:tabnext<cr>i
inoremap <C-t> <ESC>:tabnew<cr>
"" Bof: je préfère naviguer dans les onglets avec Ctrl-PgUp/Dn: => 2022_03_25__21_10_28 marde, ça ne fonctionne pas.
if empty($TMUX)
nnoremap <C-PageUp> :tabprevious<cr>
inoremap <C-PageUp> <ESC>:tabprevious<cr>i
nnoremap <C-PageDown> :tabnext<cr>
inoremap <C-PageDown> <ESC>:tabnext<cr>i
else
" Dans vim dans tmux, C-V donne ça:
" Ctrl-PgDn:
" [6;5~
" Ctrl-PgUp:
" [5;5~
" Ctrl-Tab:
"
" Maj-Ctrl-Tab:
"
nnoremap [5;5~ :tabprevious<cr>
inoremap [5;5~ <ESC>:tabprevious<cr>i
nnoremap [6;5~ :tabnext<cr>
inoremap [6;5~ <ESC>:tabnext<cr>i
endif
" Poubelle:
" nmap <C-PageUp> :tabprevious<cr>
" nmap <C-PageUp> :tabprevious<cr>
" noremap <C-PageDown> :tabnext<cr>
" nnoremap <C-PageDown> :tabnext<cr>
" ""noremap <C-t> :tabnew<cr>
" ""nnoremap <C-t> :tabnew<cr>
" ""inoremap <C-t> <ESC>:tabnew<cr>i
" """map <C-w> :tabclose<cr> "Surtout pas! Quand on commence à jouer avec les fenêtres, ça interfère, mal!
"2023_07_18__23_02_42 solution plus VIMesque:
nnoremap H gT
nnoremap L gt
"}}}
endif "@# fin de code désactivé #############################################]]]]
if va3 == "oui" "@# début de code désactivé #############################################[[[[
" Ctrl-flèches et Ctrl-jk pour déplacer les lignes:{{{
"Ctrl-jk pour faire pareil: (marche pas...) => 2020_07_09__12_13_32 en fait, si on met les lignes map <S-C-k> avant, ce sont elles qui prennent le pas sur les lignes map <C-k>, curieusement. Ça ne le fait pas pour les <C-Flèches, c'est étrange. => 2023_07_25__18_21_51 ça fonctionne. => 2023_07_26__13_01_35 ça fonctionne, mais pas dans un screen... => 2023_08_30__18_23_19 ça fonctionne, mais pas dans un tmux...
" let g:C_Ctrl_j = 'off'
" nnoremap <