{"componentChunkName":"component---node-modules-gatsby-theme-gine-blog-src-components-post-blog-post-js","path":"/posts/5c199c910ee7410c95ad8244e681a525","webpackCompilationHash":"abbc32fa0c65a814f292","result":{"data":{"siteConfig":{"title":"812lcl's Blog","commentDisqusShortname":"812lcl-notion-blog","commentOpen":true},"posts":{"public_date":"2013-12-06","name":"Vim补全配置","tags":["Vim"],"html":"<div data-block-id=\"de5b912f-d5a8-4ec8-9c66-dfa687780415\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 2px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">vim已经自带了补全功能，通过几个补全插件可以使其补全发挥的更出色，以下主要介绍5种不同的补全，并不需要全部安装，根据需求选择安装，具体安装方法可以见<a href=\"https://blog.812lcl.com/posts/a0d4660fc3c3417f968322aea6ec08e7\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">Vim插件配置续</a>或<a href=\"https://blog.812lcl.com/posts/d00da926b3dd47b38294ea0324ef090d\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"3\">Vim插件配置，比肩IDE</a>。</div></div></div></div><div data-block-id=\"f2bcf638-1563-4592-b740-3c93574d9980\" class=\"notion-selectable notion-sub_header-block\" style=\"width: 100%; max-width: 608px; margin-top: 1.4em; margin-bottom: 1px; color: rgb(55, 53, 47);\"><div style=\"display: flex; width: 100%; font-weight: 600; font-size: 1.5em; line-height: 1.3; color: inherit; fill: inherit;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"Heading 2\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">1. <a href=\"https://github.com/vim-scripts/javacomplete\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">javacomplete</a></div></div></div><div data-block-id=\"81f6fe29-5a09-42b0-8d80-7e5652e4dafc\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这个是个java补全的插件，需要编译以下autoload目录下的Reflection.java，然后将编译生成的Reflection.class文件移动到主目录下即可。当然要实现补全功能，必须在vim中开启文件类型识别，不多述了。</div></div></div></div><div data-block-id=\"9f5a989f-948b-4d18-84e5-c7f4b6a3aa53\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">另外Java补全，还可以使用<a href=\"http://eclim.org/\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">eclim</a>。</div></div></div></div><div data-block-id=\"d40161ba-534b-4066-96f0-bbe92f5a6f1c\" class=\"notion-selectable notion-image-block\" style=\"width: 100%; max-width: 800px; align-self: center; margin-top: 0.5em; margin-bottom: 0.5em;\"><div><div style=\"display: flex;\"><div class=\"notion-cursor-default\" style=\"position: relative; overflow: hidden; flex-grow: 1;\"><div style=\"position: relative;\"><div style=\"width: 100%; height: 100%;\"><img src=\"https://www.notion.so/image/http%3A%2F%2Fpic002.cnblogs.com%2Fimages%2F2012%2F342823%2F2012041511171014.png?table=block&amp;id=d40161ba-534b-4066-96f0-bbe92f5a6f1c&amp;cache=v2\" style=\"display: block; object-fit: cover; border-radius: 1px; width: 100%; pointer-events: auto;\"></div></div></div></div></div></div><div data-block-id=\"d65708bc-eaca-4211-aeda-e6c59658be2c\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">javacomplete</div></div></div></div><div data-block-id=\"48225dbb-c84f-443c-afed-54dd8dc05688\" class=\"notion-selectable notion-sub_header-block\" style=\"width: 100%; max-width: 608px; margin-top: 1.4em; margin-bottom: 1px; color: rgb(55, 53, 47);\"><div style=\"display: flex; width: 100%; font-weight: 600; font-size: 1.5em; line-height: 1.3; color: inherit; fill: inherit;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"Heading 2\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">2. <a href=\"https://github.com/vim-scripts/OmniCppComplete\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">omnicppcomplete</a></div></div></div><div data-block-id=\"51aa23f9-6401-4386-a5cf-de85f34d1bb7\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这个插件是用来补全C++的，需要ctags生成项目的tag文件并加载到当前vim中，然后可以根据<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">. -&gt; ::</span>等符号自动补全，在之前的文章中也都介绍过了。 ## 3. <a href=\"https://github.com/Shougo/neocomplcache.vim\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"3\">neocomplcache</a> Original filename completion</div></div></div></div><div data-block-id=\"e1a0c4e3-db5f-4073-ae5e-31f4b670aeb8\" class=\"notion-selectable notion-image-block\" style=\"width: 100%; max-width: 800px; align-self: center; margin-top: 0.5em; margin-bottom: 0.5em;\"><div><div style=\"display: flex;\"><div class=\"notion-cursor-default\" style=\"position: relative; overflow: hidden; flex-grow: 1;\"><div style=\"position: relative;\"><div style=\"width: 100%; height: 100%;\"><img src=\"https://github-camo.global.ssl.fastly.net/5c0c143ad7b1b39fb3a1ec5e2b39c315d6e70391/687474703a2f2f312e62702e626c6f6773706f742e636f6d2f5f63693279426e717a4a674d2f5444314f355f624f5132492f41414141414141414144452f7648663958675f6d7254492f73313630302f66696c656e616d655f636f6d706c6574652e706e67\" style=\"display: block; object-fit: cover; border-radius: 1px; width: 100%; pointer-events: auto;\"></div></div></div></div></div></div><div data-block-id=\"c72c4ee9-5fa4-456c-b143-c6789723a64e\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">neocomplcache</div></div></div></div><div data-block-id=\"089511ff-94f7-4077-85ef-3264cf100b8f\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">Omni completion</div></div></div></div><div data-block-id=\"3e5c2823-4b5a-448d-ba37-2e3ace7f1e07\" class=\"notion-selectable notion-image-block\" style=\"width: 100%; max-width: 800px; align-self: center; margin-top: 0.5em; margin-bottom: 0.5em;\"><div><div style=\"display: flex;\"><div class=\"notion-cursor-default\" style=\"position: relative; overflow: hidden; flex-grow: 1;\"><div style=\"position: relative;\"><div style=\"width: 100%; height: 100%;\"><img src=\"https://github-camo.global.ssl.fastly.net/9fc2701fcb8b4a54ab9e0d0ff2902b11aadb825f/687474703a2f2f322e62702e626c6f6773706f742e636f6d2f5f63693279426e717a4a674d2f54443150546f6c6b5442492f41414141414141414144552f6b6e4a33656e69754857492f73313630302f6f6d6e695f636f6d706c6574652e706e67\" style=\"display: block; object-fit: cover; border-radius: 1px; width: 100%; pointer-events: auto;\"></div></div></div></div></div></div><div data-block-id=\"184470fd-ef19-4c9e-9741-f7f06d1b6da5\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">neo</div></div></div></div><div data-block-id=\"34d2cd8f-a095-40c6-ad0e-aa6d36276fb3\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这种补全我是作为<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">clang-complete</span>或<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">YouCompleteMe</span>的一种补充，对于 /nginx/tmux/shell/vimscript等文件，它都有默认的关键字支持，还有目录文件 补全，一边输入就会一边列出可以补全的项，而不用按等命令来选择 不同的补全，可以使用或进行上下选择不同的补全，如果有supertab 插件更是如虎添翼了。</div></div></div></div><div data-block-id=\"658b2594-b2bf-410e-a37d-21d80930b212\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这是我在配合YCM的时候的配置，由YCM补全c、cpp、java、python的文件，其他文件的补全则由neocomplcache实现。配置文件查看<a href=\"https://github.com/812lcl/.vim\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">.vim</a>。</div></div></div></div><div data-block-id=\"b04f5170-3e5a-4b28-ae71-57d201299c4c\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">let g:neocomplcache_enable_at_startup = 1\nau Filetype c,cpp,java,python let g:neocomplcache_enable_at_startup = 0\nset dict+=$HOME/.vim/static/dict_with_cases\nlet g:neocomplcache_dictionary_filetype_lists = {'_' : $HOME . \"/.vim/static/english_dict\"}\nlet g:neocomplcache_auto_completion_start_length = 1\nlet g:neocomplcache_enable_smart_case = 1\nlet g:neocomplcache_enable_fuzzy_completion = 1               \" 开启模糊匹配\nlet g:neocomplcache_fuzzy_completion_start_length = 3         \" 3个字母后开启模糊匹配\nlet g:neocomplcache_min_syntax_length = 3\nlet g:neocomplcache_lock_buffer_name_pattern = '\\*ku\\*'<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"0c3672c4-09e2-4303-b997-2ac4adfc5057\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">在和clang-complete配合补全时，会有一些冲突，配置时需要配置时去除冲突。配置文件查看<a href=\"https://github.com/812lcl/vim_withoutYCM\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">vim_withoutYCM</a>。</div></div></div></div><div data-block-id=\"47fb65d9-be70-4e66-ba3a-f424deb61160\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">let g:neocomplcache_enable_at_startup = 1\nlet g:neocomplcache_enable_smart_case = 1\nlet g:neocomplcache_min_syntax_length = 3\nlet g:neocomplcache_lock_buffer_name_pattern = '\\*ku\\*'\n\nif !exists('g:neocomplcache_force_omni_patterns')\n        let g:neocomplcache_force_omni_patterns = {}\nendif\nlet g:neocomplcache_force_overwrite_completefunc = 1\nlet g:neocomplcache_force_omni_patterns.c =\n                        \\ '[^.[:digit:] *\\t]\\%(\\.\\|-&gt;\\)'\nlet g:neocomplcache_force_omni_patterns.cpp =\n                        \\ '[^.[:digit:] *\\t]\\%(\\.\\|-&gt;\\)\\|\\h\\w*::'\nlet g:neocomplcache_force_omni_patterns.objc =\n                        \\ '[^.[:digit:] *\\t]\\%(\\.\\|-&gt;\\)'\nlet g:neocomplcache_force_omni_patterns.objcpp =\n                        \\ '[^.[:digit:] *\\t]\\%(\\.\\|-&gt;\\)\\|\\h\\w*::'\nlet g:clang_complete_auto = 0\nlet g:clang_auto_select = 0<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"387110db-e8a8-451c-b4d2-1e67ef8a75f8\" class=\"notion-selectable notion-sub_header-block\" style=\"width: 100%; max-width: 608px; margin-top: 1.4em; margin-bottom: 1px; color: rgb(55, 53, 47);\"><div style=\"display: flex; width: 100%; font-weight: 600; font-size: 1.5em; line-height: 1.3; color: inherit; fill: inherit;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"Heading 2\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">4. <a href=\"https://github.com/vim-scripts/clang-complete\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">clang-complete</a></div></div></div><div data-block-id=\"b6a4d63a-4d0a-4ed3-8670-ba43b79df81c\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这也是用于C/C++/Objective-C/Objective-C++的补全，它是利用clang自动分析当前项目，实现补全，比omnicppcoplete方便且高级多了，不需要每一次生成tag文件并加载了。这个插件需要系统安装了clang，对vim也有一定的要求，需要7.3以上且支持python。把需要的东西都安装好，将插件放入<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">~/.vim/bundle</span>目录下即可使用，并不需要在<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">.vimrc</span>中添加什么配置，很是方便。试用了下效果很不错，而且使用这个插件比YCM可是轻便多了，整个.vim目录也不过几MB而已，而且不用耗费心力配置。所以对YCM编译发憷的同志们使用这个插件也可满足了，只不过据说在工程文件太大的时候它比较慢。 ## 5. <a href=\"https://github.com/Valloric/YouCompleteMe\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"5\">YouCompleteMe</a></div></div></div></div><div data-block-id=\"393953ba-2187-4710-9f1f-dd9ea30ebf41\" class=\"notion-selectable notion-image-block\" style=\"width: 100%; max-width: 800px; align-self: center; margin-top: 0.5em; margin-bottom: 0.5em;\"><div><div style=\"display: flex;\"><div class=\"notion-cursor-default\" style=\"position: relative; overflow: hidden; flex-grow: 1;\"><div style=\"position: relative;\"><div style=\"width: 100%; height: 100%;\"><img src=\"https://github-camo.global.ssl.fastly.net/1f3f922431d5363224b20e99467ff28b04e810e2/687474703a2f2f692e696d6775722e636f6d2f304f50346f6f642e676966\" style=\"display: block; object-fit: cover; border-radius: 1px; width: 100%; pointer-events: auto;\"></div></div></div></div></div></div><div data-block-id=\"5b43cecd-c06d-42a1-966e-d003c4933343\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">YCM</div></div></div></div><div data-block-id=\"822175c4-6867-41f5-a9ce-c8b6e2475779\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">重头戏登场了，从名字来看就够霸气了，公认的补全神奇，只不过属于编译行插件，稍微麻烦一些，而且体积确实大了一些，编译完后这个插件就达到了七八十MB大小。不过补全效果最好，支持<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">C/C++/Objective-C/Objective-C++</span>的补全，还支持基于Jedi的Python补全和基于OmniSharp的C#补全，号称安了这个插件就不需要下面四个了</div></div></div></div><div data-block-id=\"74890ef1-a827-47da-a4e0-4d8eee19ec8d\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">clang_complete</div></div></div></div></div><div data-block-id=\"a2120c46-f16d-4381-9d5f-d2c1b4cddd8d\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">AutoComplPop</div></div></div></div></div><div data-block-id=\"f4d5c49c-efe8-4983-ba91-cf4edb98be50\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">Supertab</div></div></div></div></div><div data-block-id=\"562a0c5b-11b0-4490-aa7b-9251659eaf1f\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">neocomplcache</div></div></div></div></div><div data-block-id=\"675485f6-6af1-4708-b7f0-4b50510967f6\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">而且这插件和Syntastic和ultisnips的配合也都很好。而我最终选用这个插件是因为它支持模糊匹配功能，你只需要输入想要输入的单词的子序列即可匹配到，如你想匹配的名为<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">printf</span>，只需输入<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">ptf</span>即可。而且它还支持从一个变量跳转到它的声明或定义处的功能，都是很好用的，所以费了一番功夫编译好它还是值得的。</div></div></div></div><div data-block-id=\"ff0d6720-f482-4eb1-9c55-bd69e696b99d\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这个插件是需要<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">build-essential</span>、<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">camke</span>、<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"5\">clang</span>、<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"7\">python-dev</span>等很多支持的，还需要vim高于7.3.584。ubuntu用户需要重新编译安装更高版本的vim了，方法参见<a href=\"https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"9\">compile Vim from source</a>，fedora用户就省事多了。具体编译和使用参看<a href=\"https://github.com/Valloric/YouCompleteMe\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"11\">项目主页</a>即可。</div></div></div></div><div data-block-id=\"3c9cdba6-a582-4597-b908-9beb8fce4d06\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">编译安装vim</div></div></div></div><div data-block-id=\"2a1f766a-f8f0-4f56-8081-d603388a7fe0\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">1.安装依赖库</div></div></div></div><div data-block-id=\"68d03560-c694-4d11-9e6a-f48cc958ec99\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">sudo apt-get install ctags cscope libncurses5-dev libgnome2-dev libgnomeui-dev \\\n                     libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \\\n                     libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev mercurial<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"0979921b-b236-45f4-b686-3741f33114e9\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">2.删除vim</div></div></div></div><div data-block-id=\"ed43b5f1-c3fd-4c29-9837-1df84716e6d9\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">sudo apt-get remove vim vim-runtime gvim vim-tiny vim-common vim-gui-common<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"49f4e557-e8a6-4d1b-b87a-3b12b9847573\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">3.编译安装vim</div></div></div></div><div data-block-id=\"087819a4-141c-4853-9e09-834728da0aee\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">cd ~\nhg clone https://code.google.com/p/vim/\ncd vim\n./configure --with-features=huge \\\n            --enable-rubyinterp \\\n            --enable-pythoninterp \\\n            --with-python-config-dir=/usr/lib/python2.7-config \\\n            --enable-perlinterp \\\n            --enable-gui=gtk2 --enable-cscope \\\n            --enable-luainterp \\\n            --prefix=/usr\nmake VIMRUNTIMEDIR=/usr/share/vim/vim74\nsudo make install<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"131c826b-eb88-4c5b-8b6d-987f29ed3bf4\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">4.设置vim为默认编辑器</div></div></div></div><div data-block-id=\"b9594df7-441e-433c-a8ae-afef5946f5e2\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1\nsudo update-alternatives --set editor /usr/bin/vim\nsudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1\nsudo update-alternatives --set vi /usr/bin/vim<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"a23db0d9-9070-49f1-9618-ceb66a34015b\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">看过好多博客写的YCM编译的教程，最后还是感觉项目主页上的原版安装教程最好，而且编译过程中可能出现各种问题，仔细阅读作者的教程，一切问题都可以解决。下面是安装编译YCM的步骤，包括几种不同的编译方法。</div></div></div></div><div data-block-id=\"d9800df0-a048-497a-a46d-3ab5bdc36a20\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">1.安装依赖软件</div></div></div></div><div data-block-id=\"f76614f9-fe4d-49de-844b-1a2bd3b509d3\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">sudo apt-get install build-essential cmake python-dev clang llvm<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"39fd29a7-d74c-4ca8-8fd9-1b4a2378114c\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">2.安装YCM</div></div></div></div><div data-block-id=\"1f5d3057-7e9c-4a5e-9047-b41f9ab5fa49\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">在<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">~/.vimrc</span>中添加<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">\"Bundle Valloric/YouCompleteMe\"</span>，打开Vim，执行<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"5\">:BundleInstall</span>命令，等待安装完毕。</div></div></div></div><div data-block-id=\"9ec4485b-7d87-41ab-964c-e412c0f864f4\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">3.编译YCM</div></div></div></div><div data-block-id=\"2c0046db-3cfe-48bc-bc6e-4e1fb33aed96\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">编译根据系统clang和llvm的情况有所不同，分为几种情况。</div></div></div></div><div data-block-id=\"15caa99a-f40d-4b0b-a070-cc54ea234d73\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">clang、llvm等级高于3.3</div></div></div></div></div><div data-block-id=\"836bbc29-23a1-4cef-a4e7-2ff35bce8b8c\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">这种情况最简单，执行YouCompleteMe中自带的安装脚本即可。</div></div></div></div><div data-block-id=\"1646ce6d-17db-4167-9e9f-d7a0d6a0d812\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">cd ~/.vim/bundle/YouCompleteMe\n./install.sh --clang-completer [--omnisharp-completer]<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"f36ec1fd-42fc-4fa3-ac89-be0179aa137b\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\"><span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"0\">--omnisharp-completer</span>是使YCM支持C#的补全，根据自己需要选择。</div></div></div></div><div data-block-id=\"f9e5ff9e-40be-4479-be37-abadfcaba548\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">系统的clang等级高于3.3，手动编译</div></div></div></div></div><div data-block-id=\"c373c16e-a13f-49ef-a20f-083b25586195\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">mkdir ~/ycm_build\ncd ~/ycm_build\ncmake -G \"Unix Makefiles\" -DUSE_SYSTEM_LIBCLANG=ON . ~/.vim/bundle/YouCompleteMe/cpp\nmake ycm_core\nmake ycm_support_libs\nmake<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"b3062d30-428e-45b7-afab-8e8bd8c585af\" class=\"notion-selectable notion-bulleted_list-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"display: flex; align-items: flex-start; width: 100%; padding-left: 2px; color: inherit; fill: inherit;\"><div style=\"margin-right: 4px; width: 24px; display: flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; min-height: calc((1.5em + 3px) + 3px); padding-right: 2px;\"><div style=\"width: 6px; height: 6px; border-radius: 6px; background: currentcolor; margin-top: 0.1em;\"></div></div><div style=\"flex: 1 1 0px; min-width: 1px; display: flex; flex-direction: column;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\"List\" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding-top: 3px; padding-bottom: 3px; text-align: left;\">下载对应系统版本的clang+llvm的Pre-build Binaries包，<a href=\"http://llvm.org/releases/download.html#3.4\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\">下载地址</a>，编译。此时系统不必装clang和llvm，编译完成后，可删除Pre-build Binaries包。</div></div></div></div></div><div data-block-id=\"b6f63f84-0009-4902-a08e-221635968bc6\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">mkdir ~/ycm_tmp\ntar -zxvf clang+llvm-3.4.tar.gz -C ~/ycm_tmp/llvm\nmkdir ~/ycm_build\ncd ~/ycm_build\ncmake -G \"Unix Makefiles\" -DPATH_TO_LLVM_ROOT=~/ycm_tmp/llvm . ~/.vim/bundle/YouCompleteMe/cpp\n或者\ncmake -G \"Unix Makefiles\" -DEXTERNAL_LIBCLANG_PATH=~/ycm_tmp/llvm/lib/libclang.so . ~/.vim/bundle/YouCompleteMe/cpp\nmake ycm_core\nmake ycm_support_libs\nmake<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"1477b4c8-3def-4c02-8d03-7121fdb31254\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">最后来说一说clang和llvm的编译安装，可以使用<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"1\">apt-get</span>或<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"3\">yum</span>等安装，但等级可能不满足，ubuntu库中clang的等级只到来3.2，fedora则比较高。所以有时候可能需要编译安装，或下载对应的Pre-build Binaries包。</div></div></div></div><div data-block-id=\"71270d9e-2d53-4133-9f43-8b6f4d84622f\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\"><a href=\"http://llvm.org/releases/download.html#3.4\" style=\"text-decoration:underline;color:inherit;cursor:pointer;word-wrap:break-word\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"0\">llvm.org</a>如果有对应系统版本的Pre-build Binaries包，解压到<span style=\"font-family:&quot;SFMono-Regular&quot;, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace;line-height:normal;background:rgba(135,131,120,0.15);color:#EB5757;border-radius:3px;font-size:85%;padding:0.2em 0.4em\" data-token-index=\"2\">/usr/local</span>即可。</div></div></div></div><div data-block-id=\"5a434857-5ed3-4a05-8ae9-4efb50d248b5\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">否则只好自己编译安装来，耗时比较长。</div></div></div></div><div data-block-id=\"b9e06f1d-3c92-448a-944a-b447693366eb\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">下载clang source code和LLVM source code\ncd ~/ycm_tmp\ntar -zxvf llvm-3.4.src.tar.gz -C llvm\ntar -zxvf clang-3.4.src.tar.gz -C ./llvm/tools/clang\nmkdir build\ncd build\ncmake ../llvm/CMAKElist.txt ../llvm\nmake\nsudo make install<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"294ae457-8769-4604-b650-3f17cfaffa5f\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">完成后，clang和llvm就已经安装好来，可以按照第一二种编译方法，编译YCM了。</div></div></div></div><div data-block-id=\"a8844a88-6bc2-4abe-b132-404c5a36512e\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">因为YCM默认开启来syntastic功能，即静态预防检查，随着你的输入会刷新gutter，以显示错误或警告的signs。如果你还使用vim-gitgutter插件，则无法正常显示。这时我的做法是，关闭YouCompleteMe的syntastic，独立安装syntastic插件。</div></div></div></div><div data-block-id=\"c725bd19-05c4-496a-8123-a6cfd5d7344f\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 1px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">我的YCM配置如下</div></div></div></div><div data-block-id=\"12c0187f-5d55-49bd-8d62-5f3776df3aa4\" class=\"notion-selectable notion-code-block\" style=\"width: 100%; max-width: 608px; margin-top: 4px; margin-bottom: 4px;\"><div style=\"display: flex;\"><div style=\"flex-grow: 1; border-radius: 3px; text-align: left; position: relative; background: rgb(247, 246, 243); min-width: 0px; width: 100%;\"><div class=\"line-numbers notion-code-block\" style=\"display: flex; overflow-x: auto;\"><div contenteditable=\"false\" spellcheck=\"false\" autocorrect=\"off\" autocapitalize=\"off\" data-root=\"true\" style=\"flex-grow: 1; flex-shrink: 1; text-align: left; font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, Courier, monospace; font-size: 85%; tab-size: 2; padding: 30px 16px 30px 20px; min-height: 1em; color: rgb(55, 53, 47); white-space: pre;\">set completeopt=longest,menu                    \" 关掉补全时的预览窗口\nlet g:ycm_confirm_extra_conf = 0                \" 不用每次提示加载.ycm_extra_conf.py文件\nlet g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'\nlet g:ycm_show_diagnostics_ui = 0               \" 关闭ycm的syntastic\nlet g:ycm_filetype_whitelist = {'c' : 1, 'cpp' : 1, 'java' : 1, 'python' : 1}\nlet g:ycm_complete_in_comments = 1              \" 评论中也应用补全\nlet g:ycm_min_num_of_chars_for_completion = 2   \" 两个字开始补全\nlet g:ycm_seed_identifiers_with_syntax = 1\nlet g:ycm_key_invoke_completion = '&lt;C-Space&gt;'\nlet g:ycm_semantic_triggers =  {'c' : ['-&gt;', '.'], 'objc' : ['-&gt;', '.'], 'ocaml' : ['.', '#'], 'cpp,objcpp' : ['-&gt;', '.', '::'], 'php' : ['-&gt;', '::'], 'cs,java,javascript,vim,coffee,python,scala,go' : ['.'], 'ruby' : ['.', '::']}\nnnoremap &lt;F5&gt; :YcmForceCompileAndDiagnostics&lt;CR&gt;\nnnoremap &lt;leader&gt;jd :YcmCompleter GoToDefinitionElseDeclaration&lt;CR&gt;<span>\n</span></div></div><div style=\"position: absolute; top: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"></div><div style=\"position: absolute; bottom: 0px; right: 0px; color: rgba(55, 53, 47, 0.6); display: flex; align-items: center; justify-content: flex-end; height: 30px;\"><div role=\"button\" aria-disabled=\"true\" tabindex=\"-1\" style=\"user-select: none; transition: background 120ms ease-in 0s; display: inline-flex; align-items: center; white-space: nowrap; height: 20px; border-radius: 3px; font-size: 12px; line-height: 1.2; padding-left: 5px; padding-right: 5px; color: rgba(55, 53, 47, 0.6); margin-right: 5px;\">Plain Text<svg viewBox=\"0 0 30 30\" class=\"chevronDown\" style=\"width: 10px; height: 100%; display: block; fill: rgba(55, 53, 47, 0.3); flex-shrink: 0; backface-visibility: hidden; margin-left: 4px;\"><polygon points=\"15,17.4 4.8,7 2,9.8 15,23 28,9.8 25.2,7 \"></polygon></svg></div></div></div></div></div><div data-block-id=\"ee2f2d6f-a9c7-4aa4-806c-a6f400e3f65d\" class=\"notion-selectable notion-text-block\" style=\"width: 100%; max-width: 608px; margin-top: 1px; margin-bottom: 0px;\"><div style=\"color: inherit; fill: inherit;\"><div style=\"display: flex;\"><div contenteditable=\"false\" spellcheck=\"true\" placeholder=\" \" data-root=\"true\" style=\"max-width: 100%; width: 100%; white-space: pre-wrap; word-break: break-word; caret-color: rgb(55, 53, 47); padding: 3px 2px;\">vim就先折腾到这了。</div></div></div></div>","slug":"5c199c910ee7410c95ad8244e681a525","keywords":["博客"]}},"pageContext":{"isCreatedByStatefulCreatePages":false,"slug":"5c199c910ee7410c95ad8244e681a525"}}}