Installs (30 days) vim: 82,473: vim -HEAD: 411: vim -with-lua -with-luajit: 1: vim -with-python3 -with-lua: 1: Installs on Request (30 days) vim: 82,366: vim -HEAD. 打开vim,命令模式执行:echo has(“python3”),返回1,表示已启用python3. 这时候,vim插件的错误应该都没有了,可以正常使用。 Compile YCM python3 install.py -java-completer -ts-completer # or python3 install.py -clang-completer -go-completer -rust-completer -java-completer -ts-completer. I've got Vim installed on MacOS using Brew and it installs with +python3 support for Python 3.7.2 by default. I'm writing a Vim plugin which utilises some Python 3.7 and would like this to be able to work on parity with Linux with how it works on MacOS.
- mac: |
brew install lua |
brew install vim --with-lua |
- plugin manager: https://github.com/junegunn/vim-plug |
- double check that vim has +lua support: vim --version |
- if not, compile: |
sudo apt-get install lua5.2 liblua5.2-dev |
./configure --with-features=huge --enable-cscope --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-multibyte --enable-fontset --disable-netbeans --enable-luainterp=yes --enable-largefile --enable-rubyinterp --enable-fail-if-missing --prefix=/opt |
- .vimrc: |
'''''''''''''''''''' |
' gocode debugging: gocode -s -debug |
' note that go install *.a lib is required for gocode to autocomplete |
' |
set nocompatible ' be iMproved, required |
filetype off ' required |
call plug#begin('~/.local/share/nvim/plugged') |
' Already installed by vim-go. |
' Plug 'mdempsky/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' } |
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries', 'tag': 'v1.19' } |
Plug 'airblade/vim-gitgutter' |
Plug 'flazz/vim-colorschemes' |
Plug 'Shougo/deoplete.nvim' |
Plug 'zchee/deoplete-go', { 'do': 'make'} |
Plug 'majutsushi/tagbar' |
Plug 'mileszs/ack.vim' |
Plug 'vim-airline/vim-airline' |
Plug 'scrooloose/nerdtree' |
' seems more annoying than anything.. |
' Plug 'rjohnsondev/vim-compiler-go' |
' not using |
'Plug 'jodosha/vim-godebug' |
'Plug 'pangloss/vim-javascript' |
'Plug 'nathanaelkane/vim-indent-guides' |
' rust |
' Plug 'rust-lang/rust.vim' |
' Plug 'vim-syntastic/syntastic' |
call plug#end() |
filetype plugin indent on ' required |
'''''''''''''''''''' |
set softtabstop=2 |
set shiftwidth=2 |
set tabstop=2 |
set rnu |
set backspace=2 |
set nowrap |
syntax on |
if executable('ag') |
let g:ackprg = 'ag --vimgrep --ignore 'tags' |
endif |
' had to manually install python 3.6.4 to get this to work |
' https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-debian-9/ |
' https://www.python.org/downloads/release/python-364/ |
' md5 Gzipped source tarball Source release 9de6494314ea199e3633211696735f65 22710891 |
' |
' pip install --upgrade neovim (python2) |
' pip3 install --upgrade neovim (python3) |
' |
let g:python3_host_prog = '/usr/local/bin/python3.6' |
let g:deoplete#enable_at_startup = 1 |
let g:deoplete#sources#go#gocode_binary = '~/go/bin/gocode' |
let g:deoplete#sources#go#sort_class = ['package', 'func', 'type', 'var', 'const'] |
' let g:deoplete#sources#go#use_cache = 1 |
' let g:deoplete#sources#go#json_directory = '~/.cache/deoplete/go/$GOOS_$GOARCH' |
let NERDTreeQuitOnOpen=1 |
nmap <F6> :NERDTreeToggle<CR> |
nmap <F8> :TagbarToggle<CR> |
' nmap <F9> :call RenewTagsFile()<CR> |
' |
' function! RenewTagsFile() |
' call system('ctags -R --exclude=.git --languages=-javascript 2>/dev/null') |
' endfunction |
' rust |
' let g:rustfmt_autosave = 1 |
' set completeopt-=preview |
' colorscheme 256_noir |
colorscheme Atelier_CaveDark |
' autocmd CursorMovedI * if pumvisible() 0|pclose|endif |
' autocmd InsertLeave * if pumvisible() 0|pclose|endif |
' try to prevent autofolding -- on save |
' autocmd InsertLeave,WinEnter * setlocal foldmethod=syntax |
' autocmd InsertEnter,WinLeave * setlocal foldmethod=manual |
set splitbelow |
set splitright |
' highlight ColorColumn ctermbg=235 guibg=#2c2d27 |
' let &colorcolumn=join(range(81,999),',') |
' let &colorcolumn='80,'.join(range(400,999),',') |
' highlight CursorLine cterm=none ctermbg=235 ctermfg=white |
' set cursorline |
highlight CursorColumn ctermbg=235 guibg=#2c2d27 |
' highlight CursorColumn ctermbg=235 guibg=#ffffff |
' set cursorcolumn |
' let g:gitgutter_highlight_lines = 1 |
let g:go_auto_type_info = 1 |
' prevent folds from closing when GoFmt is called |
let g:go_fmt_experimental = 1 |
' tagbar to left |
let g:tagbar_left = 1 |
' let g:go_highlight_build_constraints = 1 |
' let g:go_highlight_extra_types = 1 |
' let g:go_highlight_fields = 1 |
' let g:go_highlight_functions = 1 |
' let g:go_highlight_methods = 1 |
' let g:go_highlight_operators = 1 |
' let g:go_highlight_structs = 1 |
' let g:go_highlight_types = 1 |
' Will highlight the same variable name. A bit annoying. |
' let g:go_auto_sameids = 1 |
' esc in insert mode |
inoremap kj <esc> |
' esc in command mode |
cnoremap kj <C-C> |
' let g:go_info_mode = 'guru' |
' |
' let g:golang_goroot = '/usr/local/go/' |
' let loaded_matchparen = 1 |
hi MatchParen cterm=none ctermbg=green ctermfg=blue |
command Build !./build.sh |
setlocal foldmethod=indent |
' autocmd Syntax c,go,cpp,vim,xml,html,xhtml setlocal foldmethod=indent |
autocmd Syntax c,go setlocal foldmethod=indent |
' auto-open tagbar on known files |
autocmd VimEnter * nested :call tagbar#autoopen(1) |
au FileType json setlocal equalprg=python -m json.tool |
'''''''''''''''''''' |
- finally vim, :PluginInstall, :GoInstallBinaries |
- edit $PATH or use a soft link etc etc to make vim available (if you installed to /opt) |
- On Mac OS X, you can use homebrew to install first python and then vim, which vim will support python. I use MBP, the vim support python/dyn installed by the above way, but not including python3. # Delete wrong ans 2017.2.28 10:38AM #.
- I have to use Python 3.6.5 because of a library I use that keeps showing bugs on 3.7.0 (TensorFlow). I installed Python 3.6.5 using Homebrew as follows: brew install https://raw.githubusercontent.
Python is very popular programming and scripting language. It provides useful modules and libraries but also there is a lot of popular 3rd party library. Pip is the command and tools used to install, update and remove 3rd party packages. In this tutorial, we will learn how to install pip and some useful information.
Check and Display Python Version
Before installing the pip we have to be sure that Python is installed. Lego usb devices driver. Also, the version of the Python is important because pip will be installed according to this Python version.
We can see that both PYthon2 and PYthon3 is installed. So we can use installation commands for both Python2 and Python3. The python2 version is Python2.7.16
and Python3 version is Python3.6.8
.
Install Pip with easy_install On MacOS
Drivers renishaw plc port devices. easy_install
is a Python module bundled with setuptools
which gives us the ability to download, build, install, and manage Python packages. Before pip easy_install was the standard package manager for the Python. We can install pip with the easy_install command like below.
If the pip is already installed we can also upgrade the existing pip installation with the easy_install like below. We will use the pip command because it installed already and provide the --upgrade
option with the package name which is also pip.
Install Pip with get-pip.py On MacOS
get-pip.py is another way to install pip in MacOS. get-pip.py is a Python script that will simply download and install the Pip package for Python. First, we will download the get-pip.py script with the curl command. We will provide the URL with the -o
option where we will set the name of the downloaded get-pip.py
file name.
AND then we will call the get-pip.py with the Python interpreter. This will run the get-pip.py file Python codes which will simply install the pip for the macOS or OS X.
Install Pip with brew On MacOS
Homebrew is the package management tool for the macOS. We can use Homebrew in order to install Python and pip. pip is provided with the python package. We will use brew
command with the install
command like below.
If there are problems related to the pip usage we may need to relink the python with the following command.
Brew Install Vim With Python3 Command
Check and Display Pip Version
Brew Install Vim With Python 3 Download
We can check installed pip version with the -V
or --version
option like below.
Compile Vim With Python3
We can see that Python2 pip version is pip 9.0.1
and Python3 pip version is pip 9.0.1
. They are the same version for both Python2 and Python3. This is because to prevent version conflicts and synchronize the feature development of the pip command for both Python versions.