-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc-4.2-fedora.vim
727 lines (573 loc) · 20.8 KB
/
vimrc-4.2-fedora.vim
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
" Jai Swaminarayan
" To use fancy symbols wherever possible, change this setting from 0 to 1
" and use a font from https://github.com/ryanoasis/nerd-fonts in your terminal
" (if you aren't using one of those fonts, you will see funny characters here.
" Turst me, they look nice when using one of those fonts).
let mapleader = ","
let fancy_symbols_enabled = 0
set encoding=utf-8
let using_neovim = has('nvim')
let using_vim = !using_neovim
let vim_plug_just_installed = 0
if using_neovim
let vim_plug_path = expand('~/.config/nvim/autoload/plug.vim')
else
let vim_plug_path = expand('~/.vim/autoload/plug.vim')
endif
if !filereadable(vim_plug_path)
echo "Installing Vim-plug..."
echo ""
if using_neovim
silent !mkdir -p ~/.config/nvim/autoload
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
else
silent !mkdir -p ~/.vim/autoload
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
let vim_plug_just_installed = 1
endif
" manually load vim-plug the first time
if vim_plug_just_installed
:execute 'source '.fnameescape(vim_plug_path)
endif
" Vundle Starts -------------------------------------------------------------
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin '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.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" Custom Plugins Starts ------------------------------------------------------------------
" Override configs by directory
Plugin 'arielrossanigo/dir-configs-override.vim'
" Code commenter
Plugin 'scrooloose/nerdcommenter'
" Better file browser
Plugin 'scrooloose/nerdtree'
" Class/module browser
Plugin 'majutsushi/tagbar'
" Search results counter
Plugin 'vim-scripts/IndexedSearch'
" A couple of nice colorschemes
" Plug 'fisadev/fisa-vim-colorscheme'
Plugin 'patstockwell/vim-monokai-tasty'
" Airline
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" Code and files fuzzy finder
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plugin 'junegunn/fzf.vim'
" Pending tasks list
Plugin 'fisadev/FixedTaskList.vim'
Plugin 'Shougo/deoplete.nvim'
Plugin 'roxma/nvim-yarp'
Plugin 'roxma/vim-hug-neovim-rpc'
" Python autocompletion
Plugin 'deoplete-plugins/deoplete-jedi'
" Completion from other opened files
Plugin 'Shougo/context_filetype.vim'
" Just to add the python go-to-definition and similar features, autocompletion
" from this plugin is disabled
Plugin 'davidhalter/jedi-vim'
" Automatically close parenthesis, etc
Plugin 'Townk/vim-autoclose'
" Surround
Plugin 'tpope/vim-surround'
" Indent text object
Plugin 'michaeljsmith/vim-indent-object'
" Indentation based movements
Plugin 'jeetsukumaran/vim-indentwise'
" Better language packs
Plugin 'sheerun/vim-polyglot'
" Ack code search (requires ack installed in the system)
Plugin 'mileszs/ack.vim'
" Paint css colors with the real color
Plugin 'lilydjwg/colorizer'
" Window chooser
Plugin 't9md/vim-choosewin'
" Automatically sort python imports
Plugin 'fisadev/vim-isort'
" Highlight matching html tags
Plugin 'valloric/MatchTagAlways'
" Generate html in a simple way
Plugin 'mattn/emmet-vim'
" Git integration(---------------------Error-------------------)
" Plugin 'tpope/vim-fugitive'
" Git/mercurial/others diff icons on the side of the file lines
"Plug 'mhinz/vim-signify'
" Yank history navigation
Plugin 'vim-scripts/YankRing.vim'
" Linters
Plugin 'neomake/neomake'
" Relative numbering of lines (0 is the current line)
" (disabled by default because is very intrusive and can't be easily toggled
" on/off. When the plugin is present, will always activate the relative
" numbering every time you go to normal mode. Author refuses to add a setting
" to avoid that)
Plugin 'myusuf3/numbers.vim'
" Nice icons in the file explorer and file type status line.
Plugin 'ryanoasis/vim-devicons'
" Vim Commentary
" Plugin 'tpope/vim-commentary'
Plugin 'tomtom/tcomment_vim'
" Django
Plugin 'tweekmonster/django-plus.vim'
" Javascript Correct Indentation
Plugin 'jiangmiao/simple-javascript-indenter'
" NodeJS
" ctrl + x, ctrl + o
Plugin 'myhere/vim-nodejs-complete'
" Java
Plugin 'artur-shaik/vim-javacomplete2'
" Python Autoimport
Plugin 'mgedmin/python-imports.vim'
" Plugin 'wookayin/vim-autoimport'
" Consoles as buffers (neovim has its own consoles as buffers)
" Plug 'rosenfeld/conque-term'
" XML/HTML tags navigation (neovim has its own)
" Plug 'vim-scripts/matchit.zip'
" Custom Plugins Ends --------------------------------------------------------------------
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Vundle Ends -------------------------------------------------------------
" *******************************************************************
" A bunch of things that are set by default in neovim, but not in vim
" no vi-compatible
set nocompatible
" allow plugins by file type (required for plugins!)
filetype plugin on
filetype indent on
" always show status bar
set ls=2
" incremental search
set incsearch
" highlighted search results
set hlsearch
" syntax highlight on
syntax on
" better backup, swap and undos storage for vim (nvim has nice ones by
" default)
set directory=~/.vim/dirs/tmp " directory to place swap files in
set backup " make backup files
set backupdir=~/.vim/dirs/backups " where to put backup files
set undofile " persistent undos - undo after you re-open the file
set undodir=~/.vim/dirs/undos
set viminfo+=n~/.vim/dirs/viminfo
" create needed directories if they don't exist
if !isdirectory(&backupdir)
call mkdir(&backupdir, "p")
endif
if !isdirectory(&directory)
call mkdir(&directory, "p")
endif
if !isdirectory(&undodir)
call mkdir(&undodir, "p")
endif
" *******************************************************************
" tabs and spaces handling
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" show line numbers
set nu
set rnu
" remove ugly vertical lines on window division
set fillchars+=vert:\
" use 256 colors when possible
if has('gui_running') || using_neovim || (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256')
if !has('gui_running')
let &t_Co = 256
endif
colorscheme vim-monokai-tasty
else
colorscheme delek
endif
" needed so deoplete can auto select the first suggestion
set completeopt+=noinsert
" comment this line to enable autocompletion preview window
" (displays documentation related to the selected completion option)
" disabled by default because preview makes the window flicker
set completeopt-=preview
" autocompletion of files and commands behaves like shell
" (complete only the common part, list the options that match)
set wildmode=list:longest
" save as sudo
ca w!! w !sudo tee "%"
" tab navigation mappings
map tt :tabnew
map <M-Right> :tabn<CR>
imap <M-Right> <ESC>:tabn<CR>
map <M-Left> :tabp<CR>
imap <M-Left> <ESC>:tabp<CR>
" when scrolling, keep cursor 3 lines away from screen border
set scrolloff=3
" clear search results
nnoremap <silent> // :noh<CR>
" clear empty spaces at the end of lines on save of python files
autocmd BufWritePre *.py :%s/\s\+$//e
" fix problems with uncommon shells (fish, xonsh) and plugins running commands
" (neomake, ...)
set shell=/bin/bash
" Ability to add python breakpoints
" (I use ipdb, but you can change it to whatever tool you use for debugging)
au FileType python map <silent> <leader>b Oimport ipdb; ipdb.set_trace()<esc>
" ============================================================================
" Plugins settings and mappings
" Edit them as you wish.
" Tagbar -----------------------------
" toggle tagbar display
map <F4> :TagbarToggle<CR>
" autofocus on tagbar open
let g:tagbar_autofocus = 1
" NERDTree -----------------------------
" toggle nerdtree display
map <F3> :NERDTreeToggle<CR>
" open nerdtree with the current file selected
nmap ,t :NERDTreeFind<CR>
" don;t show these file types
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
" Enable folder icons
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:DevIconsEnableFoldersOpenClose = 1
" Fix directory colors
highlight! link NERDTreeFlags NERDTreeDir
" Remove expandable arrow
let g:WebDevIconsNerdTreeBeforeGlyphPadding = ""
let g:WebDevIconsUnicodeDecorateFolderNodes = v:true
let NERDTreeDirArrowExpandable = "\u00a0"
let NERDTreeDirArrowCollapsible = "\u00a0"
let NERDTreeNodeDelimiter = "\x07"
" Autorefresh on tree focus
function! NERDTreeRefresh()
if &filetype == "nerdtree"
silent exe substitute(mapcheck("R"), "<CR>", "", "")
endif
endfunction
autocmd BufEnter * call NERDTreeRefresh()
" Tasklist ------------------------------
" show pending tasks list
map <F2> :TaskList<CR>
" Neomake ------------------------------
" Run linter on write
autocmd! BufWritePost * Neomake
" Check code as python3 by default
let g:neomake_python_python_maker = neomake#makers#ft#python#python()
let g:neomake_python_flake8_maker = neomake#makers#ft#python#flake8()
let g:neomake_python_python_maker.exe = 'python3 -m py_compile'
let g:neomake_python_flake8_maker.exe = 'python3 -m flake8'
" Disable error messages inside the buffer, next to the problematic line
let g:neomake_virtualtext_current_error = 0
" Fzf ------------------------------
" file finder mapping
nmap ,e :Files<CR>
" tags (symbols) in current file finder mapping
nmap ,g :BTag<CR>
" the same, but with the word under the cursor pre filled
nmap ,wg :execute ":BTag " . expand('<cword>')<CR>
" tags (symbols) in all files finder mapping
nmap ,G :Tags<CR>
" the same, but with the word under the cursor pre filled
nmap ,wG :execute ":Tags " . expand('<cword>')<CR>
" general code finder in current file mapping
nmap ,f :BLines<CR>
" the same, but with the word under the cursor pre filled
nmap ,wf :execute ":BLines " . expand('<cword>')<CR>
" general code finder in all files mapping
nmap ,F :Lines<CR>
" the same, but with the word under the cursor pre filled
nmap ,wF :execute ":Lines " . expand('<cword>')<CR>
" commands finder mapping
nmap ,c :Commands<CR>
" Deoplete -----------------------------
" Use deoplete.
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'ignore_case': v:true,
\ 'smart_case': v:true,
\})
" complete with words from any opened file
let g:context_filetype#same_filetypes = {}
let g:context_filetype#same_filetypes._ = '_'
" Jedi-vim ------------------------------
" Disable autocompletion (using deoplete instead)
let g:jedi#completions_enabled = 0
" All these mappings work only for python code:
" Go to definition
let g:jedi#goto_command = ',d'
" Find ocurrences
let g:jedi#usages_command = ',o'
" Find assignments
let g:jedi#goto_assignments_command = ',a'
" Go to definition in new tab
nmap ,D :tab split<CR>:call jedi#goto()<CR>
" Ack.vim ------------------------------
" mappings
nmap ,r :Ack
nmap ,wr :execute ":Ack " . expand('<cword>')<CR>
" Window Chooser ------------------------------
" mapping
nmap - <Plug>(choosewin)
" show big letters
let g:choosewin_overlay_enable = 1
" Signify ------------------------------
" this first setting decides in which order try to guess your current vcs
" UPDATE it to reflect your preferences, it will speed up opening files
let g:signify_vcs_list = ['git', 'hg']
" mappings to jump to changed blocks
nmap <leader>sn <plug>(signify-next-hunk)
nmap <leader>sp <plug>(signify-prev-hunk)
" nicer colors
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167
highlight DiffChange cterm=bold ctermbg=none ctermfg=227
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227
" Autoclose ------------------------------
" Fix to let ESC work as espected with Autoclose plugin
" (without this, when showing an autocompletion window, ESC won't leave insert
" mode)
let g:AutoClosePumvisible = {"ENTER": "\<C-Y>", "ESC": "\<ESC>"}
" Yankring -------------------------------
if using_neovim
let g:yankring_history_dir = '~/.config/nvim/'
" Fix for yankring and neovim problem when system has non-text things
" copied in clipboard
let g:yankring_clipboard_monitor = 0
else
let g:yankring_history_dir = '~/.vim/dirs/'
endif
" Airline ------------------------------
let g:airline_powerline_fonts = 0
let g:airline_theme = 'bubblegum'
let g:airline#extensions#whitespace#enabled = 0
" Fancy Symbols!!
if fancy_symbols_enabled
let g:webdevicons_enable = 1
" custom airline symbols
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
else
let g:webdevicons_enable = 0
endif
" Custom configurations ----------------
" Include user's custom nvim configurations
if using_neovim
let custom_configs_path = "~/.config/nvim/custom.vim"
else
let custom_configs_path = "~/.vim/custom.vim"
endif
if filereadable(expand(custom_configs_path))
execute "source " . custom_configs_path
endif
" ---------------------------------------
" Comment
autocmd FileType apache set commentstring=#\ %s
" ----------------------------------------
" Backspace
set backspace=indent,eol,start
" ----------------------------------------
" My Shortcuts
" Run Python
" map <F5> <Esc>:w<CR>:!clear;python3 %<CR>
"short cut to toggle Nerd Tree
map <silent> <C-b> :NERDTreeToggle<CR>
" ----------------------------------------
" Nerd Tree Settings
" make NERDTree always open on the right side
let g:NERDTreeWinPos = "right"
""How can I open a NERDTree automatically when vim starts up?
"autocmd vimenter * NERDTree
"" How can I open a NERDTree automatically when vim starts up if no files were specified?
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" ----------------------------------------
" Rename tabs to show tab number.
" (Based on http://stackoverflow.com/questions/5927952/whats-implementation-of-vims-default-tabline-function)
if exists("+showtabline")
function! MyTabLine()
let s = ''
let wn = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' '
let wn = tabpagewinnr(i,'$')
let s .= '%#TabNum#'
let s .= i
" let s .= '%*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let bufnr = buflist[winnr - 1]
let file = bufname(bufnr)
let buftype = getbufvar(bufnr, 'buftype')
if buftype == 'nofile'
if file =~ '\/.'
let file = substitute(file, '.*\/\ze.', '', '')
endif
else
let file = fnamemodify(file, ':p:t')
endif
if file == ''
let file = '[No Name]'
endif
let s .= ' ' . file . ' '
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
set showtabline=1
highlight link TabNum Special
endif
" Highlights current line in Insert Mode-----------------
" autocmd InsertEnter,InsertLeave * set cul!
" Comment ----------
map <C-\> gcc
" Switch Vim Tabs ------------
nnoremap <S-h> gT
nnoremap <S-l> gt
nnoremap <S-Tab> gt
" Show Expandable icons in NERDTree ---------
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
" Disabling arrow keys -----
map <Down> <Nop>
map <Up> <Nop>
map <Right> <Nop>
map <Left> <Nop>
" Shifting splits more effieiently
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" To move to command mode instantly
inoremap jj <ESC>
" To save file instantly
nmap <leader>w <Esc>:w<CR>
" To save file instantly in insert mode
imap <leader>w <Esc>:w<CR>
" To copy paste in and from `+` register instantly
" noremap <C-c> "+y
" noremap <C-v> "+p
" Select and Copy All Lines in + Register
noremap <C-t> <Esc>:%y+<CR>
" Indent all lines in current working file
noremap <C-i> <Esc>mcgg=G`c
" Transparent Background -----------------
" hi Normal guibg=NONE ctermbg=NONE
" Go to Last opened position of File
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" Map ,, for Html, css, js
imap ,, <C-y>,
" To chnage cursor
" https://stackoverflow.com/questions/6488683/how-do-i-change-the-cursor-between-normal-and-insert-modes-in-vim
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
" Optionally reset the cursor on start:
augroup myCmds
au!
autocmd VimEnter * silent !echo -ne "\e[2 q"
augroup END
" Saving sessions while newd Tree is open can cause Errors.
" NERDTree doesn't save the tree to disk, so it cannot be restored
set sessionoptions-=blank
" enable line numbers in NERDTree
" let NERDTreeShowLineNumbers=1
" make sure relative line numbers are used
" autocmd FileType nerdtree setlocal relativenumber
inoremap <leader>sys System.out.println();<Esc>hi""<Esc>i
inoremap <leader>psv public static void main(String[] args){<CR>}<Esc>ko
inoremap <leader>for for(int i = 0; i < n; i++){<CR>}<Esc>ko
inoremap <leader>jai Jai Swaminarayan
" Press , and `D` to make block comment
set breakindent
set breakindentopt=shift:0,min:40,sbr
set showbreak=--
" Detect to comment out javascript and CSS.
let g:tcomment#filetype#guess_htmldjango=1
" New Line in vim and goes to insert mode
" nmap <CR> o
" Press , and `D` to make block comment
map <leader>D <C-_>a django_block<CR>
" Press , and `d` to make inline comment which is default
map <leader>d <C-_>a django_inline<CR>
" https://github.com/artur-shaik/vim-javacomplete2/
" vim-javacomplete2
autocmd FileType java setlocal omnifunc=javacomplete#Complete
nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
" To enable smart (trying to guess import option) inserting class imports with F4, add:
nmap <F5> <Plug>(JavaComplete-Imports-Add)
" To enable usual (will ask for import option) inserting class imports with F5, add:
nmap <F5> <Plug>(JavaComplete-Imports-Add)
imap <F5> <Plug>(JavaComplete-Imports-Add)
" To add all missing imports with F6:
nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
" To remove all unused imports with F7:
nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
" Python vim-autoimport
map <F2> :ImportName<CR>
map <C-F2> :ImportNameHere<CR>
" nmap <silent> <F2> :ImportSymbol<CR>
" imap <silent> <F2> <Esc>:ImportSymbol<CR>a
" Remove Comments
map <leader>yi yitvatp
" Bind Esc in Caps Lock
au VimEnter * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
au VimLeave * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock'
" For Copy Paste(Fedora)
set clipboard=unnamedplus