-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
102 lines (78 loc) · 2.37 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
set visualbell
set ignorecase
set relativenumber
set number
set hlsearch
" set noerrorbells
map <C-o> <Action>(Back)<CR>
map <C-i> <Action>(Forward)<CR>
map <TAB> <Action>(EditorTab)<CR>
map ]] ]m
map [[ [m
Plug 'preservim/nerdtree'
let mapleader = " " "map leader to Space
nnoremap <leader>; $a;<Esc>
nnoremap <leader>, $a;<Esc>
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
imap jk <Esc>
" visual mode "
xnoremap <leader>p \"0P
xnoremap <leader>d \"_d
xnoremap <leader>c \"_c
xnoremap <leader>y \"+y
" search for it
xnoremap <leader>f \"ay/<C-R>a<CR>
nnoremap <leader>f :noh<CR>
nnoremap n nzz
nnoremap N Nzz
"fancy selections wrap test"
function! WrapText(start, end)
execute "normal! `>a".a:end
execute "normal! `<i".a:start
endfunction
function! RemoveParenthesesInSelection()
" Use s command to search and 'replace' in the selection
s/\v\(([^)]+)\)/\1/
execute "normal! `>b"
endfunction
function! RemoveSimpleQuotesInSelection()
" Use s command to search and 'replace' in the selection
s/\v'([^']+)'/\1/
execute "normal! `>b"
endfunction
xnoremap <leader>wp :call WrapText('(', ')')<CR>
xnoremap <leader>wc :call WrapText("'", "'")<CR>
xnoremap <leader>rp :call RemoveParenthesesInSelection()<CR>
xnoremap <leader>rc :call RemoveSimpleQuotesInSelection()<CR>
" move selected lines up and down nicely
xnoremap J :m '>+1<CR>gv=gv
xnoremap K :m '<-2<CR>gv=gv
nnoremap mN :action ToggleBookmark0<CR>
nnoremap mB :action ToggleBookmark1<CR>
nnoremap mT :action ToggleBookmark2<CR>
nnoremap <C-n> :action GotoBookmark0<CR>
nnoremap <C-b> :action GotoBookmark1<CR>
nnoremap <C-t> :action GotoBookmark2<CR>
nnoremap <leader>i :action GotoImplementation<CR>
nnoremap <leader>gU viwgUU<ESC>
" project view and navigation"
nnoremap <leader>pv :action ActivateProjectToolWindow<CR>
nnoremap <leader>po :action SelectInProjectView<CR>
nnoremap <leader>sv :action ActivateStructureToolWindow<CR>
nnoremap <leader>so :action SelectInStructureView<CR>
nnoremap <leader><space> :action RecentFiles<CR>
nnoremap <C-j> J\"_x<ESC>
nnoremap <leader>o o<ESC>k
nnoremap <leader>O O<ESC>j
nnoremap <leader>w :wa<CR>
nnoremap gb :bn<CR>
nnoremap <leader>b :b#<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"split commas"
vnoremap <leader>sc :s/\v,/,\r/g<CR>
" source ~/.ideavimrc apply changes :so do not found"
" double shift and track action ids"