MAC下的IDE实在是不好用,最终放弃了IDE准备直接用vim来看代码了,那么就需要设置一下vim。

将家目录下面.vim中的vimrc用下面的内容替换:

" Set vundle settings here
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
set nocompatible " be iMproved, required
filetype off " required " set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call 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.vim " Custom plugins
Plugin 'scrooloose/nerdtree' "https://github.com/scrooloose/nerdtree
Plugin 'MattesGroeger/vim-bookmarks' "https://github.com/MattesGroeger/vim-bookmarks
Plugin 'maciakl/vim-neatstatus' "https://github.com/maciakl/vim-neatstatus " All of your Plugins must be added before the following line
call vundle#end() " required
filetype 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 file
if has("autocmd")
au BufReadPost * if line("'\"") > && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"have Vim load indentation rules and plugins according to the detected
"filetype on
"filetype plugin indent on
endif set number
set autoindent
set softtabstop= " 设置软制表符的宽度
set shiftwidth= " (自动) 缩进使用的4个空格
set tabstop= " 设置制表符(tab键)的宽度
set expandtab " 行首tab转换为4个空格
set cindent " 使用 C/C++ 语言的自动缩进方式
set cinoptions={,1s,t0,n-,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- " 文件编码
set cursorline
highlight CursorLine cterm=NONE ctermbg=blue ctermfg=white guibg=NONE guifg=NONE
" highlight CursorColumn cterm=NONE ctermbg=green ctermfg=NONE guibg=NONE guifg=NONE " NERDTree settings
autocmd StdinReadPre * let s:std_in=
autocmd VimEnter * if argc() == && !exists("s:std_in") | NERDTree | endif " vim-bookmarks settings
let g:bookmark_auto_close =
let g:bookmark_save_per_working_dir =
let g:bookmark_highlight_lines =
let g:bookmark_center =
let g:bookmark_location_list = " key mapping
:inoremap { {}<ESC>i
:map <f2> :NERDTreeToggle<CR>

然后手动下载如下文件:

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

之后在打开的vim中输入:PluginInstall来安装相应的插件,等待完成后就可以使用了。

配置好的环境如下图所示:

搭建MAC下vim环境的更多相关文章

  1. Mac下PHP环境的搭建

    Mac下PHP环境的搭建 目录 Mac下PHP环境的搭建(基于XAMPP) phpmyadmin Mac下PHP环境的搭建(基于XAMPP) 下载XAMPP的Mac版 启动Apache Web Ser ...

  2. RF+Appium框架自动化测试系列一之(Mac下Appium环境搭建)万事开头难

    消失了3个月,有一段时间没来园子更新博客了,各位看官见谅哈哈,消失是因为刚换了工作环境没外网,好多笔记没能及时的记录分享,以后有时间慢慢补上吧,这段时间主要接触了移动端app的自动化测试,公司为了快速 ...

  3. Mac 下VIM配置

    Mac下VIM配置 首先,我们去这里下载MacVim,也可用这个网址:(http://code.google.com/p/macvim/),进入后的界面如下: ____________________ ...

  4. Mac下修改环境变量

    Mac下修改环境变量 如果使用默认Bash, 首先修改 ~/.bash_profile 文件,添加文件路径,比如: export PATH=~/bin:/usr/local/bin/node:~/Do ...

  5. Mac下Vim编辑快捷键小结(移动光标)

    Mac下Vim编辑快捷键小结(移动光标) 1.移动到行尾"$",移动到行首"0"(数字),移动到行首第一个字符处"^" 2.移动到段首&qu ...

  6. mac下python环境pip报错[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) 的解决方法

    1.mac下python环境pip报错: issuserdeMacBook-Pro:~ issuser$ pip install pyinstallerCollecting pyinstaller  ...

  7. 在mac下设置环境变量

    在mac下设置环境变量   在基于unix/linux的操作系统下进行程序开发,使用环境变量将会方便.通过设置环境变量将可以在任意目录通过输入程序名来执行设定目录下的程序.不需要通过cd将工作目录改变 ...

  8. Mac下Boost环境搭建

    Boost,一个功能强大.跨平台.开源而且免费的C++程序库,可以在其官网了解更多:http://www.boost.org,C++标准经过不断的升级完善,现在已经功能越来越吸引人了,Boost开发过 ...

  9. mac下wordpress环境搭建

    mac下本来就有apache和php,只需要配置以下+安装mysql 1.Apache 预装目录在  /etc/apache2: 默认的网站目录在 /Library/WebServer/Documen ...

随机推荐

  1. 选择合适的Linux版本

    以下纯属个人想法:欢迎指正 1.Linux桌面系统,首选Ubuntu.当然Ubuntu也有服务器版本,不建议使用 2.服务端的Linux稳定的服务器系统,在企业中从事运维工作Redhat或者CentO ...

  2. Wireshark基本介绍和TCP三次握手

    转自:http://www.cnblogs.com/TankXiao/archive/2012/10/10/2711777.html 之前写过一篇博客:用 Fiddler 来调试HTTP,HTTPS. ...

  3. Linux系统重装与还原

    当初第一次装ubuntu系统时,对文件系统的构成还不太了解,所以在分区的时候给home的分区特别小,导致后期软件都装不进去.说磁盘已满.所以想对系统又一次分区. 上网找了资料,都说用GParted这个 ...

  4. tensorflow serving 打印调试log

    启动时添加环境变量 export TF_CPP_MIN_VLOG_LEVEL=1 ,这样可以打印VLOG(1)的log

  5. R语言中数据结构

    R语言还是有点古老感觉,数据结构没有Python中那么好用.以下简单总结一下R语言中经常使用的几个数据结构. 向量: R中的向量能够理解为一维的数组,每一个元素的mode必须同样,能够用c(x:y)进 ...

  6. maven 找不到或无法加载主类

      maven 找不到或无法加载主类 CreateTime--2018年4月19日22:58:14 Author:Marydon 1.情景还原: 在maven管理的web项目中,单独运行Java类报错 ...

  7. 【Java虚拟机】运行时数据区

    Java在执行Java程序的过程中会把它所管理的内存划分为若干个不同的数据区域.这些区域都有各自的用途.创建和销毁的时间,有一些是随虚拟机的启动而创建,随虚拟机的退出而销毁,有些则是与线程一一对应,随 ...

  8. logging日志管理-将日志写入文件

    # -*- coding: cp936 -*- # test.py #http://blog.chinaunix.net/uid-27571599-id-3492860.html #logging日志 ...

  9. (转)J2EE十三个技术规范

    从事Java开发的童鞋都知道,java是一种非常棒的语言,能够实现跨平台运行.它屏蔽了具体的平台环境的要求,也就是说,无论是windows,还是Unix.Linux系统,只要支持Java虚拟机,就可以 ...

  10. java 实现文本格式转换

    代码如下,不太规范,仅作学习用 import java.io.*; public class CharSetTest { public static void main(String[] args) ...