/
dot_ideavimrc
73 lines (64 loc) · 1.86 KB
/
dot_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
""" Plugins --------------------------------
set surround
set commentary
set argtextobj
set textobj-entire
set ReplaceWithRegister
set NERDTree
set highlightedyank
set iskeyword-=_
set easymotion
""" Plugin settings -------------------------
let g:argtextobj_pairs="[:],(:),<:>"
let g:surround_no_mappings=1
let g:NERDTreeMapActivateNode='<cr>'
let g:NERDTreeMapOpenVSplit="s"
let g:NERDTreeMapOpenSplit="S"
""" Common settings -------------------------
set showmode
set so=5
set incsearch
set relativenumber
""" remap leader key to space
let mapleader=" "
""" Windows settings ------------------------
:map <leader>- :split<cr>
:map <leader>\| :vsplit<cr>
:map <C-j> <C-W>j
:map <C-k> <C-W>k
:map <C-h> <C-W>h
:map <C-l> <C-W>l
""" File navigation -------------------------
:map <leader>ff <Action>(GotoFile)
:map <leader>ss <Action>(FileStructurePopup)
:map <leader>sS <Action>(GotoSymbol)
:map <leader>, <Action>(RecentFiles)
:map <leader>/ <Action>(FindInPath)
:map <leader>e :NERDTreeToggle<cr>
:map <leader>E :NERDTreeFind<cr>
:map <leader><tab>x :tabclose<cr>
:nmap [b :tabprevious<cr>
:nmap ]b :tabnext<cr>
:nmap H :tabprevious<cr>
:nmap L :tabnext<cr>
:map <leader>sm <Action>(ShowBookmarks)
:nmap <leader>mm <Action>(ToggleBookmark)
:nmap s <Plug>(easymotion-f)
:nmap S <Plug>(easymotion-F)
""" Code actions ----------------------------
:map <leader>cf <Action>(ReformatCode)
:map <leader>cr <Action>(RenameElement)
:map [e <Action>(GotoPreviousError)
:map ]e <Action>(GotoNextError)
:nmap gzd <Plug>DSurround
:nmap gzr <Plug>CSurround
:nmap gza <Plug>YSurround
:vmap gza <Plug>VSurround
""" Offtopic --------------------------------
:map <leader>z <Action>(ToggleDistractionFreeMode)
:map <leader>w :w<cr>
:map <leader>: <Action>(GotoAction)
:map <leader>uL :set relativenumber!<cr>
:map <leader>uw <Action>(EditorToggleUseSoftWraps)
:nmap <leader>qq <Action>(Exit)
imap jj <Esc>