-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
121 lines (101 loc) · 3.63 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
118
119
120
121
" AUTHOR: larsaars
" REPOSITORY: https://github.com/larsaars/linux-setup
"++++++++++++++++++++++++++++++++ Appearance +++++++++++++++++++++++++++++++++"
" enable autoindent
filetype indent plugin on
" set default indentation
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
" Other
set nowb
set showcmd
set hlsearch
set nobackup
set incsearch
set smartcase
set smartindent
" some fixes
set number
set highlightedyank
set ideamarks
set ideajoin
set commentary
set argtextobj
set textobj-entire
set surround
set clipboard+=unnamedplus " copy to and from system clipboard
let mapleader = ","
"+++++++++++++++++++++++++++++++++ Key Bindings +++++++++++++++++++++++++++++++++"
" easier parenthesis opening
map ä A<space>{<CR>
" add semicolon at end of line
map ö A;<esc>
" easier deletion of two belonging parenthesis
map ü mp%x`px
" remap minus in command mode to put a newline below
noremap - mpo<esc>`p
" These are leader-based alternative shortcuts for actions whose corresponding
" idea shortcuts require hand-stretching combinations, function keys, Home or
" Insert.
"
" Shift + F6 in idea.
" Alt + R, then R (through the menu bar) also seems to work fine.
" map <Leader>r :action RenameElement<CR>
" Ctrl + F12 in idea.
map <Leader>s Action(FileStructurePopup)
map s <Action>(FileStructurePopup)
" Perhaps just use the Idea shortcut Ctrl-Alt-B
" Alt + N, then m (through the menu bar) also seems to work, but it is
" non-unique.
map <Leader>i <Action>(GotoImplementation)
map <Leader>m <Action>(GotoImplementation)
map <Leader>d <Action>(GotoImplementation)
" Jump to next/previous error, show error description
" https://stackoverflow.com/questions/13346245/keyboard-shortcut-to-display-error-in-intellij
map <Leader>e <Action>(ShowErrorDescription)
" Alt + F7 in idea.
" Find usages in file is Ctrl + F7.
" Alt + E, then F, then U (through the menu bar) also seems to work fine.
map <Leader>f <Action>(FindUsages)
" Alt + Insert in idea.
map <Leader>g <Action>(Generate)
" F12
map <Leader>w <Action>(JumpToLastWindow)
" Possibly redundant given "Run Anything" DoubleCtrl
map <Leader>r <Action>(ChooseRunConfiguration)
" These shortcuts mimic the default Idea action for one edition mode, using the
" Vim action for the other.
"
" Same as default IDEA action, but only in normal mode. Delete previous char
" in insert mode.
" See also Ctrl + Shift + H for method hierarchy, Ctrl + Alt + H for call
" hierarchy.
map <C-h> <Action>(TypeHierarchy)
" Same as default IDEA action, but only in insert mode. Enter block-visual
" mode in normal mode.
imap <C-v> <Esc><Action>($Paste)
" I like using space for jumping to the next error or issue
map <Space> <Action>(GotoNextError)
" The default C-o and C-i behaviours have certain inconsistencies with
" Vim which I can't quite pinpoint.
" I'm using the default IntelliJ behaviours instead.
map <C-o> <Action>(Back)
map <C-i> <Action>(Forward)
map g; <Action>(JumpToLastChange)
map g, <Action>(JumpToNextChange)
"
" Here are mappings about which I'm less sure.
" This is for going to related symbols. I can't find any effect in the community edition.
" map <Leader>g :action GotoRelated<CR>
" uppercase last inserted text. Perhpas just use gU`[ instead.
" map <Leader>u `[v`]~`]
" Can also use Ctrl-Shift-[
map <Leader>[ <Action>(EditorCodeBlockStart)
" Can also use Ctrl-Shift-]
map <Leader>] <Action>(EditorCodeBlockEnd)
" This is Ctrl-W in the default keymap, but we are using it for Vim.
" map <C-s> :action EditorSelectWord<CR> " somewhat unconfrotable to type
" map <C-d> :action EditorSelectWord<CR> " ditto
" better to use your two hands!
map <C-k> <Action>(EditorSelectWord)
" uppercase last inserted word
imap <C-l> <Esc>bgUawea