-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.ideavimrc
78 lines (66 loc) · 2.34 KB
/
.ideavimrc
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
" Shamelessly stolen from https://github.com/jqno/dotfiles/blob/master/ideavimrc thanks ouwens ;)
" Set Leader to Space.
let mapleader=" "
" Reload this file.
nnoremap <Leader>ll :source ~/.ideavimrc<CR>:echo "Reloaded .ideavimrc"<CR>
" Pleasant defaults.
Plug 'tpope/vim-surround'
Plug 'terryma/vim-multiple-cursors'
Plug 'machakann/vim-highlightedyank'
set clipboard=unnamed,unnamedplus,ideaput
set ignorecase
set nrformats-=octal
set number
" set relativenumber
" set scrolloff=4
set showmode
set sidescrolloff=5
set smartcase
set visualbell
" Search.
set hlsearch
noremap <Leader>/ <Esc>:nohlsearch<CR>
" When finding =, include the whitespace around it!
noremap t= /\s*=<CR>
noremap T= ?=\s*?e<CR>
" Navigate splits.
nnoremap <C-H> <C-W>h
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
" Indent and de-indent.
vnoremap < <gv
vnoremap > >gv
" Introduce shortcuts for my favourite refactorings.
" Also, go directly to insert mode when renaming or introducing a new variable.
nnoremap ,n :action RenameElement<CR>
nnoremap ,v :action IntroduceVariable<CR>
vnoremap ,v :action IntroduceVariable<CR>
nnoremap ,s :action SurroundWith<CR>
vnoremap ,s :action SurroundWith<CR>
nnoremap ,i :action Inline<CR>
nnoremap ,m :action ExtractMethod<CR>
vnoremap ,m :action ExtractMethod<CR>
nnoremap ,t :action Refactorings.QuickListPopupAction<CR>
vnoremap ,t :action Refactorings.QuickListPopupAction<CR>
" Some actions and movements
nnoremap <Leader>g :action Git.Add<CR>
nnoremap <Leader>h :action Replace<CR>
vnoremap <Leader>h :action Replace<CR>
nnoremap <Leader>f :action Find<CR>
nnoremap <Leader>c :action GotoClass<CR>
nnoremap <Leader>a :action GotoAction<CR>
nnoremap <Leader>t :action GotoTest<CR>
nnoremap <Leader>b :action GotoDeclaration<CR>
nnoremap <Leader>q :action QuickJavaDoc<CR>
nnoremap <Leader>d :action GotoDeclaration<CR>
" Run Operations
nnoremap <Leader><Leader>t :action RunClass<CR>
nnoremap <Leader><Leader>e :action Run<CR>
nnoremap <Leader><Leader>d :action Debug<CR>
" Bind 'git blame'. We have to call Annotate twice because it interacts weirdly with line numbers.
nnoremap <Leader><Leader>a :action Annotate<CR>:action Annotate<CR>
" Close all windows except active.
nnoremap <M-S-W> :action CloseAllEditorsButActive<CR>
" Hide all toolwindows and give focus to the edit pane.
" nnoremap <Leader><Leader>f :action HideAllWindows<CR>