-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
executable file
·66 lines (53 loc) · 1.86 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
syntax on " Highlight syntax
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
set number
set relativenumber " display relative line numbers
set scrolloff=5 " keep at least 5 lines above and below the cursor
set history=200 " keep 200 lines of command line history
set laststatus=2 " display the status line at the bottom
set ignorecase " ignore case during search operations
set encoding=utf-8 " set vim-wide UTF-8 encoding
set cursorline " Highlight the current line
set incsearch " Do incremental searching
set hlsearch " Highlight search result
" Tabs and indentation settings
set expandtab " use space characters instead of tabs
set softtabstop=4 " insert 4 spaces when tab button pressed
set shiftwidth=4 " use 4 spaces for indentation
" Map the leader key
nnoremap <Space> <nop>
let mapleader=" "
" OS clipboard yank mappings
vnoremap <Leader>oy "+y
vnoremap <Leader>oy "+y
nnoremap <Leader>oyy "+yy
" OS clipboard paste mappings
noremap <Leader>op "+p
" Delete to void register and paste
vnoremap <Leader>p "_dp
" Disable the arrow keys just in case
noremap <Left> <nop>
noremap <Right> <nop>
noremap <Up> <nop>
noremap <Down> <nop>
" Disable search highlighting temporary when <Esc> is hit
nnoremap <silent> <Leader>so :nohlsearch<CR>
" Center cursor when searching
nmap n nzz
nmap N Nzz
" Center cursor when scrolling text
nmap <C-d> <C-d>zz
nmap <C-u> <C-u>zz
" Map idea actions to vim key map
nmap <C-c> <Action>(EditorEscape)
nmap <Leader>pf <Action>(SearchEverywhere)
nmap <Leader>pg <Action>(FindInPath)
nmap <F3> <Action>(ShowReformatFileDialog)
xmap <F3> <Action>(ShowReformatFileDialog)
nmap <F5> <Action>(Debug)
nmap <S-F5> <Action>(Stop)
nmap <F6> <Action>(Resume)
nmap <Leader>b <Action>(ToggleLineBreakpoint)
nmap <Leader>c <Action>(AddConditionalBreakpoint)