-
Notifications
You must be signed in to change notification settings - Fork 2
/
ideavimrc
77 lines (57 loc) · 1.65 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
" Quick editing
nnoremap ,ev :e ~/dotfiles/ideavimrc<cr>
" Reload .ideavimrc
nnoremap ,lv :source ~/dotfiles/ideavimrc<cr>
" Enable relative line numbers
set number
set relativenumber
" Set 3 lines to the cursor - when moving vertically
set scrolloff=3
" better ESC
inoremap jk <esc>
inoremap Jk <esc>
inoremap JK <esc>
" Tabs
nnoremap <C-j> :action PreviousTab<cr>
nnoremap <C-k> :action NextTab<cr>
" Easier switch between splits
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" Copy into clipboard
vnoremap ,y :<BS><BS><BS><BS><BS>action $Copy<cr>
nnoremap ,p l:action $Paste<cr>
nnoremap ,P :action $Paste<cr>
" Create newlines like o and O but stay in normal mode
nnoremap <silent> zj o<Esc>k
nnoremap <silent> zk O<Esc>
" Closing tabs
nnoremap ,q :close<cr>
nnoremap ,x :close<cr>
" Searching
set incsearch
set ignorecase
" Remove annoying sounds
set visualbell
" Comment and un-comment
nnoremap ,cc :action CommentByLineComment<cr>
nnoremap ,cu :action CommentByLineComment<cr>
vnoremap ,cc :<BS><BS><BS><BS><BS>action CommentByLineComment<cr>
vnoremap ,cu :<BS><BS><BS><BS><BS>action CommentByLineComment<cr>
" Go to declaration
nnoremap <C-]> :action GotoDeclaration<cr>
" Search fuzzy for files, similar to Ctrl-P
nnoremap <C-p> :action GotoFile<cr>
" Search text (ag style)
nnoremap <C-o> :action FindInPath<cr>
" Search everywhere
nnoremap <C-i> :action SearchEverywhere<cr>
" Enable vim-surround
set surround
" Open on GitHub
nnoremap ,og :action Github.Open.In.Browser<cr>
vnoremap ,og :<BS><BS><BS><BS><BS>action Github.Open.In.Browser<cr>
" Find usages
nnoremap ,f :action FindUsages<cr>
" Moving blocks of text in visual mode
vnoremap < <gv
vnoremap > >gv