-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_ideavimrc
147 lines (125 loc) · 3.58 KB
/
dot_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
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
" IdeaVim action list - https://gist.github.com/zchee/9c78f91cc5ad771c1f5d
" Options
set fileencoding="utf-8"
set hlsearch
set incsearch
set ignorecase
set smartcase
set smartindent
set splitbelow
set splitright
set tabstop = 4
set noswapfile
set undofile
set undolevels=10000
set undoreload=10000
set expandtab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set cursorline
set relativenumber number
set wrap
set nolinebreak
set scrolloff=8
set sidescrolloff=8
set showmode
set clipboard+=unnamed
set ideajoin
set ideastatusicon=enabled
set ideavimsupport=dialog
" Plugins
set NERDTree
set easymotion
set surround
set highlightedyank
let g:highlightedyank_highlight_duration = "1500"
let g:highlightedyank_highlight_color = "rgba(124, 227, 139, 55)"
" Set Leader Key
let mapleader = " "
nnoremap <Space> <Nop>
map <S-Space> <Leader>
" File Actions
nnoremap <Leader>q :action CloseEditor<CR>
nnoremap <Leader>w :action SaveDocument<CR>
" Harpoon
nmap <Leader>; :action ShowHarpoon<CR>
nmap <Leader>a :action AddToHarpoon<cr>
nmap <Leader>1 :action GotoHarpoon1<cr>
nmap <Leader>2 :action GotoHarpoon2<cr>
nmap <Leader>3 :action GotoHarpoon3<cr>
nmap <Leader>4 :action GotoHarpoon4<cr>
nmap <Leader>5 :action GotoHarpoon5<cr>
" Command Palette
nmap <Leader>c <Action>(GotoAction)
" Navigate Files
nnoremap <Leader>t :NERDTree<CR>
nnoremap <Leader>f :action GotoFile<CR>
vnoremap <Leader>f :action GotoFile<CR>
nnoremap <Leader>g :action FindInPath<CR>
vnoremap <Leader>g :action FindInPath<CR>
nmap <Leader>o <Action>(RecentFiles)
nmap <Leader>O <Action>(RecentChangedFiles)
" Vertical navigation
nnoremap K <C-u>zz
nnoremap J <C-d>zz
nmap s <Plug>(easymotion-bd-f)
nmap <Leader>s <Action>(FileStructurePopup)
nmap <Leader>S <Action>(ActivateStructureToolWindow)
" Clear search highlight
map <Leader>/ :noh<CR>
" Navigate Jump List
nmap L <Action>(Forward)
nmap H <Action>(Back)
" Navigate Open Panes
nnoremap <Leader>h <C-w>h
nnoremap <Leader>j <C-w>j
nnoremap <Leader>k <C-w>k
nnoremap <Leader>l <C-w>l
" Split Panes
noremap <Leader>V :action SplitHorizontally<CR>
noremap <Leader>v :action SplitVertically<CR>
nnoremap <Leader>u :action Unsplit<CR>
" Switch between IDE windows
nmap <Leader>n <Action>(HideAllWindows)
map <leader>b <Action>(JumpToLastWindow)
" Indent Text
vnoremap <Tab> :action EditorIndentLineOrSelection<CR>
vnoremap <S-tab> :action EditorUnindentSelection<CR>
nnoremap <Tab> :action EditorIndentLineOrSelection<CR>
nnoremap <S-tab> :action EditorUnindentSelection<CR>
" Move Lines
vnoremap <C-j> :action MoveLineDown<CR>
vnoremap <C-k> :action MoveLineUp<CR>
nnoremap <C-j> :action MoveLineDown<CR>
nnoremap <C-k> :action MoveLineUp<CR>
" Refactor
map <leader>r <Action>(RenameElement)
noremap <Leader>p :action ReformatCode<CR>
" Get / Goto
nmap gd <Action>(GotoDeclaration)
nmap gD <Action>(QuickImplementations)
nmap gn <Action>(GotoNextError)
nmap gN <Action>(GotoPreviousError)
nmap ge <Action>(ActivateTODOToolWindow)
nmap gu <Action>(FindUsages)
nmap gp <Action>(ParameterInfo)
nmap gh <Action>(QuickJavaDoc)
" alt + enter -> ShowIntentionActions
" ctrl + space -> CodeCompletion
" Join lines fix
nmap gJ <Action>(EditorJoinLines)
" Toggle relative or absolute line numbers
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber number
endif
endfunction
nnoremap <Leader><Tab> :call NumberToggle()<CR>
nmap <Leader>ir <Action>(IdeaVim.ReloadVimRc.reload)
" ======================================================= "
"small goto def preview window -> QuickImplementations
"nmap gi <Action>(GotoImplementation)
"nmap ga <Action>(GotoAction)