-
Notifications
You must be signed in to change notification settings - Fork 9
/
ideavimrc
64 lines (53 loc) · 1.17 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
" General
" Define the 'vimrc' autocmd group
augroup vimrc
autocmd!
augroup END
set ignorecase
set incsearch
set smartcase
" UI
set display+=lastline
set scrolloff=3
set sidescroll=1
set sidescrolloff=10
set splitbelow
set splitright
" Highlight trailing whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd vimrc BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd vimrc InsertEnter * match ExtraWhitespace //
autocmd vimrc InsertLeave * match ExtraWhitespace /\s\+$/
if v:version >= 702
autocmd vimrc BufWinLeave * call clearmatches()
endif
" Mappings
" Commander
nnoremap ; :
noremap H ^
noremap L $
" Unix shell behavior
inoremap <C-A> <ESC>I
inoremap <C-E> <ESC>A
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
" Reselect visual block after shifting
vnoremap < <gv
vnoremap > >gv
" Stop the highlighting for hlsearch
nnoremap <silent> ,/ :nohlsearch<CR>
" Search for visually selected text
vnoremap * y/<C-R>"<CR>
vnoremap # y?<C-R>"<CR>
" Center display after searching
nnoremap n nzz
nnoremap N Nzz
nnoremap * *zz
nnoremap # #zz
nnoremap g* g*zz
nnoremap g# g#zz
" Splitted windows
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-H> <C-W>h
nnoremap <C-L> <C-W>l