Skip to content

Commit 4236607

Browse files
committed
Exit gracefully in case python is not available.
This small patch lets the script exit quietly when python support is not available rather then throwing multiple errors. This makes it easier to share the vim configuration between different vim installations (eg. macvim and the builtin /usr/bin/vim without python support on Mac OSX).
1 parent 443e26b commit 4236607

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ftplugin/python/ipy.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
" (or :IPythonXSelection if you're using X11 without having to copy)
1717
"
1818
" written by Paul Ivanov (http://pirsquared.org)
19+
if !has('python')
20+
" exit if python is not available.
21+
finish
22+
endif
1923
python << EOF
2024
reselect = False # reselect lines after sending from Visual mode
2125
show_execution_count = True # wait to get numbers for In[43]: feedback?

0 commit comments

Comments
 (0)