-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
117 lines (82 loc) · 2.74 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
"
" .ideavimrc
"
"""""""""""""
let mapleader = ' '
" IdeaVim plugins
set surround
set multiple-cursors
" Enable IDEA to improve line joining with `shift+j`. For example when joining two comment lines, IDEA will remote
" the comment symbol (`//` or `#`) so it must not be deleted manually.
set ideajoin
" Enable vim-sneak (https://github.com/justinmk/vim-sneak)
" Type `s` + two characters to jump to the next location where these
" characters appear. (Like `f` but more precise)
set sneak
" EasyMotion
Plug 'easymotion/vim-easymotion'
set easymotion
map <Leader> <Plug>(easymotion-prefix)
" Disable error bell on <Esc> press
set visualbell
"set noerrorbells
" Smart case search
set ignorecase
set smartcase
" Relative line nubers
set number
set relativenumber
" System clipboard integration
" Use system clipboard
"set clipboard+=unnamed
" Send `x` to "black hole" buffer to prevent flooding clipboard
"nnoremap <x> "_x
" System clipboard with Ctrl+C/V
vnoremap <C-c> "+ygv
inoremap <C-v> <C-r>+
#inoremap <M-v> <C-v>
" Scroll with Ctrl+<homerow-key>
"map <C-j> 2<C-e>
"map <C-k> 2<C-y>
" Reload .ideavimrc
nnoremap <Space>vs :source ~/.ideavimrc<CR>
command! RR source ~/.ideavimrc
" Command to (write and) reload .ideavimrc
"command! RR
" \ if expand('%:p') == expand('~/.ideavimrc') |
" \ write |
" \ endif |
" \ source ~/.ideavimrc |
" \ redraw | echo "===> :source ~/.ideavimrc <==="
" Line / Block comments
"nnoremap gc :action CommentByLineComment<CR>
"vnoremap gc :action CommentByLineComment<CR>
"nnoremap gC :action CommentByBlockComment<CR>
"vnoremap gC :action CommentByBlockComment<CR>
" [PHP] Map ",," to "->"
inoremap ,, ->
inoremap ,. =>
inoremap ,<space> ,<space>
inoremap ,<CR> ,<CR>
" Scrolloff
set scrolloff=5
" Wrap line
nmap gqq :action com.andrewbrookins.idea.wrap.WrapAction<CR>
nmap gww :action com.andrewbrookins.idea.wrap.WrapAction<CR>
vmap gq :action com.andrewbrookins.idea.wrap.WrapAction<CR>
vmap gw :action com.andrewbrookins.idea.wrap.WrapAction<CR>
" Search for selected text
vnoremap g/ y/\V<C-R>=escape(@",'/\')
" Setup Editor Action Mappings (use `:actionlist <pattern>` to find available actions)
nmap <S-k> <action>(ShowHoverInfo)
" Past into new line
nnoremap gp o<Esc>p
nnoremap gP O<Esc>p
"function! PasteTrimmed()
" let l:yanked = call getreg('"')
" "let l:trimmed = substitute(l:yanked, '^\s*\(.\{-}\)\s*$', '\1', '')
" "let l:trimmed = l:yanked
" execute "normal! i" . l:yanked . "aaaaaaaaa"
"endfunction
"
"nnoremap Gp :call PasteTrimmed()