-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.ideavimrc
More file actions
69 lines (51 loc) · 1.48 KB
/
.ideavimrc
File metadata and controls
69 lines (51 loc) · 1.48 KB
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
" ATTRIBUTION:
" https://github.com/fdietze/dotfiles/blob/master/.ideavimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PLUGINS
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SETTINGS
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
let mapleader = " "
set scrolloff=5
" Disable audible bell
set noerrorbells
set novisualbell
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
" edit ideavim config
nnoremap <leader>vv :e ~/.ideavimrc<CR>
nnoremap <leader>vr :source ~/.ideavimrc<CR>
set relativenumber
set surround
set ideajoin
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" FIX VIM ANNOYANCES
" make Y behave like D and C, yanking till end of line
map Y y$
" don't overwrite register when pasting over selection
vnoremap p pgvy
" paste over rest of line
" nnoremap <leader>p v$<Left>pgvy
nnoremap <leader>p v$<Left>p
" don't lose selection when indenting
vnoremap < <gv
vnoremap > >gv
vnoremap = =gv
" Fix HOME behavior
nmap <Home> ^
imap <silent> <Home> <C-O>^
""""""""""""""""""""""""""""""""""""""""""""""""""""
" IDEA specific
nmap <leader>? :action GotoAction<CR>
nmap <leader>e :action GotoFile<CR>
nmap gr :action ShowUsages<CR>
nmap gi :action GotoImplementation<CR>
nmap gs :action GotoSuperMethod<CR
nmap <leader>f :action ReformatCode<CR>>
nmap <leader>gr :action Vcs.RollbackChangedLines<CR>