ubuntu中Vim美化
参考了一篇博文,方便自己查阅,转载如下,刚开始是为了那个好看的主题来的,就顺便把好用的插件都安装了哈哈哈哈哈哈
(12条消息) Vim 安装、基本配置、使用、插件(bundle、nerdTree、tagbar、ctrlp、vim-airline、molokai、vim-fugitive、ctags)_ora___的博客-CSDN博客_nerdtree airline
但是我采用的命令不是:PluginInstall而是:BundleInstall
对了,文中应该在配置nerdTree的地方加上一句:
autocmd BufEnter * if 0 == len(filter(range(1, winnr('$')), 'empty(getbufvar(winbufnr(v:val), "&bt"))')) | qa! | endif
因为,如果文件最终退出了,目录自动退出比较合理。
完整版本.vimrc内容:
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
runtime! debian.vim
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.
" let g:skip_defaults_vim = 1
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"filetype plugin indent on
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set nu
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
syntax on "设置语法高亮
set nu "设置行号显示,或者是set number
set tabstop=4 "设置一个缩进占 4 个空格数
set autoindent "设置自动缩进
set mouse=a "设置鼠标一直可用,set mouse= (空)取消
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()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'majutsushi/tagbar'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/ctrlp.vim'
Plugin 'tomasr/molokai'
" All of your Plugins must be added before the following line
call vundle#end() " required
"插件结束,安装插件在中间
filetype plugin indent on " required
"自己修改的配置开始
" nerdtree
autocmd vimenter * NERDTree " 打开vim,自动开启nerd tree
map <F3> :NERDTreeMirror<CR> " 通过F3 打开/关闭 nerd tree
map <F3> :NERDTreeToggle<CR>
autocmd BufEnter * if 0 == len(filter(range(1, winnr('$')), 'empty(getbufvar(winbufnr(v:val), "&bt"))')) | qa! | endif
" tagbar
nmap <F4> :TagbarToggle<CR> " 通过 F4 打开/关闭Tagbar
let g:airline_theme="bubblegum"
" ctrlp.vim
let g:airline_cmd = 'CtrlP' " ctrl + p 按键启动
" molokai
colorscheme molokai " 开启 molokai 配色主题
"修改配置结束
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
最终完美实现,结果如下:
ubuntu中Vim美化相关推荐
- Ubuntu中Vim使用技巧
Vim是一个高级文本编辑器,它提供了Unix下编辑器 'Vi' 的功能并对其进行了完善.Vim经常被认为是 "程序员的编辑器",它在程序编写时非常有用,很多人认为它是一个完整的集成 ...
- ubuntu中vim编辑模式退格键无法删除,方向键乱入ABCD解决方法
最近把双系统删除后,使用虚拟机安装的Ubuntu18.04进行本地程序的编译(菜狗学习Linux下的编译调试过程) 就在照常使用vi test.cpp的时候,意外出现了 在输入错误后,使用Backsp ...
- ubuntu中vim实现代码补全等功能
参考了许多教程,花费了大半天的时间,才大致将此功能实现好,不做点记录啥的,感觉有点过意不去.... 整体来说是按照此教程来执行,但中间也遇到了其他的错误,在此记录下. https://www.jian ...
- Ubuntu中Vim 中文乱码解决方法
添加中文字符编码 sudo vim /var/lib/locales/supported.d/local 添加下面的中文字符集支持 zh_CN.GBK GBK zh_CN.GB2312 GB2312 ...
- ubuntu中vim简易配置
打开配置文件 sudo vim /etc/vim/vimrc 简易够用配置 set nocompatible set nu filetype on set history=1000 set backg ...
- Ubuntu中vi / vim编辑器快捷操作
Ubuntu安装vim vi是vim的简化版,建议安装vim 安装vim,打开新的终端,输入: sudo apt-get install vim-gtk (好像sudo apt-get install ...
- 在linux中添加字典,为 Ubuntu 的 Vim 添加英文字典
在Ubuntu下Vim中阅读文档时,经常会发现不认识的单词,以前都是直接ctrl+c然后到google里面来进行翻译,感觉甚是麻烦.于是就想找一种方法可以类似于金山词霸的软件,但是在Linux的vim ...
- ubuntu中无法安装vim
ubuntu中无法安装vim 一般情况下,ubuntu中默认只安装了vi编辑工具,没有安装vim编辑工具.由于vim对vi进行了优化,能够主动识别Linux C语言中关键字,并用不同的颜色标记,具有很 ...
- 打开 Ubuntu 18 中 Vim 的系统剪切板功能
打开 Ubuntu 18 中 Vim 的系统剪切板功能 文章目录 打开 Ubuntu 18 中 Vim 的系统剪切板功能 1. 查看 Vim 是否支持系统剪切板 2. 开启系统剪切板功能 3. 系统剪 ...
最新文章
- golang image.image 转文件流_Kuiper 1.0.2 正式发布 超轻量 IoT 边缘流处理
- Linux下基于官方源代码RPM包构建自定义MySQL RPM包
- 数据库问题解决后,应用面对的挑战
- TextRank算法原理和提取关键词的主要过程详解 计算句子相似度 计算句子重要性公式
- 在Global中Application_Error事件处理错误信息
- windows 电脑属性调用程序
- 统计学基础Statistics for the Behavioral Sciences 之 Sample Variance as an Unbiased Statistic
- VS2015配置OpenCV-contribu4.1.1及缺少xfeatures2d等无法打开包括文件: “features2d/test/test_detectors_regression.im问题
- php小型购物网站,PHP实现一个多功能购物网站
- 是否有唯一的 Android 设备 ID?
- Python数据分析实例,利用Pandas建立流域三层蒸发和蓄满产流模型
- 一个Android开发者开博一周年的成长日记——送给不知如何下手的【初级开发者】和【在校生】
- sql/hana批量存入表(每日一总)
- vue实现 文件重命名
- 什么是数据库备份DBS
- 树的平衡 AVL Tree
- Matlab Figure 窗口最大化方法
- android手机屏幕分辨率
- wps分析工具库如何加载_【数据分析】关键词数据分析如何做?用这个工具比指数好...
- 服务器cpu性能最大值,服务器cpu性能排行
热门文章
- 3dmath 直线与圆锥的交点(无底面的圆锥)
- Linux开发者的CI/CD(10)获取Jenkins project构建结果
- 怎么样脱颖而出,成为一个更优秀的人?
- 爬取网易云音乐两万条评论储存在MySQL服务器上
- Python 如何突破反爬虫指纹 JA3
- 2020年最值得关注的5个logo设计趋势:简单的几何形状logo
- j-vector(Multi-Task Learning for Text-dependent Speaker Verification)
- 树莓派mqtt协议连接阿里云物联网平台,手机端获取数据并控制
- 面条html5,10道超简单又好吃的面条做法!营养,美味,早起5分钟就能把早餐做好...
- L1-054. 福到了