{"id":51467,"date":"2024-10-08T18:53:16","date_gmt":"2024-10-08T10:53:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/51467\/"},"modified":"2024-11-14T10:43:07","modified_gmt":"2024-11-14T02:43:07","slug":"ubuntu-16-04-%e4%b8%8b%e5%ae%89%e8%a3%9d-vim-8-%e4%b8%a6%e6%94%af%e6%8c%81-python-3","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/51467\/","title":{"rendered":"Ubuntu 16.04 \u4e0b\u5b89\u88dd Vim 8 \u4e26\u652f\u6301 Python 3"},"content":{"rendered":"<h1 id=\"ubuntu-16-04-%e4%b8%8b%e5%ae%89%e8%a3%9d-vim-8-%e4%b8%a6%e6%94%af%e6%8c%81-python-3-TgiqFkJZJm\">Ubuntu 16.04 \u4e0b\u5b89\u88dd Vim 8 \u4e26\u652f\u6301 Python 3<\/h1>\n<p>Vim \u662f\u4e00\u6b3e\u5f37\u5927\u7684\u6587\u672c\u7de8\u8f2f\u5668\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u7a0b\u5f0f\u958b\u767c\u548c\u7cfb\u7d71\u7ba1\u7406\u3002\u96a8\u8457 Vim 8 \u7684\u63a8\u51fa\uff0c\u8a31\u591a\u65b0\u529f\u80fd\u548c\u6539\u9032\u4f7f\u5176\u6210\u70ba\u958b\u767c\u8005\u7684\u9996\u9078\u7de8\u8f2f\u5668\u4e4b\u4e00\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Vim 8 \u4e26\u914d\u7f6e\u5176\u652f\u6301 Python 3\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-vim-8-TgiqFkJZJm\">\u5b89\u88dd Vim 8<\/h2>\n<p>\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Vim 8 \u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u66f4\u65b0\u7cfb\u7d71\u7684\u5305\u7ba1\u7406\u5668\uff0c\u7136\u5f8c\u5b89\u88dd Vim\u3002\u4ee5\u4e0b\u662f\u5177\u9ad4\u6b65\u9a5f\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install vim<\/code><\/pre>\n<p>\u9019\u6a23\u5b89\u88dd\u7684 Vim \u7248\u672c\u53ef\u80fd\u4e0d\u662f\u6700\u65b0\u7684 Vim 8\u3002\u8981\u5b89\u88dd\u6700\u65b0\u7248\u672c\uff0c\u60a8\u53ef\u4ee5\u5f9e\u6e90\u78bc\u7de8\u8b6f Vim\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88dd\u4e00\u4e9b\u5fc5\u8981\u7684\u4f9d\u8cf4\u5305\uff1a<\/p>\n<pre><code>sudo apt install git build-essential ncurses-dev python3-dev<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u53ef\u4ee5\u5f9e GitHub \u4e0a\u514b\u9686 Vim \u7684\u6e90\u78bc\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/vim\/vim.git\ncd vim\ngit checkout v8.2.0000  # \u66ff\u63db\u70ba\u6700\u65b0\u7684\u7a69\u5b9a\u7248\u672c<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u7de8\u8b6f\u548c\u5b89\u88dd Vim\uff1a<\/p>\n<pre><code>make\nsudo make install<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-vim-%e4%bb%a5%e6%94%af%e6%8c%81-python-3-TgiqFkJZJm\">\u914d\u7f6e Vim \u4ee5\u652f\u6301 Python 3<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u78ba\u4fdd Vim \u652f\u6301 Python 3\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5 Vim \u7684\u7248\u672c\u548c\u652f\u6301\u7684\u529f\u80fd\uff1a<\/p>\n<pre><code>vim --version<\/code><\/pre>\n<p>\u5728\u8f38\u51fa\u7684\u4fe1\u606f\u4e2d\uff0c\u67e5\u627e &#8220;+python3&#8243;\u3002\u5982\u679c\u770b\u5230\u9019\u500b\u6a19\u8a18\uff0c\u5247\u8868\u793a Vim \u5df2\u7d93\u652f\u6301 Python 3\u3002\u5982\u679c\u662f &#8220;-python3&#8243;\uff0c\u5247\u9700\u8981\u91cd\u65b0\u7de8\u8b6f Vim\uff0c\u4e26\u78ba\u4fdd\u5728\u7de8\u8b6f\u6642\u5305\u542b Python 3 \u7684\u652f\u6301\u3002<\/p>\n<h3 id=\"%e7%b7%a8%e8%ad%af-vim-%e6%99%82%e6%b7%bb%e5%8a%a0-python-3-%e6%94%af%e6%8c%81-TgiqFkJZJm\">\u7de8\u8b6f Vim \u6642\u6dfb\u52a0 Python 3 \u652f\u6301<\/h3>\n<p>\u5982\u679c\u60a8\u9700\u8981\u91cd\u65b0\u7de8\u8b6f Vim\uff0c\u8acb\u78ba\u4fdd\u5728\u57f7\u884c `make` \u547d\u4ee4\u4e4b\u524d\u8a2d\u7f6e\u76f8\u61c9\u7684\u9078\u9805\u3002\u4ee5\u4e0b\u662f\u7de8\u8b6f Vim \u6642\u6dfb\u52a0 Python 3 \u652f\u6301\u7684\u547d\u4ee4\uff1a<\/p>\n<pre><code>.\/configure --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=$(python3-config --configdir) --enable-cscope --prefix=\/usr\nmake\nsudo make install<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-vim-%e6%8f%92%e4%bb%b6%e7%ae%a1%e7%90%86%e5%99%a8-TgiqFkJZJm\">\u5b89\u88dd Vim \u63d2\u4ef6\u7ba1\u7406\u5668<\/h2>\n<p>\u70ba\u4e86\u63d0\u9ad8 Vim \u7684\u4f7f\u7528\u6548\u7387\uff0c\u60a8\u53ef\u4ee5\u5b89\u88dd\u63d2\u4ef6\u7ba1\u7406\u5668\uff0c\u4f8b\u5982 Vundle \u6216 Pathogen\u3002\u9019\u88e1\u4ee5 Vundle \u70ba\u4f8b\uff0c\u4ecb\u7d39\u5982\u4f55\u5b89\u88dd\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/VundleVim\/Vundle.vim.git ~\/.vim\/bundle\/Vundle.vim<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u60a8\u9700\u8981\u5728 Vim \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0 Vundle \u7684\u8a2d\u7f6e\u3002\u7de8\u8f2f\u6216\u5275\u5efa `~\/.vimrc` \u6587\u4ef6\uff0c\u4e26\u6dfb\u52a0\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<pre><code>set nocompatible              \" be iMproved, required\nfiletype off                  \" required\n\n\" set the runtime path to include Vundle and initialize\nset rtp+=~\/.vim\/bundle\/Vundle.vim\ncall vundle#begin()\n\n\" let Vundle manage Vundle, required\nPlugin 'VundleVim\/Vundle.vim'\n\n\" \u5728\u6b64\u6dfb\u52a0\u5176\u4ed6\u63d2\u4ef6\ncall vundle#end()            \" required\nfiletype plugin indent on    \" required<\/code><\/pre>\n<p>\u4fdd\u5b58\u4e26\u9000\u51fa Vim\uff0c\u7136\u5f8c\u91cd\u65b0\u6253\u958b Vim\uff0c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88dd\u63d2\u4ef6\uff1a<\/p>\n<pre><code>:PluginInstall<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-TgiqFkJZJm\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu 16.04 \u4e0a\u5b89\u88dd Vim 8 \u4e26\u914d\u7f6e\u5176\u652f\u6301 Python 3 \u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\u3002\u901a\u904e\u7de8\u8b6f\u6e90\u78bc\uff0c\u60a8\u53ef\u4ee5\u7372\u5f97\u6700\u65b0\u7248\u672c\u7684 Vim\uff0c\u4e26\u78ba\u4fdd\u5176\u652f\u6301 Python 3\u3002\u5b89\u88dd\u63d2\u4ef6\u7ba1\u7406\u5668\u5f8c\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5730\u64f4\u5c55 Vim \u7684\u529f\u80fd\uff0c\u63d0\u5347\u958b\u767c\u6548\u7387\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u74b0\u5883\u4f86\u9032\u884c\u958b\u767c\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u958b\u767c\u5de5\u4f5c\u63d0\u4f9b\u5f37\u5927\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install Vim 8 on Ubuntu 16.04 with Python 3 support, enhancing your text editing experience with powerful features and functionality.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-51467","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=51467"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51467\/revisions"}],"predecessor-version":[{"id":51468,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/51467\/revisions\/51468"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=51467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=51467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=51467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}