博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mac vim“装逼”配置
阅读量:6118 次
发布时间:2019-06-21

本文共 3498 字,大约阅读时间需要 11 分钟。

 

配置c++ 等编程语言补全等

from blog http://www.cnblogs.com/xiaobo-Linux/p/8909402.html

1. 安装 macvim

brew install macvim

将vim替换为mvim

alias vim='mvim -v'

 

2.安装Vundle

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

输入 vim

shift + : 

输入

:PluginInstall

自动安装 YouCompleteMe

3.安装cmake

brew install CMake

4.配置YouCompleteMe

cd ~/.vim/bundle/YouCompleteMe安装所有编程语言支持./install.py  --all

5. vim .vimrc

" Set vundle settings here" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vimset nocompatible              " be iMproved, requiredfiletype off                  " required" set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" alternatively, pass a path where Vundle should install plugins"call vundle#begin('~/some/path/here')" let Vundle manage Vundle, required"Plugin 'VundleVim/Vundle.vim'        "https://github.com/VundleVim/Vundle.vimBundle 'Valloric/YouCompleteMe'Plugin 'gmarik/Vundle.vim'" Custom pluginsPlugin 'scrooloose/nerdtree'         "https://github.com/scrooloose/nerdtreePlugin 'MattesGroeger/vim-bookmarks' "https://github.com/MattesGroeger/vim-bookmarksPlugin 'maciakl/vim-neatstatus'      "https://github.com/maciakl/vim-neatstatus" All of your Plugins must be added before the following linecall vundle#end()            " requiredfiletype plugin indent on    " required" To ignore plugin indent changes, instead use:"filetype plugin on"" Brief help" :PluginList       - lists configured plugins" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate" :PluginSearch foo - searches for foo; append `!` to refresh local cache" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal"" see :h vundle for more details or wiki for FAQ" Put your non-Plugin stuff after this line" Vim5 and later versions support syntax highlighting. Uncommenting the" following enables syntax highlighting by default.if has("syntax")    syntax on   " 语法高亮endif" Uncomment the following to have Vim jump to the last position when" reopening a fileif has("autocmd")    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif"have Vim load indentation rules and plugins according to the detected"filetype on"filetype plugin indent onendifset numberset autoindentset softtabstop=4    " 设置软制表符的宽度set shiftwidth=4     " (自动) 缩进使用的4个空格set tabstop=4        " 设置制表符(tab键)的宽度set expandtab        " 行首tab转换为4个空格set cindent          " 使用 C/C++ 语言的自动缩进方式set cinoptions={
0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s "设置C/C++语言的具体缩进方式set showmatch " 设置匹配模式,显示匹配的括号set linebreak " 整词换行set whichwrap=b,s,<,>,[,] " 光标从行首和行末时可以跳到另一行去set ruler " 标尺,用于显示光标位置的行号和列号,逗号分隔。每个窗口都有自己的标尺。如果窗口有状态行,标尺在那里显示。否则,它显示在屏幕的最后一行上set showcmd " 命令行显示输入的命令set showmode " 命令行显示vim当前模式set incsearch " 输入字符串就显示匹配点set enc=utf-8 " 文件编码set cursorlinehighlight CursorLine cterm=NONE ctermbg=blue ctermfg=white guibg=NONE guifg=NONE" highlight CursorColumn cterm=NONE ctermbg=green ctermfg=NONE guibg=NONE guifg=NONE" NERDTree settingsautocmd StdinReadPre * let s:std_in=1autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif" vim-bookmarks settingslet g:bookmark_auto_close = 1let g:bookmark_save_per_working_dir = 1let g:bookmark_highlight_lines = 1let g:bookmark_center = 1let g:bookmark_location_list = 1" key mapping:inoremap { {}
i:map
:NERDTreeToggle

 

你可能感兴趣的文章
从零开始配置 Nginx + HTTPS
查看>>
算法题解:从数组中搜索和为x的三元组
查看>>
webpack 填坑之路--提取独立文件(模块)
查看>>
vuejs使用递归组件实现树形目录
查看>>
数人云|当容器与CI/CD相遇,7个建议送给你
查看>>
Android网络编程1Http协议原理
查看>>
快速制作演示动画的工具TurboDemo常见问题合集(一)
查看>>
javascript新手实例3-仿手机聊天界面(if else运用)
查看>>
Android网络编程7之源码解析OkHttp前篇[请求网络]
查看>>
Web视频合成器Seriously.js入门教程
查看>>
python 和 ruby的对比
查看>>
翻译连载 | JavaScript 轻量级函数式编程-第3章:管理函数的输入 |《你不知道的JS》姊妹篇 ...
查看>>
JS中原型的理解
查看>>
LAMP--wordpress实现
查看>>
vue组件开发练习--焦点图切换
查看>>
浅谈OSI七层模型
查看>>
Webpack 2 中一些常见的优化措施
查看>>
移动端响应式
查看>>
python实现牛顿法求解求解最小值(包括拟牛顿法)【最优化课程笔记】
查看>>
老鸟学Javascript - 第二弹
查看>>