-
Notifications
You must be signed in to change notification settings - Fork 5
/
.ideavimrc
89 lines (67 loc) · 1.98 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
" set leader key
let mapleader = " "
" reload config
nnoremap <leader>r :action IdeaVim.ReloadVimRc.reload<CR>
" plugin specific
set ideajoin
set showmode
set sneak
" no sounds on error
set visualbell
set noerrorbells
set t_vb=
set tm=500
" line numbers
set relativenumber
" Don't redraw while executing macros (good performance config)
set lazyredraw
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
nmap <leader>l <Action>(NextTab)
nmap <leader>h <Action>(PreviousTab)
nmap <leader>f <Action>(GotoFile)
nmap <leader>g <Action>(FindInPath)
" insert blank line
nmap <leader>o o<ESC>
nmap <leader>O O<ESC>
nmap = <Action>(ReformatCode)
vmap = <Action>(ReformatCode)
nnoremap <leader>u :action FindUsages<CR>
" copy current line to system clipboard
nnoremap <leader>cc "+yy
"" copy current file to system clipboard
"" - doen't work
" nnoremap <leader>cf <CMD>%y+<CR>
"" paste to the file (replace) from system clipboard
"" - doen't work
" nnoremap <leader>vf <CMD>%d<CR>"+p
" append ; to the end of line
inoremap <leader>; <Esc>A;<Esc>
nnoremap <leader>; <Esc>A;<Esc>
" scrolling
nmap <leader>d <C-d>
nmap <leader>u <C-u>
vmap <leader>d <C-d>
vmap <leader>u <C-u>
" press jk to exit from insert mode
imap jk <Esc>
imap kj <Esc>
nmap <leader>bb <Action>(CloseEditor)
nmap <leader>ba <Action>(CloseAllEditors)
nmap <leader>a <Action>(CloseProject)
nmap <leader>ga <Action>(Git.Add)
nmap gp <Action>(Git.Pull)
nmap gcc <Action>(CommentByLineComment)
vmap gc <Action>(CommentByLineComment)
nmap <leader>t <Action>(ActivateTerminalToolWindow)
nmap <leader>er <Action>(Run)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
" Find more examples here: https://jb.gg/share-ideavimrc