-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
3439 lines (2864 loc) · 108 KB
/
.vimrc
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
""" -------------------------------------------
""" key bindings and shortcuts
""" -------------------------------------------
" file navigation (function keys)
" F2 - NerdTree
" <leader>F2 - NertTree locate file
" F3 - go to buffer symbol local (ctrlpbuftag)
" <leader>F3 - tagbar toggle
" F4 - last files
" <leader> F4 - global last files
" F5 - symbols (from tags)
" F6 - modified files
" F7 - buffers
" F8 - generate tags
" F9/F10 - build/run/test or compile - lang dependent
"
" SUPER TIP TO FIND MAPPING
" :verbose map <F1>
" :verbose map <c-]>
"
"
" ---------------- main hortcuts -----------
" # change view mode
" <leader>n OR con - toggle line numbers
" cos - toggle spelling
"
" ### pasting
" <leader>p - put (paste next line)
" <leader>P OR yon - toggle paste mode and enter insert mode and disable automatically
"
" ### search
" <leader>f - search next current word (*)
" (visual)// - search higlighted text
" <leader>/ - reset highlight search
"
" ### serch mulitple files
" <leader>h - search current word in multiple files (matching type of file)
" <leader>H - search current word in multiple files (in all types)
"
" ### replace (last searched element)
" <leader>y - replace in current buffer
" (visual) <leader>y - replace highlighted in current buffer
" <leader>Y - replace in many buffers after 'search result of mutlple files'
"
" ----------------- vim tricks -------------------
" ----------------- PYTHON ----------------------
" <leader>id intrupt debugger
" <leader>iv intrupt vipdb debugger
" <leader>ip intrupt ipython embeded
"
"
" ---------------- debugger ----------------
" gn - go next
" gs - go step
" go - continue exit
" gu - go up frame
" gb - go bottom (down) frame
" gl - 'go location' of cursor
" gf - go finish
" ge - 'go end' (gdb finish)
" gj - 'go jump' run until location of cursor
" ga - 'go advanced' continue program up to given location
" until/finish
" <leader>tb - set breakpoint
"
" ------------ go to definition ---------
" gd - goto definition
" <leader>gd - goto definition in horizontal split
" <c-w>d or gD- goto definition in vertical split
"
" gf - goto file (under cursor)
" <c-w>f - goto file (new window)
"
" ------------ tmux -------------------
" <leader>r or tr - terminal rerun (was rename)
" <leader>te - terminal exit
" <leader>tl - terminal line (also tt)
" <leader>tt - terminal terminal (aka send line)
" <leader>t$ - terminal end to of line
" <leader>ta - terminal terminal ALL (send to all terminals)
" <leader>-X - execut current line wo tmux
" <c-x> - terminal line + next line
" <c-s-x> - (execute!) terminal terminal ALL and go to next line (all terminals)
" NUMBER<c-x> - seletected by ctrl-a-q terminal - send line
" 8<c-x> or <leader>x - split vertical + terminal terminal
" 9<c-x> or <ledeer>x - split horizontal + terminal terminal
" <leader>ts - send selection + enter
" <leader>tS - send selection (wo enter) - was CPASTE (depracted) - TODO
" <leader>tw - send word (+enter)
" <leader>tW - send word (wo enter)
" <leader>tc - send Ctrl-C
" <leader>tu - terminal tests - run tests in termianl
"
" ------- golang ---------:
" <leader>a - autoimports all
" <leader>A - autoimports this keyword
" F9 - quick run (this file) with QuickRun
" <leader>F9 - build this package (current folder)
" F10 - test this file
" <leader>F10 - test all (./...)
" <leader>R - rename (python/go)
" K - documentation
" <c-w>z - zOom window aka to tmux <c-a>z
""" -------------------------- debuging vim -----------------------
":set verbosefile=some.log
":set verbose=15
":SomeCommand php
":quit
""" -------------------------- debuging vim -----------------------
set nocompatible " be iMproved, required
filetype off " required
""" -------------------------------------------
""" VIM-Plug (plugins)
""" -------------------------------------------
" autoinstalltion
" Load vim-plug
if empty(glob("~/.vim/autoload/plug.vim"))
execute '!mkdir -p ~/.vim/autoload'
execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
" (depracted)-------- vundle installation
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" set the runtime path to include Vundle and initialize
" set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" let Vundle manage Vundle, required
" Plug 'gmarik/Vundle.vim'
"
"
""" VIM-plug url format
let g:plug_url_format = 'https://github.com/%s.git'
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'ervandew/supertab'
" ---------- Snippets
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" ??
Plug 'makerj/vim-pdf'
" sLL
"Plug 'justinmk/vim-sneak'
" autoformat
" pip install yapf autopep8
Plug 'Chiel92/vim-autoformat'
" --------------- PYTHON
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
Plug 'hynek/vim-python-pep8-indent', { 'for': 'python' }
Plug 'alfredodeza/coveragepy.vim', { 'for': 'python' }
Plug 'tlvince/vim-compiler-python', { 'for': 'python' }
" PyTest
Plug 'alfredodeza/pytest.vim', { 'for': 'python' }
Plug 'Rykka/doctest.vim', { 'for': 'python' }
Plug 'nvie/vim-flake8', { 'for': 'python' }
"Conflict with jedi-py
"Plug 'python-mode/python-mode', { 'for': 'python' }
" REMEMBER about g:black_virtualenv
" /home/ppalucki/.local/share/virtualenvs/gym_workloads-nhtcnMso
" let g:black_virtualenv = "/home/ppalucki/.local/share/virtualenvs/gym_workloads-nhtcnMso"
" Plug 'ambv/black'
" ------------- Golang development
" with GoImport fix (python based solution not accepted by upstream)
Plug 'fatih/vim-go', { 'for': 'go' }
Plug 'rhysd/vim-go-impl', { 'for': 'go' }
" Plug 'garyburd/go-explorer', { 'for': 'go' }
" --- TagBar
Plug 'majutsushi/tagbar'
" ---- NERDTree
Plug 'scrooloose/nerdtree'
" -------- Combine with netrw to create a delicious salad dressi
Plug 'tpope/vim-vinegar'
" colorschemes
Plug 'flazz/vim-colorschemes'
" Direcotry diff
Plug 'vim-scripts/DirDiff.vim'
" lepsze okno dialogowe przy otwieraniu zepsutych plikow
"### is not working properly anymore!
" Plug 'chrisbra/Recover.vim'
"
Plug 'mhinz/vim-grepper'
"
""" ----- ack-grep Find-search
" Plug 'mileszs/ack.vim'
Plug 'rking/ag.vim'
Plug 'Chun-Yang/vim-action-ag'
""" ----- syntastic - multilanguage linter
Plug 'scrooloose/syntastic'
""" ----- GIT
Plug 'tpope/vim-fugitive'
" ------------- Extra keyboard shortcuts
" A few of quick commands to swtich between source files and header files quickly.
Plug 'vim-scripts/a.vim'
" comment with gcc
Plug 'tomtom/tcomment_vim'
" uruchamianie w tle
Plug 'tpope/vim-dispatch'
" better repeats (.)
Plug 'tpope/vim-repeat'
" surround (ys/S)
Plug 'tpope/vim-surround'
" usefull shortucts - cos/col/coh/cod
Plug 'tpope/vim-unimpaired'
" shift or move or rotate arguments or parameters of function >, or <,
Plug 'PeterRincker/vim-argumentative'
" ------------- powerlines
" Plug 'bling/vim-airline'
Plug 'itchyny/lightline.vim'
" QuickRun
Plug 'thinca/vim-quickrun'
" DistractionFreeMode light version
Plug 'bilalq/lite-dfm'
" Patch review
Plug 'junkblocker/patchreview-vim'
" Set filetype based on shebang
Plug 'vitalk/vim-shebang'
" Better verbose
Plug 'tpope/vim-scriptease'
" Dockerfile
Plug 'ekalinin/Dockerfile.vim'
" json
Plug 'elzr/vim-json'
" color table
Plug 'guns/xterm-color-table.vim'
" mulitcurosrs
Plug 'terryma/vim-multiple-cursors'
" rust
Plug 'rust-lang/rust.vim'
" toml + cargo
Plug 'cespare/vim-toml'
" --- Presentation
" Plug 'sotte/presenting.vim'
Plug 'raphael/vim-present-simple'
" Thrift
Plug 'solarnz/thrift.vim'
" Join lines
Plug 'sk1418/Join'
" Fluentd
Plug 'itkq/fluentd-vim'
" Plug 'projectfluent/fluent.vim'
""" ----------------- CtrlP and plugins
Plug 'kien/ctrlp.vim'
"" Easily open locally modified files in your git-versioned projects. :CtrlPModified and :CtrlPBranch
" mappend to F6
Plug 'jasoncodes/ctrlp-modified.vim'
"" tjump
" Plug 'vim-scripts/ctrlp-tjump'
Plug 'ivalkeen/vim-ctrlp-tjump'
"" This plugin allow you to use CtrlP finder to execute setfiletype easily - :CtrlPFiletype
" Plug 'endel/ctrlp-filetype.vim'
"" This extension adds a new CtrlP command, the :CtrlPCmdPalette, which allows you to find and run vim commands (internal or custom).
" Plug 'fisadev/vim-ctrlp-cmdpalette'
"" GIT related: branch, diff, log
" Plug 'kaneshin/ctrlp-git'
"" It simply navigates and jumps to function definitions from the current file without ctags. :CtrlPFunky - po co skoro mam CtrlBufTag
" Plug 'tacahiroy/ctrlp-funky'
"
" Table Mode for instant table creation.
" Plug 'dhruvasagar/vim-table-mode'
"
""" ---------------- cscope tags
Plug 'joe-skb7/cscope-maps'
""" ----------------- Ctrpl end of plugins
""" ---------------- DISABLED (TRASH)
" SQL execute
" Plug 'ivalkeen/vim-simpledb'
" not required bundled with vim-go ??
" Plug 'nsf/gocode', {'rtp': 'vim/'}
"
" the same as gocode (bundled standalone and not required)
" Plug 'dgryski/vim-godef'
" real live completion for vim-go
" Plug 'Valloric/YouCompleteMe'
" dependensceies ???
"Plug 'xolox/vim-misc'
"
" clojure plugin
" Plug 'tpope/vim-fireplace'
" screensend/screenattach - because of osx path_max limit breaks Vim
" runtimepath
" Plug 'ervandew/screen'
" better paste from screen (with leader+p)
" Plug 'vim-scripts/screenpaste.vim'
" " ruby/RAILS
" Plug 'tpope/vim-rails'
""" ----- graphical gundo
" Plug 'sjl/gundo.vim'
""" ----- lepsze title dla taby
" Plug 'mkitt/tabline.vim'
"" In other words, you can search your selection text in |Visual-mode|.
" Plug 'thinca/vim-visualstar'
" !replaced with * or //
" udawane registry
" Plug 'kana/vim-fakeclip'
" import tag
" nie dziala bo zla sciezka jest
"Plug 'mjbrownie/Python-Tag-Import'
" The following are examples of different formats supported.
" Keep Plug commands between vundle#begin/end.
" plugin on GitHub repo
"Plug 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
"Plug 'L9'
" Git plugin not hosted on GitHub
"Plug 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plug 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
"Plug 'user/L9', {'name': 'newL9'}
" // disabled because is often a problem with vim pane zommed!
" Plug 'christoomey/vim-tmux-navigator'
"
"""" SOME ERRORS like tmux cannot find
" Plug 'wellle/tmux-complete.vim', { 'for': 'sh' }
" fork with 'escaping $ fix'
" Plug 'benmills/vimux'
" Plug 'altercation/vim-colors-solarized'
"
" Plug 'guyzmo/vim-etherpad'
"
" broken because in restored I cannot save file again (and slow!)
" Plug 'vim-scripts/ZoomWin'
" Plug 'justmao945/vim-clang'
" Plug 'skibyte/gdb-from-vim'
""" ----- smoth scrolling
" Plug 'terryma/vim-smooth-scroll'
""" c/c++ complete
" requires: aptinst libclang1
" .clang_complete file in project
" Plug 'Rip-Rip/clang_complete'
" vim-bracketed-paste enables transparent pasting into vim. (i.e. no more :set paste!)
" Plug 'ConradIrwin/vim-bracketed-paste'
"
""" drawing (requires perl)
" Plug 'vim-scripts/boxdraw'
"""
" Plug 'vim-scripts/DrawIt'
"
" Plug 'amiorin/vim-project'
" NO NO NO
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Plug 'junegunn/fzf.vim'
" cxiw or X in visual mode
"Plug 'tommcdo/vim-exchange'
""" ---------------------------- GITHUBs
" autoformatowanie zewnwtrznym programem - gq - nie dziala na osx
" Plug 'Chiel92/vim-autoformat'
" automatyczne zakmykanie nawiasow
"Plug 'Raimondi/delimitMate'
" obsluge ReST
"Plug 'Rykka/riv.vim' - colids with <c-e>
" jakies lepsze uzupelenianien
" Plug 'Shougo/neocomplcache.vim'
" gdy mam lua to lepsze jest
" Plug 'Shougo/neocomplete.vim'
"
Plug 'pearofducks/ansible-vim'
", { 'do': 'cd ./UltiSnips; python3.6 ./generate.py --style dictionary' }
" Plug 'chase/vim-ansible-yaml'
"
"
" Plug 'pedrohdz/vim-yaml-folds'
Plug 'chrisbra/vim-diff-enhanced'
" TypeScript
Plug 'leafgarland/typescript-vim'
" Open file with line filename:12
Plug 'bogado/file-line'
" default
Plug 'puremourning/vimspector'
Plug 'fidian/hexmode'
" helm chart
Plug 'towolf/vim-helm'
"
" WORKS: cfn linter + ftdetect as yaml.cloudformation
Plug 'speshak/vim-cfn'
" AWS Snipptes
" Plug 'lunarxlark/aws-cfn-snippet.vim' - no compatbilie with ultisnips
" instead:
" git clone https://github.com/lunarxlark/aws-cfn-snippet.vim
" cd aws-cfn-snippet.vim
" sed -i 's/master/main/' make-cfn-snippet.sh
" get submodules update
" ./make-cfn-snippet.sh --ultisnip
" cp snippets/yaml.snip ~/.vim/myultisnips/yaml_cloudformation.snippets
" cd ~/dotfiles
" git add ~/.vim/myultisnips/yaml_cloudformation.snippets
" git commit
" or use fork:
Plug 'ppalucki/aws-cfn-snippet.vim'
" AWS Other - conflicts with vim-cfn linter above
" Plug 'NLKNguyen/cloudformation-syntax.vim'
"
"
"
Plug 'hashivim/vim-terraform'
Plug 'stephpy/vim-yaml'
Plug 'pedrohdz/vim-yaml-folds'
call plug#end()
let g:hexmode_patterns = '*.blb'
let g:hexmode_xxd_options = '-g 1 -p'
" To ignore plugin indent changes, instead use:
"filetype plugin on
" 44 line master to main
" ./make-cfn-snippet.sh -u
""" -------------------------------------------
""" Core settings
""" -------------------------------------------
filetype plugin indent on
syntax on
""" -------------------------------------------
""" colorscheme
""" -------------------------------------------
"podglad numerow kolorow ~/download/xtrem-colortest -w -r syntax on musi byc "przed kolorkami
set t_Co=256
let g:molokai_original = 0
colorscheme molokai
set noshowmode
" colorscheme desert256
" autocomplete ctrl-n colors
hi Pmenu ctermfg=220 ctermbg=238 guibg=#511151
hi PmenuSel ctermfg=lightyellow ctermbg=brown guibg=#333388
hi PmenuSbar ctermbg=6
hi PmenuThumb ctermfg=3
highlight Search ctermbg=236
"
" colorscheme molokai
" let g:molokai_original = 1
"
""" better visual selection
hi Visual ctermbg=238
""" -------------------------------------------
""" cursorline
""" -------------------------------------------
" set cursorline
" hi CursorLine cterm=NONE ctermbg=234 guibg=NONE
" set nonumber
""" -------------------------------------------
""" airline/statusline
""" -------------------------------------------
" turn on status line always
set laststatus=2
let g:airline_powerline_fonts = 1
" let g:airline#extensions#branch#enabled = 1
" let g:airline#extensions#syntastic#enabled = 1
" let g:airline#extensions#tagbar#enabled = 1
" let g:airline_theme = 'powerlineish'
let g:bufferline_echo = 0
""" cos innego
" wplywa na multipolcenie taloe jak leader \ev \es \s
set timeoutlen=1000
""" -------------------------------------------
""" leader
""" -------------------------------------------
" let mapleader = ","
" let mapleader = " " - zmiast tego musze uzywac tych dwoch lini ponizej, zeby
" macvim nie czekaj na spacje po wcisnieciu
" http://superuser.com/questions/693528/vim-is-there-a-downside-to-using-space-as-your-leader-key
let mapleader = "\\"
map <space> \
" nmap , <space> # second leader key ! lepiej nie zeby sie odzwyaczic
""" -------------------------------------------
""" hidden allow edited buffers
""" -------------------------------------------
set hidden
""" -------------------------------------------
""" clibboard (global buffer integration)
""" -------------------------------------------
""" allows for features like: yank in one vim (send to x buffer, then paste
""" from tmux or another vim
""" needs tmuxxcopy
""" and xclip/load-buffer/save-buffer/
if has("mac")
set clipboard=unnamed
elseif has("unix")
" set clipboard=unnamedplus -- to much problems working offline without
" working X server
" set clipboard=unnamed
" according:
" http://stackoverflow.com/questions/10718573/vim-x-flag-as-vimrc-entry
" works like vim -X (don't try to connect to X server)
set clipboard=exclude:.*
" if has('unnamedplus')
" set clipboard=unnamed,unnamedplus
" endif
" vmap <leader>y :w! /tmp/vitmp<CR>
" nmap <leader>p :r! cat /tmp/vitmp<CR>
elseif has("win32")
" do stuff under windows "
" ???
endif
""" -------------------------------------------
""" Python
""" -------------------------------------------
" """--------- pythonmode
" let g:pymode_motion = 1
" let g:pymode_doc = 0
" let g:pymode_folding = 0
" " flakes + write dziala dosc szybko ale nie wykrywa wszystkich bledow let
" let g:pymode_indent = 0
"
" let g:pymode_lint = 1
" let g:pymode_rope = 0
" " Show error message if cursor placed at the error line *'g:pymode_lint_message'*
" let g:pymode_lint_message = 0
" " on save
" " Check code on every save (if file has been modified) *'g:pymode_lint_on_write'*
" let g:pymode_lint_on_write = 0
" " Check code on every save (every) *'g:pymode_lint_unmodified'*
" let g:pymode_lint_unmodified = 0
" " Check code when editting (onfly) *'g:pymode_lint_on_fly'*
" let g:pymode_lint_on_fly = 0
"
" " Default code checkers (you could set several) *'g:pymode_lint_checkers'*
" " Values may be choosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`.
" " let g:pymode_lint_checkers = ["pyflakes"]
" let g:pymode_lint_checkers = ["pylint"]
" let g:pymode_lint_signs = 0
" let g:pymode_lint_config = 'pylint.rc2'
" let g:pymode_lint_ignore = 'C,W0603,W402,W0611,C0324,W0612,W0511,C0323,W0622,C0302,W806,C0301,C0322,R0921,R0914,W0101,W801,W0404'
" let g:pymode_lint_sort = ['E', 'C', 'I']
"
"
" let g:pymode_options_max_line_length = 0
"
" " PyMode Syntax Highlight
" "
" let g:pymode_syntax = 1
" let g:pymode_syntax_all = 0
" "
" let g:pymode_syntax_builtin_funcs = 0
" let g:pymode_syntax_builtin_objs = 1
" let g:pymode_syntax_builtin_types = 0
" let g:pymode_syntax_doctests = 0
" let g:pymode_syntax_highlight_equal_operator = 0
" let g:pymode_syntax_highlight_exceptions = 0
" let g:pymode_syntax_highlight_self = 0
" let g:pymode_syntax_highlight_stars_operator = 0
" let g:pymode_syntax_indent_errors = 0
" let g:pymode_syntax_print_as_function = 0
" let g:pymode_syntax_space_errors = 0
" let g:pymode_syntax_string_format = 0
" let g:pymode_syntax_string_formatting = 0
" let g:pymode_syntax_string_templates = 0
"
" " For fast machines
" " let g:pymode_syntax_slow_sync = 0
" " overwrite
" " -----------------------------------------------------
" "
" " pylint dziala lepiej ale jest zawolny na przy kazdym zapisie
" let g:pymode_utils_whitespaces = 0
" " auto jump on/off
" let g:pymode_lint_jump = 1
" "let g:pymode_lint_select = 'E0611'
" let g:pymode_breakpoint = 0
" let g:pymode_breakpoint_key = '<leader>ib'
" let g:pymode_run = 0
" let g:pymode_virtualenv = 1
" "let g:pymode_run_key = '<leader>r'
"
function! AnsibleMappings()
nmap <buffer> <leader><c-l> :up<bar>call TrimWhiteSpace()<bar>w<bar>call TrimEndLines()<bar>w<bar>SyntasticCheck<cr>
nmap K :!ansible-doc <C-R><C-W> *<CR>
endfunction
au FileType yaml.ansible call AnsibleMappings()
""" -------------------------------------------
""" Python (mappings)
""" -------------------------------------------
function! PythonMappings()
" indent based on syntax
set nosmartindent
set colorcolumn=100
" remember iem!!!
nmap <buffer> <leader>ip o__import__('IPython').embed()<ESC>:w<cr>
" uzytecznosc mala przez !brak screen!
" nmap <buffer> <leader>iP ofrom vipdb import embed;embed()<ESC>:w<cr> "
" ipython debug
nmap <buffer> <leader>id oimport ipdb;ipdb.set_trace()<ESC>:w<cr>
nmap <buffer> <leader>iv oimport vipdb;vipdb.set_trace()<ESC>:w<cr>
nmap <buffer> <leader><c-l> :up<bar>call TrimWhiteSpace()<bar>w<bar>call TrimEndLines()<bar>w<bar>call Flake8()<cr>
nmap <buffer> <leader>L :call Flake8()<cr>
" " pudb debugger
" nmap <buffer> <leader>iu o<esc>Simport pudb;pudb.set_trace()<ESC>:w<cr>
"" fix na diff doget - z brancha johntyree python-mode
" ounmap <silent> <buffer> o
"" python run
nmap <buffer> <F9> :silent up\|QuickRun -split 10<cr>
vmap <buffer> <F9> :QuickRun -split 10<cr>
" map <F9> :up<bar>!/usr/bin/env python %<CR>
map <leader><F9> :up<bar>!/usr/bin/env python %
map <buffer> <F10> :up<bar>Pytest file<cr>
map <buffer> <F11> :up<bar>Pytest function --pdb<cr>
map <buffer> <F12> :up<bar>Pytest method<cr>
" map <buffer> <m-F10> :up<bar>Pytest method<cr>
" map <buffer> <s-F10> :up<bar>Pytest class<cr>
"
" map <leader>g :RopeGotoDefinition<cr>
" works badly
" inoremap <silent> <buffer> <tab> <C-R>=RopeCodeAssistInsertMode()<CR>
"
compiler python
" wytlacz elcim i signs
" terminal test
" TESTY OFF
" nmap <silent> <leader>tt :w<bar>call VimuxOpenRunner()<bar>call VimuxSendText("nosetests -v -d -s <c-r>%:<c-r>=tagbar#currenttag('%s','', 'f')<cr>")<bar>call VimuxSendKeys("enter")<cr>
" termianal python
map <leader>tp :up<bar>pyx sendtmux("python <c-r>%")<cr>
map <leader>ti :up<bar>pyx sendtmux("ipython -i <c-r>%")<cr>
map <leader>tI :up<bar>pyx sendtmux("ipython --pdb -i <c-r>%")<cr>
map <leader>tu :up<bar>pyx sendtmux("pytest -v -s <c-r>%")<cr>
map <buffer> <leader>tU :up<bar>:pyx sendtmux("pytest -s -vv -k '%s' <c-r>%"%current_test())<cr>
" ##### fixes for older jedi versions
" nnoremap gd :call jedi#clear_cache(0)<bar>call jedi#goto_assignments()<bar>call jedi#goto_assignments()<cr>
" Version below doesn't work with types as assignments!
" nnoremap gd :call jedi#clear_cache(0)<bar>call jedi#goto()<cr>
map gd :call jedi#goto()<cr>
map gu :call jedi#usages()<cr>
map <leader>gd :let g:jedi#use_splits_not_buffers="bottom"<bar> call jedi#goto()<bar>let g:jedi#use_splits_not_buffers=""<cr>
map <c-w>d :let g:jedi#use_splits_not_buffers='right'<bar> call jedi#goto()<bar>let g:jedi#use_splits_not_buffers=''<cr>
map gD :let g:jedi#use_splits_not_buffers='left'<bar> call jedi#goto()<bar>let g:jedi#use_splits_not_buffers=''<cr>
""" -----------------------------
""" Python python functions
""" -----------------------------
" original version
" nmap <leader>ty :compiler! python<cr>:set makeprg=./run_tests.py\ <c-r>=tagbar#currenttag('%s','')<cr><cr>:Make<cr>
if !has('python3')
py3 <<EOF
last_test_tag = None
from vim import eval as e
from vim import command as c
def _make_test(tag):
c(':up')
c(':compiler! python')
c(r":set makeprg=XTB\=off\ ./run_tests.py\ %s"%tag)
c(':Make')
def make_current_test():
'run current tag in Make'
global last_test_tag
last_test_tag = e("tagbar#currenttag('%s','')")
_make_test(last_test_tag)
def make_last_test():
'rerun last runned test'
if not last_test_tag:
return
_make_test(last_test_tag)
EOF
endif
""" Testing
" terminal yank test
"""" nmap <leader>ty :pyx make_current_test()<cr>
" terminal global test
"""" nmap <leader>tg :pyx make_last_test()<cr>
" termianl yank all tests
nmap <leader>tY :compiler! python<cr>:set makeprg=./run_tests.py<cr><cr>:Make<cr>
""" next method remaping
nmap ]m ]M
nmap [m [M
"" jedi rename (mapping by hand because, we want <leader>r as rerun
nmap <leader>R :call jedi#rename()<cr>
nmap <buffer> <leader>r :up<bar>:pyx sendtmux('c-p')<cr>
endfunction
"au FileType python call PythonMappings()
""" -------------------------------------------
""" Python disassembled
""" -------------------------------------------
au BufRead,BufNewFile *.pyc_dis set filetype=python
""" -------------------------------------------
""" Flake8
""" -------------------------------------------
" https://github.com/nvie/vim-flake8#max-line-lengths
" ~/.config/flake8
" [flake8]
" max-line-length = 120
""" flake8 vim - F7 or L
let no_flake8_maps=1
let g:flake8_show_in_gutter=1
let g:flake8_show_quickfix=0
""" -------------------------------------------
""" XML mappings
""" -------------------------------------------
function! XMLMappings()
vmap <buffer> gq :!xmllint --format -<cr>
endfunction
au FileType xml call XMLMappings()
""" -------------------------------------------
""" JSON mappings
""" -------------------------------------------
function! JSONMappings()
map <buffer> gq :%!jq '.'<cr>
endfunction
au FileType json call JSONMappings()
""" -------------------------------------------
""" RUBY
""" -------------------------------------------
function! RubyMappings()
""" binding pry
nmap <buffer> <leader>ip obinding.pry<ESC>:w<cr>
""" ruby run
nmap <buffer> <F9> :up\|!ruby %<cr>
imap <buffer> <F9> <Esc><f9>
nmap <buffer> <leader><F9> :up\|!ruby %
""" navgigation goto
" map <leader>g <C-]>
nmap gd <C-]>
endfunction
au FileType ruby call RubyMappings()
" ruby/thor
au BufRead,BufNewFile *.thor set filetype=ruby
""" -------------------------------------------
""" Rust
""" -------------------------------------------
function! RustMappings()
nmap <buffer> <F9> :up<cr>:QuickRun<cr>
endfunction
"au FileType rust call GoMappings()
""" -------------------------------------------
""" Present
""" -------------------------------------------
function! PresentMappings()
setlocal noautoindent
setlocal nocindent
setlocal nosmartindent
setlocal indentexpr=
setlocal ts=150
endfunction
au FileType present call PresentMappings()
""" -------------------------------------------
""" Golang
""" -------------------------------------------
function! GoMappings()
" go lint :(
"set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
"just use GoLint
map <buffer> <leader>L :up<bar>GoLint<cr>
" nmap <buffer> <leader>r <f9>
nmap <buffer> <leader>R :GoRename<cr>
""" running
" nmap <buffer> <F9> :up\|!go run %<cr>
nmap <buffer> <F9> :silent up\|QuickRun -split 5<cr>
nmap <buffer> <leader><F9> :GoRun<cr>
""" building (GoBuild won't produce binary)
nmap <buffer> <F10> :up<bar>GoBuild<cr>
"nmap <buffer> <leader><F10> :up<bar>make<cr>
nmap <buffer> <leader><F10> :up<bar>GoTestCompile<cr>
""" testing (GoBuild won't produce binary)
nmap <buffer> <F11> :up<bar>GoTestFunc<cr>
nmap <buffer> <leader><F11> :up<bar>GoTest<cr>
""" running in terminal
""" ------------- tests
""" selected package relative to cwd of vim
map <buffer> <leader>tu :up<bar>:pyx sendtmux("go test -v ./<c-r>=fnamemodify(expand("%:h:p"), ":~:.")<cr>")<cr>
""" selected file - not usefull!
" map <buffer> <leader>tP :up<bar>:pyx sendtmux("go test -v ./<c-r>%")<cr>
""" current tests
" map <buffer> <leader>tU :up<bar>:pyx sendtmux("go test -v -run '%s$'"%current_test())<cr>
map <buffer> <leader>tU :up<bar>:pyx sendtmux("go test -v -run '%s$' ./<c-r>=fnamemodify(expand("%:h:p"), ":.")<cr>"%current_test())<cr>
""" ------------ run
map <buffer> <leader>tp :up<bar>:pyx sendtmux("go run ./<c-r>%")<cr>
" handles case if you have _test.go files for your main package!
" map <buffer> <leader>tp :up<bar>:pyx sendtmux("(cd <c-r>=fnamemodify(expand("%:h:p"), ":~:.")<cr>;go run `go list -f '{{.GoFiles}}' \| tr -d '[]'`)")<cr>
" map <buffer> <leader>tp :up<bar>:pyx sendtmux("(cd <c-r>=fnamemodify(expand("%:h:p"), ":~:.")<cr>;go run `go list -f '{{.GoFiles}}' \| tr -d '[]'`)")<cr>
" doesn't work on osx and testy
" expand - current file, with home and only path
" fnamemodify - reduce to be related to current directory
map <buffer> <leader>tP :up<bar>:pyx sendtmux("go run `go list -f '{{range $f := .GoFiles}} {{$.Dir}}/{{$f}}{{end}}' ./<c-r>=fnamemodify(expand("%:h:p"), ":.")<cr>`")<cr>
""" navgigation goto
" map <leader>g <C-]>
" nmap gd <C-]> # depracted by vim-godef
" nmap <buffer> K :GoDoc<cr>
" compiler go
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
" make supertab works better
" let g:SuperTabDefaultCompletionType = "context"
""" just works for go
" let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
""" context version (works for comments/files etc...)
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
" tstsss
let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc']
let g:SuperTabDefaultCompletionType = 'context'
autocmd FileType *
\ if &omnifunc != '' |
\ call SuperTabChain(&omnifunc, "<c-p>") |
\ endif
nnoremap <buffer> <Leader>A :exe 'GoImport ' . expand('<cword>')<CR>
" test current pkg
" nmap <leader>tt :up<bar>GoTest<cr>
" nmap <silent> <leader>m :up\|make<cr>
nmap <buffer> <leader>w :silent up<cr>
" automatic import
nmap <leader>a :GoImports<cr>:up<cr>
" based on:
" /home/dev/dotfiles/.vim/bundle/vim-go/ftplugin/go/commands.vim:60
" go def vertical
nmap <buffer> <c-w>d <Plug>(go-def-vertical)
nmap <buffer> gD <Plug>(go-def-vertical)
" go def horizontal
nmap <buffer> <leader>gd <Plug>(go-def-split)
" command! -nargs=* -range GoDefVsplit :call go#def#JumpMode("vsplit")
" nmap <silent> gD :GoDefVsplit<cr>
nmap <buffer> <leader>K <Plug>(go-doc-browser)
" calles/usage
nmap <buffer> <leader>z :GoImplements<cr>
nmap <buffer> <leader>Z :GoCallees<cr>
" syntastic active mode - now I can disable Syntastic with ToggleMode
" takes to much time during drv/test cycle
" let g:syntastic_mode_map = { 'mode': 'active' }
nmap <buffer> <leader>f "myiwh/\<<c-r>m\><cr>:GoInfo<cr>
nmap <buffer> <leader>F "myiwh/\<<c-r>m\><cr>:GoDescribe<cr>
nmap <buffer> <leader>H :GoReferrers<cr>
set path=,,$GOPATH/src
" set path=$GOPATH/src
" hiper dubugging with go
map <buffer> <Leader>ti :pyx startgdb()<cr>
map <buffer> <Leader>tk :pyx gdbrun()<cr>
" go cOntinue (without loc)
nmap go :pyx debug('continue')<cr>
" go next (gn - is now vim command!)
nmap <buffer> <leader>gn :pyx debug('next')<cr>
" go step
nmap gs :pyx debug('step')<cr>
" go location
nmap gl :pyx debug('ls')<cr>
" let g:go_guru_tags="sequential"
"
""" https://github.com/fatih/vim-go/blob/master/CHANGELOG.md#110-november-24-2016
" go command status (requires vim-go)
" conflicts with airline!
" set statusline+=%#goStatuslineColor#
" set statusline+=%{go#statusline#Show()}
" set statusline+=%*
endfunction
au FileType go call GoMappings()
""" -------------------------------------------
""" Shell
""" -------------------------------------------
function! ShMappings()
" works best
let g:SuperTabDefaultCompletionType = "<c-x><c-n>"
" works with tmux-complete
" let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
""""""""""""""" TRASH
" let g:SuperTabDefaultCompletionType = "context"
" let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc']
" make supertab works better
""" just works for go