-
Notifications
You must be signed in to change notification settings - Fork 1
/
xvimrc
168 lines (145 loc) · 4.86 KB
/
xvimrc
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" XVim config.
" Author: 邓锦龙(BronteDeng)
" Note: This file contains base keymap and xvim cmd keymap.
" Unfrequently used keymap is indent right.
" If lost document focus, use menu Navigate -> movie to focus to editor (cmd + j)
" Data: Sat Mar 15 10:05:14 CST 2014
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""
" assistant editor and jump between Frame
"""""""""""""""""""""""""""""""""""""""""
" show standard editor to close assistant editor
"map ,sa :xccmd changeToGeniusEditor<CR>
" add new assistant editor
"map ,aa :xccmd addAssistantEditor<CR>
" del one assistant editor
"map ,da :xccmd removeAssistantEditor<CR>
" move between windows
map <C-j> <C-w>j<CR>
map <C-k> <C-w>k<CR>
map <C-h> <C-w>h<CR>
map <C-l> <C-w>l<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""
" tab
""""""""""""""""""""""""""""""""""""""""""""""""""""
" tab new
map ,tn :xccmd newTab<CR>
" tab close
map ,tc :tabclose<CR>
" tab pre
map ,ti :xccmd selectPreviousTab<CR>
" tab next
map ,to :xccmd selectNextTab<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""
" View
" Note: standard editor shortkey is convenient
"""""""""""""""""""""""""""""""""""""""""""""""""""
" Code Snippet Library
map ,cs :xcmenucmd Show Code Snippet Library<CR>
" File Template Library
""map ,ft :xcmenucmd Show File Template Library<CR>
" Media Library
"map ,ml :xcmenucmd Show Media Library<CR>
" (Quick) help Inspector
map ,hi :xcmenucmd Show Quick Help Inspector<CR>
" File inspector
map ,fi :xcmenucmd Show File Inspector<CR>
" toggle navigator, debug area, utilities, ToolBar
" l-left, b-bottom, r-right, t-top or toolbar
map ,tl :xccmd toggleNavigatorsVisibility<CR>
map ,tb :xccmd toggleDebuggerVisibility<CR>
map ,tr :xccmd toggleUtilitiesVisibility<CR>
map ,tt :xccmd toggleToolbarShown<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""
" Navigate
""""""""""""""""""""""""""""""""""""""""""""""""""
" dc-debug console
map ,dc :xcmenucmd Activate Console<CR>
" open current file in selected editor
"map ,oi :xcmenucmd Open in…<CR>
" ctrl+i/o maybe better
map <C-i> :xccmd goForwardInHistoryByCommand<CR>
map <C-o> :xccmd goBackInHistoryByCommand<CR>
"map ,f :xccmd goForwardInHistoryByCommand<CR>
"map ,b :xccmd goBackInHistoryByCommand<CR>
"map ,jd :xcmenucmd Jump to Definition<CR> use gd instead.
map ,jn :xcmenucmd Jump to Next Issue<CR>
"map ,ni :xcmenucmd Fix Next Issue<CR>
map ,jp :xcmenucmd Jump to Previous Issue<CR>
"map ,pi :xcmenucmd Fix Previous Issue<CR>
" switch between .h/.m
" You can use vim cmd |gd| and |ctrl+i/o| to navigate between files.
map ,n :xccmd jumpToNextCounterpart<CR>
" place holder is Like <#...#>, jump to placeholder then use Key <Tab>.
"map ,np :xccmd selectNextPlaceholder<CR>
"map ,pp :xccmd selectPreviousPlaceholder<CR>
" reveal file or symbol
map ,pr :xccmd revealInProjectNavigator<CR>
"map ,sr :xccmd revealInSymbolNavigator<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""
" Editor
""""""""""""""""""""""""""""""""""""""""""""""""""
" Show Completions
"map ,c :xccmd complete<CR>
" Edit all in scope
"map ,ea :xccmd toggleTokenizedEditing<CR>
" Fold
nnoremap <SPACE> :xccmd fold<CR>
nnoremap zz :xccmd unfold<CR>
nnoremap <C-z> :xccmd unfoldAll<CR>
map ,fa :xccmd foldAllMethods<CR>
map ,ua :xccmd unfoldAllMethods<CR>
map ,fc :xccmd foldAllComments<CR>
map ,uc :xccmd unfoldAllComments<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""
" Project
""""""""""""""""""""""""""""""""""""""""""""""""""
"map ,r :run<CR>
map ,bp :xcmenucmd Build<CR>
map ,cp :xcmenucmd Clean<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""
" Miscellaneous
""""""""""""""""""""""""""""""""""""""""""""""""""
"quick save and quit
map ,w :w<CR>
set ignorecase
" search the string cursor points to. Very Usefull.
map ,s viw:xccmd findSelectedTextInWorkspace<CR>
" search document for text cursor points to.
map ,hh :xccmd searchDocumentationForSelectedText<CR>
" Filter file (view menus achieve the goal too)
map ,fn :xcmenucmd Filter in Navigator<CR>
map ,fl :xcmenucmd Filter in Library<CR>
" Open Quickly
" Note: slower then short key |cmd+shift+o|
map ,o :xccmd openQuickly<CR>
" Close Window
map ,cw :xccmd performClose<CR>
" close current file
map ,q :xccmd closeDocument<CR>
" show in Finder
map ,in :xccmd showInFinder<CR>
" cmd+L, go to line
map ,l :xccmd openQuicklyScoped<CR>
" insert a space
nmap ,k i <ESC>i
" quick command mode
nmap ; :
" quick replace word
nmap vp viwpyiw
nmap 0 ^
" yank/select block like
" method {
" }
nmap yab V$%jy
nmap vab V$%j
" save when esc
ino <Esc> <Esc>:xcmenucmd Save<CR>
nnoremap <CR> <c-m>
vnoremap <CR> s
" quick add ; at end of statement
inoremap <c-;> <ESC>A;<ESC>o
" Move by line in normal mode
" <c-e> move up
" <c-y> move down