鉴于在window下基本不用vim,下面的内容就不提window了。具体可以查看对应github中的手册操作基础:nodejs(npm)。如果没有安装,可以移步官网:https://nodejs.org/en/还有一个sublime的配置方法,请移步:sublime配置与使用技巧插件管理工具pathogengithub地址:githubmkdir-p~/.vim/autoload~/.vim/bundle&&\curl-LSso~/.vim/autoload/pathogen.vimhttps://tpo.pe/pathogen.vim插件安装plugin都安装在~/.vim/bundle/下,以下操作可能需要root权限vim-sensiblevim新手专属githubcd~/.vim/bundle/gitclonegit://github.com/tpope/vim-sensible.gitAirline界面优化githubcd~/.vim/bundle/gitclonehttps://github.com/vim-airline/vim-airline-themes.gitAirline主题githubcd~/.vim/bundle/gitclonehttps://github.com/vim-airline/vim-airline-themes~/.vim/bundle/vim-airline-themesEmmet快速搭建html树githubcd~/.vim/bundle/gitclonehttps://github.com/mattn/emmet-vim.giteditorconfig编辑器配置githubcd~/.vim/bundle/gitclonehttps://github.com/editorconfig/editorconfig-vim.git新建文件vim~/.vim/.editconfig(可自定义,一般放在项目根目录下),输入以下内容设置:root=trueindent_style=spaceindent_size=2tab_width=2end_of_line=lfcharset=utf-8insert_final_newline=truetrim_trailing_whitespace=truevim-multiple-cursors支持多行编辑githubcd~/.vim/bundle/gitclonehttps://github.com/terryma/vim-multiple-cursors.gitunite-vim快速管理项目中的文件githubcd~/.vim/bundle/gitclonehttps://github.com/Shougo/unite.vim.gitvim-javascript缩进和语法支持githubcd~/.vim/bundle/gitclonehttps://github.com/pangloss/vim-javascript.gitjsDocvim-javascript的补充,支持es6和TypeScirptgithubcd~/.vim/bundle/gitclonehttps://github.com/heavenshell/vim-jsdoc.gitFugitivegit版本控制githubgitclonegit://github。com/tpope/vim-fugitive.gitvim-uNONE-c"helptagsvim-fugitive/doc"-cqsyntastic语法检查githubcd~/.vim/bundle/gitclone--depth=1https://github.com/vim-syntastic/syntastic.gitsyntastic需要一些其他的npminstall-gjslintnpminstall-gcsslintcd~/.vim/bundle/gitclonehttps://github.com/hail2u/vim-css3-syntax.gitbrewinstalltidy-html5vim-css-color自动预览颜色githubcd~/.vim/bundle/gitclonehttps://github.com/skammer/vim-css-color.gitvim-snipmate自动补全代码阻止githubcd~/.vim/bundle/gitclonehttps://github.com/tomtom/tlib_vim.gitgitclonehttps://github.com/MarcWeber/vim-addon-mw-utils.gitgitclonehttps://github.com/garbas/vim-snipmate.git#可选:gitclonehttps://github.com/honza/vim-snippets.gitvim-surround辅助格式控制(括号、引号等)githubcd~/.vim/bundle/gitclonegit://github.com/tpope/vim-surround.gitjsbeauty-vim自动美化代码,可以使用githubcdwithvim-autoformat~/.vim/bundle/gitclonehttps://github.com/maksimr/vim-jsbeautify.gitcdvim-jsbeautify&&gitsubmoduleupdate--init--recursivevim-markdown将高亮功能扩展到markdowngithubcd~/.vim/bundle/gitclonehttps://github.com/plasticboy/vim-markdown.gitvim-instant-markdown预览markdowngithubnpm-ginstallinstant-markdown-dvim-markdown-toc为markdown生成标头githubcd~/.vim/bundle/gitclonehttps://github.com/mzlogin/vim-markdown-toc.gityoucompleteme代码提示和补全github这个放在最后是因为比较复杂,是可选插件,可以根据自己的需要安装。首先在vim普通模式下输入:version查看其版本,要求版本大于7.4.143,否则更新。二、在vim普通模式下输入:echohas('python')||has('python3'),如果输出为0,请更新vim以支持python。之后,在终端输入:cd~/.vim/bundle/gitclonehttps://github.com/Valloric/YouCompleteMe.gitcd~/.vim/bundle/YouCompleteMe/gitsubmoduleupdate--init--recursivecd~/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/tern_runtimenpminstall--production如果需要支持typescript,安装:npminstall-gtypescriptvim-lesslessupportsgithubcd~/.vim/bundle/gitclonehttps://github。com/groenewege/vim-less到这里还没说完,作为一个前端人,这个不能正常工作,需要一些依赖,我们来安装这些依赖:installterngithub回bundle目录安装cd~/.vim/bundlegitclonehttps://github.com/ternjs/tern_for_vim.gitcd~/.vim/bundle/tern_for_vimnpminstall后,需要在项目的根目录下创建一个.tern-project文件。没有内容,只有空白。文件内部结构如下::"./","paths":{}}}}这部分的详细配置在这里http://ternjs.net/doc/manual.htmlapt-vim自动管理插件github这里安装另一个插件-在自动管理插件中,也比较麻烦,根据自己的需要安装:自动安装curl-sLhttps://raw.githubusercontent.com/egalpin/apt-vim/master/install.sh|sh2。手动安装需要Python2.7.x或者Python3.0+cd~/.vim/bundle/gitclonehttps://github.com/egalpin/apt-vim.gitcdapt-vimsudo./apt-viminitedit~/.bashrcor~/.bash_profile,添加下面一句exportPATH=$PATH:~/.vimpkg/bin编辑~/.vimrc添加:executepathogen#infect()callpathogen#helptags()在终端继续执行:source~/.bashrcapt-viminstall如果这里提示:Completedsuccessfully.那么你就完成了。至此,作为前端人的vim基本搭建完成。如果有什么好用的插件,欢迎分享交流。如果你觉得这些插件够用了,你可以去知乎、stackoverflow、或者github多挖一些。一些更高级的插件会随着博主的积累不断更新本篇内容,欢迎关注。下面附上了我.vimrc和.editorconfig文件的内容:"vimrc"vimoriginalconfigsetignorecase"ignoreupper-orlowercaseinsearchmodelsetsmartcase"如果搜索字符串中有大写字母忽略'ignorecase'设置。它只适用于'ignorecase'settingsetautowrite"autowritechangesintofileafter:next、:rewind、:last、:first、:previous、:stop、:suspend、:tag、:!、:make、
