8000 Merge pull request #1137 from NathanTP/ropePrefix · python-mode/python-mode@b3f7440 · GitHub
[go: up one dir, main page]

Skip to content

Commit b3f7440

Browse files
authored
Merge pull request #1137 from NathanTP/ropePrefix
Add configurable prefix for rope commands
2 parents 4bc4581 + 97b7209 commit b3f7440

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ Contributors:
7575
* Yury A. Kartynnik (https://github.com/kartynnik);
7676
* Xiangyu Xu (https://github.com/bkbncn);
7777
* Zach Himsel (https://github.com/zhimsel);
78+
* Nathan Pemberton (https://github.com/NathanTP);

doc/pymode.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ Turn on the rope script *'g:pymode_rope'
423423
>
424424
let g:pymode_rope = 1
425425
426+
Set the prefix for rope commands *'g:pymode_rope_prefix'*
427+
>
428+
let g:pymode_rope_refix = '<C-c>'
429+
426430
.ropeproject Folder ~
427431
*.ropeproject*
428432

plugin/pymode.vim

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
" vi: fdl=1
22
let g:pymode_version = "0.13.0"
33

4+
45
" Enable pymode by default :)
56
call pymode#default('g:pymode', 1)
67
call pymode#default('g:pymode_debug', 0)
@@ -185,6 +186,7 @@ call pymode#default('g:pymode_breakpoint_cmd', '')
185186
"
186187
" Rope support
187188
call pymode#default('g:pymode_rope', 0)
189+
call pymode#default('g:pymode_rope_prefix', '<C-c>')
188190

189191
" System plugin variable
190192
if g:pymode_rope
@@ -213,7 +215,7 @@ if g:pymode_rope
213215
call pymode#default('g:pymode_rope_autoimport_modules', ['os', 'shutil', 'datetime'])
214216

215217
" Bind keys to autoimport module for object under cursor
216-
call pymode#default('g:pymode_rope_autoimport_bind', '<C-c>ra')
218+
call pymode#default('g:pymode_rope_autoimport_bind', g:pymode_rope_prefix . 'ra')
217219

218220
" Automatic completion on dot
219221
call pymode#default('g:pymode_rope_complete_on_dot', 1)
@@ -222,56 +224,56 @@ if g:pymode_rope
222224
call pymode#default('g:pymode_rope_completion_bind', '<C-Space>')
223225

224226
" Bind keys for goto definition (leave empty for disable)
225-
call pymode#default('g:pymode_rope_goto_definition_bind', '<C-c>g')
227+
call pymode#default('g:pymode_rope_goto_definition_bind', g:pymode_rope_prefix . 'g')
226228

227229
" set command for open definition (e, new, vnew)
228230
call pymode#default('g:pymode_rope_goto_definition_cmd', 'new')
229231

230232
" Bind keys for show documentation (leave empty for disable)
231-
call pymode#default('g:pymode_rope_show_doc_bind', '<C-c>d')
233+
call pymode#default('g:pymode_rope_show_doc_bind', g:pymode_rope_prefix . 'd')
232234

233235
" Bind keys for find occurencies (leave empty for disable)
234-
call pymode#default('g:pymode_rope_find_it_bind', '<C-c>f')
236+
call pymode#default('g:pymode_rope_find_it_bind', g:pymode_rope_prefix . 'f')
235237

236238
" Bind keys for organize imports (leave empty for disable)
237-
call pymode#default('g:pymode_rope_organize_imports_bind', '<C-c>ro')
239+
call pymode#default('g:pymode_rope_organize_imports_bind', g:pymode_rope_prefix . 'ro')
238240

239241
" Bind keys for rename variable/method/class in the project (leave empty for disable)
240-
call pymode#default('g:pymode_rope_rename_bind', '<C-c>rr')
242+
call pymode#default('g:pymode_rope_rename_bind', g:pymode_rope_prefix . 'rr')
241243

242244
" Bind keys for rename module
243-
call pymode#default('g:pymode_rope_rename_module_bind', '<C-c>r1r')
245+
call pymode#default('g:pymode_rope_rename_module_bind', g:pymode_rope_prefix . 'r1r')
244246

245247
" Bind keys for convert module to package
246-
call pymode#default('g:pymode_rope_module_to_package_bind', '<C-c>r1p')
248+
call pymode#default('g:pymode_rope_module_to_package_bind', g:pymode_rope_prefix . 'r1p')
247249

248250
" Creates a new function or method (depending on the context) from the selected lines
249-
call pymode#default('g:pymode_rope_extract_method_bind', '<C-c>rm')
251+
call pymode#default('g:pymode_rope_extract_method_bind', g:pymode_rope_prefix . 'rm')
250252

251253
" Creates a variable from the selected lines
252-
call pymode#default('g:pymode_rope_extract_variable_bind', '<C-c>rl')
254+
call pymode#default('g:pymode_rope_extract_variable_bind', g:pymode_rope_prefix . 'rl')
253255

254256
" Inline refactoring
255-
call pymode#default('g:pymode_rope_inline_bind', '<C-c>ri')
257+
call pymode#default('g:pymode_rope_inline_bind', g:pymode_rope_prefix . 'ri')
256258

257259
" Move refactoring
258-
call pymode#default('g:pymode_rope_move_bind', '<C-c>rv')
260+
call pymode#default('g:pymode_rope_move_bind', g:pymode_rope_prefix . 'rv')
259261

260262
" Generate function
261-
call pymode#default('g:pymode_rope_generate_function_bind', '<C-c>rnf')
263+
call pymode#default('g:pymode_rope_generate_function_bind', g:pymode_rope_prefix . 'rnf')
262264

263265
" Generate class
264-
call pymode#default('g:pymode_rope_generate_class_bind', '<C-c>rnc')
266+
call pymode#default('g:pymode_rope_generate_class_bind', g:pymode_rope_prefix . 'rnc')
265267

266268
" Generate package
267-
call pymode#default('g:pymode_rope_generate_package_bind', '<C-c>rnp')
269+
call pymode#default('g:pymode_rope_generate_package_bind', g:pymode_rope_prefix . 'rnp')
268270

269271
" Change signature
270-
call pymode#default('g:pymode_rope_change_signature_bind', '<C-c>rs')
272+
call pymode#default('g:pymode_rope_change_signature_bind', g:pymode_rope_prefix . 'rs')
271273

272274
" Tries to find the places in which a function can be used and changes the
273275
" code to call it instead
274-
call pymode#default('g:pymode_rope_use_function_bind', '<C-c>ru')
276+
call pymode#default('g:pymode_rope_use_function_bind', g:pymode_rope_prefix . 'ru')
275277

276278
" Regenerate project cache on every save
277279
call pymode#default('g:pymode_rope_regenerate_on_write', 1)

0 commit comments

Comments
 (0)
0