-
Notifications
You must be signed in to change notification settings - Fork 2
/
ideavimrc
79 lines (56 loc) · 1.79 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
set number
set relativenumber
set scrolloff=8
set clipboard=unnamed,ideaput
set ignorecase
set smartcase
set hlsearch
set incsearch
set visualbell
set ideamarks
let mapleader=','
" enable emulated extensions
set sneak " enable ideavim-sneak
set which-key " enable which-key plugin
set NERDTree
set surround
set commentary
set highlightedyank
" hide search highlighting with <esc>
nnoremap <esc> :nohlsearch<cr><esc>
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
nnoremap J <C-d>zz
vnoremap J <C-d>zz
nnoremap K <C-u>zz
vnoremap K <C-u>zz
" up/down work as expected with word wrapping on
nnoremap k gk
nnoremap j gj
nnoremap gk k
nnoremap gj j
" indent in visual mode with <tab>
vnoremap <tab> >gv
vnoremap <s-tab> <gv
nnoremap <S-l> :action NextTab<CR>
nnoremap <S-h> :action PreviousTab<CR>
nnoremap <leader>r :action RecentFiles<CR>
nnoremap <leader>d :action SelectInProjectView<CR>
nnoremap [d :action GotoNextError<CR>
nnoremap ]d :action GotoPreviousError<CR>
nnoremap gd :action GotoDeclaration<CR>
nnoremap <leader>ve :e ~/.ideavimrc<CR>
nnoremap <leader>vr :action IdeaVim.ReloadVimRc.reload<CR>
" see also ToggleZenMode (goes FULL screen then, though...)
nnoremap <leader>zz :action ToggleDistractionFreeMode<CR>
nnoremap <C-t> :action ActivateTerminalToolWindow<CR>
nnoremap [[ :action MethodUp<CR>
nnoremap ]] :action MethodDown<CR>
nnoremap <leader>zc :action CollapseAllRegions<CR>
nnoremap <leader>zo :action ExpandAllRegions<CR>
" NOTE: I mapped this one directly in Rider so that it works in the Solution
" Explorer, too (also called "New In This Directory...")
nnoremap <C-A-i> :action NewElementSamePlace<CR>
nnoremap <S-C-A-j> :action MoveStatementDown<CR>
nnoremap <S-C-A-k> :action MoveStatementUp<CR>
nmap <silent> <leader>s <Action>(EditorToggleShowWhitespaces)