-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
129 lines (110 loc) · 3.22 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
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
" Enable Which-Key
set which-key
set notimeout
" Enable IdeaVim plugins
set sneak
set surround
set multiple-cursors
set commentary
set argtextobj
set textobj-entire
set ReplaceWithRegister
set exchange
" Basic Settings
set showmode
set relativenumber
set number
set ignorecase
set smartcase
set incsearch
set hlsearch
set scrolloff=8
set history=1000
set clipboard+=unnamed
" LazyVim-style key mappings
let mapleader=" "
" Buffer Navigation
map <leader>] :action NextTab<CR>
map <leader>[ :action PreviousTab<CR>
map <leader>bd :action CloseEditor<CR>
map <leader>bD :action CloseAllEditorsButActive<CR>
" Window Management
map <leader>ww <C-W>w
map <leader>wd <C-W>c
map <leader>wh <C-W>h
map <leader>wj <C-W>j
map <leader>wk <C-W>k
map <leader>wl <C-W>l
map <leader>ws <C-W>s
map <leader>wv <C-W>v
" File Operations
map <leader>ff :action GotoFile<CR>
map <leader>fr :action RecentFiles<CR>
map <leader>fs :action SaveAll<CR>
" Code Navigation
map <leader>ca :action ShowIntentionActions<CR>
map <leader>cr :action RenameElement<CR>
map <leader>cf :action ReformatCode<CR>
map <leader>cd :action GotoDeclaration<CR>
map <leader>ci :action GotoImplementation<CR>
map <leader>cu :action FindUsages<CR>
map <leader>ch :action CallHierarchy<CR>
" Search
map <leader>ss :action Find<CR>
map <leader>sp :action FindInPath<CR>
map <leader>sr :action Replace<CR>
map <leader>sR :action ReplaceInPath<CR>
" Git
map <leader>gg :action Vcs.QuickListPopupAction<CR>
map <leader>gd :action Compare.LastVersion<CR>
map <leader>gb :action Git.Branches<CR>
map <leader>gl :action Vcs.Show.Log<CR>
map <leader>gp :action Vcs.Push<CR>
" LSP-like functionality
map <leader>lr :action RenameElement<CR>
map <leader>la :action ShowIntentionActions<CR>
map <leader>ld :action GotoDeclaration<CR>
map <leader>lf :action ReformatCode<CR>
map <leader>li :action GotoImplementation<CR>
map <leader>lt :action GotoTest<CR>
" Debug
map <leader>db :action ToggleLineBreakpoint<CR>
map <leader>dc :action Resume<CR>
map <leader>dd :action Debug<CR>
map <leader>dn :action StepOver<CR>
map <leader>di :action StepInto<CR>
map <leader>do :action StepOut<CR>
" Terminal
map <leader>tt :action ActivateTerminalToolWindow<CR>
" Which-Key configuration
let g:WhichKeyDesc_buffer = "<leader>b Buffer operations"
let g:WhichKeyDesc_window = "<leader>w Window operations"
let g:WhichKeyDesc_file = "<leader>f File operations"
let g:WhichKeyDesc_search = "<leader>s Search operations"
let g:WhichKeyDesc_git = "<leader>g Git operations"
let g:WhichKeyDesc_lsp = "<leader>l LSP operations"
let g:WhichKeyDesc_code = "<leader>c Code operations"
let g:WhichKeyDesc_debug = "<leader>d Debug operations"
let g:WhichKeyDesc_terminal = "<leader>t Terminal operations"
" Additional IDE specific features
map <leader>ru :action RunClass<CR>
map <leader>rd :action DebugClass<CR>
map <leader>rb :action BuildProject<CR>
" Exit insert mode with jk
inoremap jk <Esc>
" Center search results
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#zz
" Keep cursor centered when scrolling
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
" Maintain visual selection when indenting
vnoremap > >gv
vnoremap < <gv
" Move selected lines up and down
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv