-
Notifications
You must be signed in to change notification settings - Fork 2
/
.ideavimrc
84 lines (69 loc) · 1.69 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
set guioptions-=m "menu bar
set guioptions-=T "toolbar
set guioptions-=r "scrollbar
set hlsearch
set incsearch
set ignorecase
syntax on
let python_highlight_all=1
set cindent
set number " line numbers
set cursorline " highlight cursor line
set pastetoggle=<F2>
" using alt/meta to jump words
set linebreak
" facilitate ctag viewing
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
" read tags file from upper directories
set tags=./tags;/
set tabstop=2
set softtabstop=2 expandtab
set expandtab
set smarttab
set shiftwidth=2
inoremap <nul> <c-n>
set autoread
filetype plugin on
filetype indent on
highlight ColorColumn ctermbg=235
set colorcolumn=100
" yank to clipboard
if has('macunix')
set clipboard=unnamed
elseif has('unix')
set clipboard=unnamedplus
endif
" search visually selected block
vnoremap / <Esc>/\%V
" select entire line without leading or trailing spaces
nnoremap vil ^vg_
" Remove current highlighting
map zh :nohlsearch<CR>
" Use system clipboard for copy/pasting
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
" treat wrapped lines as multi-lines
noremap k gk
noremap j gj
noremap 0 g0
noremap $ g$
" open grep prompt
nnoremap grep :Grep <c-r>=expand("<cword>")<cr><CR>
" turn off smart indentation for pasting
map! jj <ESC>
map! kk <ESC>
" save shortcut
nnoremap ss :w<CR>
" persistent undo
set undofile
set undodir=~/.backup/vim/undo,~/tmp,/tmp
set autoindent
set smartindent
" new line above
nmap <C-Enter> <ESC>ko
imap <C-Enter> <ESC>ko
" swap files
set noswapfile
" search for selected text
vnoremap // y/\V<C-r>=escape(@",'/\')<CR><CR>