-
Notifications
You must be signed in to change notification settings - Fork 1
/
.ideavimrc
73 lines (56 loc) · 2.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
"===============================================================================
"
" https://towardsdatascience.com/the-essential-ideavim-remaps-291d4cd3971b
"
" Enable key repeat:
" `defaults write com.jetbrains.intellij ApplePressAndHoldEnabled -bool false`
"
"===============================================================================
let mapleader = ','
"-------------------------------------------------------------------------------
" Search
"-------------------------------------------------------------------------------
set hlsearch
set incsearch
"-------------------------------------------------------------------------------
" <C-c>, <C-Backspace> and <C-g>
"-------------------------------------------------------------------------------
nnoremap <silent> <C-g> <C-g>:nohlsearch<Bar>:echo<CR>
inoremap <C-g> <Esc>
vnoremap <C-g> <Esc>
cnoremap <C-g> <Esc>
"-------------------------------------------------------------------------------
" Edit
"-------------------------------------------------------------------------------
" insert newline after current line
nmap <silent> <CR> o<Esc>
" insert newline before current line
nmap <silent> <S-CR> O<Esc>
" insert space
nmap <silent> <Space> i<Space><Esc>l
"-------------------------------------------------------------------------------
" Navigation
"-------------------------------------------------------------------------------
nnoremap H ^
nnoremap L g_
nnoremap <C-M-b> %
nnoremap <C-M-f> %
inoremap <C-a> <C-o>I
inoremap <C-b> <Left>
inoremap <C-e> <C-o>A
inoremap <C-f> <Right>
vnoremap H ^
vnoremap L g_
"-------------------------------------------------------------------------------
" Save
"-------------------------------------------------------------------------------
nnoremap <silent> <Tab> :w<CR>
"-------------------------------------------------------------------------------
" Actions
" https://gist.github.com/zchee/9c78f91cc5ad771c1f5d
"-------------------------------------------------------------------------------
nnoremap <leader>t :action SelectInProjectView<CR>
nnoremap <leader>n :action GotoFile<CR>
nnoremap <leader>/ :action FindInPath<CR>
nnoremap <leader><Space> :action CommentByLineComment<CR>
vnoremap <leader><Space> :action CommentByLineComment<CR>