@@ -13,7 +13,7 @@ if pymode#Default('g:pymode', 1) || !g:pymode
1313endif
1414
1515" DESC: Check python support
16- if ! has (' python' )
16+ if ! has (' python' ) && ! has ( ' python3 ' )
1717 let g: pymode_virtualenv = 0
1818 let g: pymode_path = 0
1919 let g: pymode_lint = 0
@@ -23,6 +23,11 @@ if !has('python')
2323 let g: pymode_run = 0
2424endif
2525
26+ if has (' python' )
27+ command ! -nargs =1 Python python <args>
28+ elseif has (' python3' )
29+ command ! -nargs =1 Python python3 <args>
30+ end
2631
2732" Virtualenv {{{
2833
@@ -122,9 +127,9 @@ if !pymode#Default("g:pymode_lint", 1) || g:pymode_lint
122127 let g: pymode_lint_config = expand (" <sfile>:p:h:h:h" ) . " /pylint.ini"
123128 endif
124129
125- call pymode#Execute ( " from pymode import queue" )
130+ Python from pymode import queue
126131
127- au VimLeavePre * call pymode#Execute ( " queue.stop_queue() " )
132+ au VimLeavePre * Python queue.stop_queue ()
128133
129134endif
130135
@@ -149,7 +154,7 @@ if !pymode#Default("g:pymode_breakpoint", 1) || g:pymode_breakpoint
149154
150155 if ! pymode#Default (" g:pymode_breakpoint_cmd" , " import pdb; pdb.set_trace() # XXX BREAKPOINT" ) && has (" python" )
151156
152- python << EOF
157+ Python << EOF
153158from imp import find_module
154159
155160for module in (' pudb' , ' ipdb' ):
@@ -244,7 +249,7 @@ if !pymode#Default("g:pymode_rope", 1) || g:pymode_rope
244249 call pymode#Default (" g:pymode_rope_always_show_complete_menu" , 0 )
245250
246251 " DESC: Init Rope
247- call pymode#Execute ( " import ropevim" )
252+ Python import ropevim
248253
249254 fun ! RopeCodeAssistInsertMode () " {{{
250255 call RopeCodeAssist ()
@@ -255,7 +260,7 @@ if !pymode#Default("g:pymode_rope", 1) || g:pymode_rope
255260 if isdirectory (getcwd () . ' /.ropeproject' )
256261 " In order to pass it the quiet kwarg I need to open the project
257262 " using python and not vim, which should be no major issue
258- call pymode#Execute ( " ropevim._interface.open_project(quiet=True) " )
263+ Python ropevim._interface.open_project (quiet= True)
259264 return " "
260265 endif
261266 endfunction " }}}
@@ -267,7 +272,7 @@ if !pymode#Default("g:pymode_rope", 1) || g:pymode_rope
267272
268273 fun ! RopeOmni (findstart, base) " {{{
269274 if a: findstart
270- call pymode#Execute ( " ropevim._interface._find_start() " )
275+ Python ropevim._interface._find_start ()
271276 return g: pymode_offset
272277 else
273278 call RopeOmniComplete ()
0 commit comments