我的vimrc

https://github.com/juandx/vimrc

当然得装vundle

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

注意看到set rtp+=~/.vim/bundle/Vundle.vim ,把~换成自己的home目录,比如我的/home/wenbin/

尼玛,感觉下面这个直接copy会有问题。。。这是博客园的问题么。。。我传到github了,实验过是ok的 https://github.com/juandx/vimrc

set nocompatible              " be iMproved, required
filetype off " required " set the runtime path to include Vundle and initialize
set rtp+=/home/wenbin/.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'
Plugin 'chriskempson/base16-vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'tomasr/molokai'
Plugin 'junegunn/vim-easy-align' " 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 if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time " Only do this part when compiled with support for autocommands
if has("autocmd")
augroup redhat
autocmd!
" In text files, always limit the width of text to 78 characters
" autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
augroup END
endif if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add $PWD/cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif " Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif filetype plugin on if &term=="xterm"
set t_Co=8
set t_Sb=^[[4%dm
set t_Sf=^[[3%dm
endif " Don't wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0" " by wenbin
set shiftwidth=4
set expandtab
set autoindent
"Paste toggle - when pasting something in, don't indent.
set pastetoggle=<F3>
set background=dark
" let g:solarized_termtrans=1
" let g:solarized_contrast="normal"
" let g:solarized_visibility="normal"
let g:molokai_original = 1
set t_Co=256
colorscheme molokai
" colorscheme solarized
" colorscheme torte
" colorscheme base16-default
" set fileencodings=utf-8,chinese,latin-1
set termencoding=utf-8
set encoding=utf-8
" For full syntax highlighting:
let python_highlight_all=1
syntax on
" Enable folding
set foldmethod=indent
set foldlevel=99 " Enable folding with the spacebar
nnoremap <space> za
function HeaderPython()
call setline(1, "#!/usr/bin/env python")
call append(1, "# -*- coding: utf-8 -*-")
call append(2, "# Pw @ " . strftime('%Y-%m-%d %T', localtime()))
normal G
normal o
normal o
endf
autocmd bufnewfile *.py call HeaderPython()

  

Launch vim and run :PluginInstall

To install from command line: vim +PluginInstall +qall

对youcompleteme 安装一对底层需要的编译的东西 sudo yum install automake gcc gcc-c++ kernel-devel cmake python-devel

cd ~/.vim/bundle/YouCompleteMe

./install.py --clang-completer

./install.py

空格是代码折叠

F3是切换复制粘贴

:NERDTree 实现目录树,?是帮助,i是打开一个新的文件(类似:sp)

molokai这个配色我很喜欢

先用v选择多行

ga进入easyalign模式

默认向左对其,比如按照空格对其  *<space>

向右对其 <enter>*<space>

居中对其 <enter><enter>*<space>

如果遇到其他字符比如 | , = 啥的,都把空格替换为对应的即可

*可以换成数字,对应后面的第几个字符,*就是全部都指定

http://www.2cto.com/os/201408/322367.html

vimrc的更多相关文章

  1. 如何设置Vimrc

    .title { text-align: center } .todo { font-family: monospace; color: red } .done { color: green } .t ...

  2. Linux上 .vimrc文件

    在Linux上面对VIM编辑器的格式的设置通常可以提升工作效率,下面对工作机器上的.vimrc文件的内容进行一总结,以备后续的查询 set smarttab set tabstop=4 set shi ...

  3. ubuntu 配置vim(vimrc)

    打开终端:ctrl+alt+t 进入vim文件:cd /etc/vim 打开vimrc文件:sudo gedit vimrc 然后在行末if语句前加上下面的内容,"  这个符号为注释,后面内 ...

  4. vi/vim使用进阶: vimrc初步

    本节所用命令的帮助入口: :help compatible :help mapleader :help map :help autocmd 当vim在启动时,如果没有找到vimrc或gvimrc,它缺 ...

  5. 我的vim配置文件.vimrc

    我的vim配置文件.vimrc map <silent> <F10> :TlistToggle<cr>map <silent> <F8> : ...

  6. 我用的/etc/vimrc

    " 映射非数字/字母键, 如:ctrl,shift, alt, home,end,功能键F1~F12, 要把这些键用尖括号括起来!如: map <F3> :NERDTree< ...

  7. .vimrc文件配置及航意

    1.  vimrc文件常见语句释义 设定 tab 的位置          :set tabstop=4 输入 tab 时自动将其转化为空格          :set expandtab       ...

  8. Linux: .vimrc

    set nuset autoindentset cindent"set tabstop=2"set shiftwidth=2set cursorlineset hlsearch&q ...

  9. vimrc配置文件_version1.0_+pathogen, taglist, wordcomplete插件说明

    为了表示对Ruchee的感谢,首先这是Ruchee的个人网站:http://www.ruchee.com/index.html,他的以前很多的代码都放到Git里面了,里面有链接. 看了整整一天,刚开始 ...

随机推荐

  1. swift2.0 如何隐藏和设置状态栏

    1.在ViewController中操作当前ViewController的状态栏/** 隐藏状态栏 */ override func prefersStatusBarHidden() -> Bo ...

  2. 如何设置UILabel中的字体的间距

    cell.teacherDescriptionLabel.text = content; cell.teacherDescriptionLabel.textAlignment = NSTextAlig ...

  3. Macaca自动化测试之Android测试

    Macaca PC端 Web自动化测试非常类似于Selenium,而移动端自动化测试非常类似于Appium,如果你搭建过Appium环境,Macaca移动端环境的搭建将非常简单. 本文继承上一篇,关于 ...

  4. 图片每天换及纯css3手风琴特效

    <a target="_blank" id="a"><img id="img" /></a> <s ...

  5. 一步一步开发Game服务器(二)登陆2

    上一篇文章,讲解了简单的登陆情况.接下来我们继续讲解登陆模块. 在正常的游戏服务器情况下.在尚未登录前可以查看服务器大区情况,登陆后也可以查看服务器大区情况,然后选择大区服务器.进行登录操作. 这样的 ...

  6. Moon.Orm 5.0(MQL版)的高性能,将发言权交给你!

    Moon.Orm 5.0性能问题,我将它交给关心它性能的您,让你自己测试,决不让你失望的. Moon.Orm 5.0 (MQL版) 版本维护及下载 (跟踪发布) Moon.Orm 5.0系列文章 火晋 ...

  7. 用浏览器(支持WebSocket)和node-inspector 调试后端(CoffeeScript,Typescript)代码

    调试效果 配置 npm安装node-inspector: $ npm install -g node-inspector 配置gulp,gulp可以用 gulp-node-inspector 或 用g ...

  8. [Asp.net 5] Logging-日志系统的基本架构(上)

    本节主要介绍解决方案中的Microsoft.Framework.Logging.Abstractions.Microsoft.Framework.Logging俩个工程. 这俩个工程中所有类的关系如下 ...

  9. MS SQLServer的关键词BETWEEN的一些注意事项

    近段时间在程序中写到有关搜索的功能.其中有使用到MS SQLServer的关键词BETWEEN,它是搜索数值范围(包括本身)之间的数据. 在使用它时,一些情况还需要注意的.如果时间的数据. 搜索时间数 ...

  10. .NET正则表达式基础入门(一)

    字符组 正则表达式的字符组十分简单,就是列出你所想要匹配的字符.阅读本章前,建议先下载我于CSDN上传的示例代码,下载无需分数,下载链接. 1.普通字符组 普通字符组,列出所有你需要匹配的字符. 例如 ...