- How to install python syntax support for Vim on Mac OSX?
- How to install python syntax support for Vim on Mac OSX?
- How do I install vim on OSX with Python 3 support? (9
- Installing Vim With Python 3 Support Linux
- Reinstall vim with python3 support
- Compile Vim with Python support on OS X
- Vim — configure for python3 support but still shows -python3 in version information
- Building Vim from source
How to install python syntax support for Vim on Mac OSX?
https://github.com/mxcl/homebrew Question: I am trying to build vim on Ubuntu 12.04 with python3 support as the default install only has python2 support. I know want to use Vim as my primary editor for python files.
How to install python syntax support for Vim on Mac OSX?
I recently started programming in python and have fallen in love with Vim over the past few weeks. I know want to use Vim as my primary editor for python files. I know there are python plugins for Vim, but I am very confused as to where/how I can install these. I don’t really understand where Vim is installed. I’m running the latest version of Mac OS X Snow Leopard.
Any help would be greatly appreciated. Thanks!
To best answer your initial question: «How to install python syntax support in Vim»:
There is no need to install anything! If you have not made any modifications (e.g. no configuration changes for vim in ~/.vimrc ) try the following:
You should now have VIM properly highlight your Python file.
To avoid having to re-type those command over and over again, I would suggest you keep a configuration file for VIM. This is usually located in your home directory, if there is not one there already, create a ~/.vimrc file and add the syntax on directive there to have VIM automatically highlight your Python files.
If you need to know more about structure/installation of plugins, then Senthil’s answer is better suited 🙂
You will find that you have a folder by name .vim in your home directory cd ~ and it will contain the following directories
ftdetect/ ftplugin/ plugin/ syntax/
You need to download the plugins and install them (copy them) to those directories.
Apart from that, in your .vimrc file have the following lines which will enable you to write python programs following PEP8.
set autoindent set tabstop=4 set expandtab set shiftwidth=4 filetype indent on
There are some good documentation out there as well.
for mac os x, the vimrc file is located in /usr/share/vim directory edit the vimdc file with any text editor. Add the syntax on to the last line of the file. Then next time you start a file you can see color. This is a system wide setting. In other linux flavor it may be located in /etc/ you can find this file by find /etc -name vimdc. The edit will affect all the users on the machine. These setting can overwritten by the $HOME/.vimrc file. In your home you may also have a .vim directory. To check that you have these, do ls -a in your home directory.
How do I install vim on OSX with Python 3 support?, Add a comment. 3. Another way to install Vim with Python3 support is using port from The MacPorts Project: To check how many variants available for VIM and their conflict: port variant vim. To install vim with python3 support: sudo port install vim +python37. And to uninstall, just: sudo port uninstall vim. Code samplebrew remove vimbrew cleanupbrew install vim —with-python3Feedback
How do I install vim on OSX with Python 3 support? (9
How do I install vim on OSX with Python 3 support ?Helpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & praise to God, a
Installing Vim With Python 3 Support Linux
Installing Vim With Python 3 Support LinuxHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & praise to God, and with
Reinstall vim with python3 support
I installed Vim 7.4 a few months ago (sudo apt-get install vim) on Ubuntu 16.04 and now I’m trying to install plugins that require python3 support.
How can I reinstall/uppgrade vim to support python3?
Fixed it for me. Didn’t even have to uninstall my current vim or anything else. Thanks to Romainl for your comment!
How do I install vim on OSX with Python 3 support?, So I assume python 3 is not installed. So what I did is the following: brew remove vim which went ok and then brew info vim and got the following message: Is it because there are 2 versions of vim installed now? I also tried brew install vim —with-python3 but got the following message invalid option: —with …
Compile Vim with Python support on OS X
I start in the Vim src directory
$ pwd ~/vim/src $ ./configure \ > --prefix=$HOME/Applications/vim-compiled \ > --enable-rubyinterp=yes \ > --enable-pythoninterp=yes \ > --with-python-config-dir=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config $ make
At the end of make , I get the following error
ld: warning: in /Library/Frameworks//Python.framework/Python, missing required architecture x86_64 in file Undefined symbols: . . . ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [vim] Error 1
What’s causing the error? I’ve found answers in similar questions that advise using MacPorts, Homebrew, or MacVim. I don’t want to use any of those. Is there some other way around?
UPDATE : This is the output listing the Undefined symbols http://pastebin.com/ggV87ReF
In my case I’ve installed MacVim on 10.6.8 using the following command ./configure —prefix=/usr —enable-perlinterp=yes —enable-pythoninterp=yes —with-features=huge —with-python-config-dir=/System/Library/Frameworks/Python.framework/Versions/2.6
Have you tried upgrading to the OSX 32-bit/64-bit version of Python 2.7. 2 ? I’m not sure if there was a specific 64-bit version of 2.7, and that might be causing problems.
Take a look at the Homebrew recipe for vim (or macvim) and modify it if necessary. https://github.com/mxcl/homebrew
Python 3.x — Installing Vim with Python3 support?, Way 0: we should reinstall python3 and VIM, 1.run the below on terminal. brew reinstall python3. the upstairs shows that we reinstall python3 to make sure that needed by VIM. 2.continue run on terminal. brew uninstall vim. the upstairs shows that uninstall vim only if you previously installed it. 3.run on …
Vim — configure for python3 support but still shows -python3 in version information
I am trying to build vim on Ubuntu 12.04 with python3 support as the default install only has python2 support. I pull the source code from https://vim.googlecode.com/hg/ and configure like so:
./configure --disable-pythoninterp --enable-python3interp --with-features huge
I tried with the —enable-pythoninterp option also.
When I run vim —version on this install I still get -python3 like so:
$ ./src/vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 18 2014 09:32:02) Included patches: 1-481 Compiled by brendan@brendan-laptop Normal version with GTK2 GUI. Features included (+) or not (-): +acl -farsi -mouse_netterm +syntax -arabic +file_in_path -mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static +balloon_eval +float -mouse_urxvt -tag_any_white +browse +folding +mouse_xterm -tcl +builtin_terms -footer +multi_byte +terminfo +byte_offset +fork() +multi_lang +termresponse +cindent +gettext -mzscheme +textobjects +clientserver -hangul_input +netbeans_intg +title +clipboard +iconv +path_extra +toolbar +cmdline_compl +insert_expand -perl +user_commands +cmdline_hist +jumplist +persistent_undo +vertsplit +cmdline_info -keymap +postscript +virtualedit +comments -langmap +printer +visual -conceal +libcall -profile +visualextra +cryptv +linebreak -python +viminfo -cscope +lispindent -python3 +vreplace +cursorbind +listcmds +quickfix +wildignore +cursorshape +localmap +reltime +wildmenu +dialog_con_gui -lua -rightleft +windows +diff +menu -ruby +writebackup +digraphs +mksession +scrollbind +X11 +dnd +modify_fname +signs -xfontset -ebcdic +mouse +smartindent +xim -emacs_tags +mouseshape -sniff +xsmp_interact +eval -mouse_dec +startuptime +xterm_clipboard +ex_extra +mouse_gpm +statusline -xterm_save +extra_search -mouse_jsbterm -sun_workshop +xpm system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/usr/local/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/harfbuzz -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl
As can be seen in the above, python3 support is not included in the binary.
I also have python3-dev installed too, although I’m sure if that’s required.
sudo apt-get install python3-dev
Any help would be much appreciated!
You also need to specify the python config dir with
when running configure since it appears that configure wasn’t able to automatically find the directory.
The other way to make configure find that python3-config-dir automatically is make sure that python points to a python 3 executable instead of a python 2 one (which most systems default to)
I would also recommend running configure with —enable-fail-if-missing so that the configure script will fail instead of quietly warning that it didn’t find a python3 config directory or executable.
Building Vim from source
- First, install all the prerequisite libraries, including Mercurial. For a Debian-like Linux distribution like Ubuntu, that would be the following:
bash sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \ libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \ ruby-dev mercurial For Fedora 20, that would be the following:
bash sudo yum install -y ruby ruby-devel lua lua-devel luajit \ luajit-devel ctags mercurial python python-devel \ python3 python3-devel tcl-devel \ perl perl-devel perl-ExtUtils-ParseXS \ perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \ perl-ExtUtils-Embed
bash sudo apt-get remove vim vim-runtime gvim vim-tiny vim-common vim-gui-common
- Once everything is installed, getting the source is easy. If you’re not using vim 7.4, make sure to set the VIMRUNTIMEDIR variable correctly below (for instance, with vim 7.4a, use /usr/share/vim/vim74a):
bash cd ~ hg clone https://code.google.com/p/vim/ cd vim ./configure —with-features=huge \ —enable-multibyte \ —enable-rubyinterp \ —enable-python3interp vi_cv_path_python3=/usr/bin/python3.4 \ —with-python-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu \ —enable-perlinterp \ —enable-luainterp \ —enable-gui=gtk2 —enable-cscope —prefix=/usr make VIMRUNTIMEDIR=/usr/share/vim/vim74 sudo apt-get install checkinstall sudo checkinstall
bash sudo update-alternatives —install /usr/bin/editor editor /usr/bin/vim 1 sudo update-alternatives —set editor /usr/bin/vim sudo update-alternatives —install /usr/bin/vi vi /usr/bin/vim 1 sudo update-alternatives —set vi /usr/bin/vim