-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
92 lines (82 loc) · 2.62 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
79
80
81
82
83
84
85
86
87
88
89
90
91
" Settings
nnoremap <SPACE> <Nop>
let mapleader = " "
let g:highlightedyank_highlight_duration = 300
set clipboard=unnamedplus,unnamed,ideaput
set hlsearch
set ignorecase
set incsearch
set number
set relativenumber
set scrolloff=4
set smartcase
set whichwrap+=<,>,h,l,[,]
" Plugins
set NERDTree
set argtextobj
set commentary
set highlightedyank
set matchit
set surround
" Resolve IDE keybinding conflicts
" https://github.com/JetBrains/ideavim/wiki/sethandler
sethandler <C-h> n:vim i-v:ide
sethandler <C-i> n:vim i-v:ide
sethandler <C-j> n:vim i-v:ide
sethandler <C-k> n:vim i-v:ide
sethandler <C-l> n:vim i-v:ide
sethandler <C-o> n:vim i-v:ide
sethandler <C-p> n:vim i-v:ide
sethandler <C-v> n-v:vim i:ide
" Mappings
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <C-p> :action GotoFile<CR>
nnoremap <C-o> :action Back<CR>
nnoremap <C-i> :action Forward<CR>
" Use :A to resemble vim-projectionist for jumping between impl and test
command! A action GotoTest
nnoremap <leader>// :action SearchEverywhere<CR>
nnoremap <leader>eb :action GotoPreviousError<CR>
nnoremap <leader>ee :action ShowErrorDescription<CR>
nnoremap <leader>ef :action GotoNextError<CR>
nnoremap <leader>el :action ActivateProblemsViewToolWindow<CR>
nnoremap <leader>ff :action ReformatCode<CR>
nnoremap <leader>hf :action VcsShowNextChangeMarker<CR>
nnoremap <leader>hb :action VcsShowPrevChangeMarker<CR>
nnoremap <leader>hr :action Vcs.RollbackChangedLines<CR>
nnoremap <leader>ja :action GotoTest<CR>
nnoremap <leader>jd :action GotoDeclaration<CR>
nnoremap <leader>ji :action GotoImplementation<CR>
nnoremap <leader>jr :action FindUsages<CR>
nnoremap <leader>jt :action GotoTypeDeclaration<CR>
nnoremap <leader>l<space> :action QuickFixes<CR>
nnoremap <leader>lf :action ReformatCode<CR>
nnoremap <leader>ll :action ShowHoverInfo<CR>
nnoremap <leader>lo :action OptimizeImports<CR>
nnoremap <leader>lr :action RenameElement<CR>
nnoremap <leader>nn :action EditorToggleShowLineNumbers<CR>
nnoremap <leader>nr :set relativenumber!<CR>
nnoremap <leader>p "+p
nnoremap <leader>P "+P
vnoremap <leader>p "_dP
nnoremap <leader>tt :NERDTreeToggle<CR>
nnoremap <leader><space> :nohlsearch<CR>
nnoremap <leader><bar> :vsplit<CR>
nnoremap <leader>- :split<CR>
" ∆ = alt-j (down)
" ˚ = alt-k (up)
" ˙ = alt-h (left)
" ¬ = alt-l (right)
nnoremap ∆ :action MoveLineDown<CR>
nnoremap ˚ :action MoveLineUp<CR>
nnoremap ˙ <<
nnoremap ¬ >>
vnoremap ∆ :'<,'>action MoveLineDown<CR>
vnoremap ˚ :'<,'>action MoveLineUp<CR>
vnoremap ˙ <<
vnoremap ¬ >>
" Allow machine-specific config under dotfiles-local
source ~/.config-local/ideavim/ideavimrc-local