我的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. 相克军_Oracle体系_随堂笔记014-锁 latch,lock

    1.Oracle锁类型 2.行级锁:DML语句 3.表级锁:TM 4.锁的兼容性 5.加锁语句以及锁的释放 6.锁相关视图 7.死锁 1.Oracle锁类型 锁的作用     latch锁:chain ...

  2. learn shell

    the basic shell skills.   Bourne shell sh ksh Bash psh zsh C shell csh tcsh   [root@bogon temp]# cat ...

  3. JAVA常见面试题之Forward和Redirect的区别

    用户向服务器发送了一次HTTP请求,该请求可能会经过多个信息资源处理以后才返回给用户,各个信息资源使用请求转发机制相互转发请求,但是用户是感觉不到请求转发的.根据转发方式的不同,可以区分为直接请求转发 ...

  4. GitHub托管BootStrap资源汇总(持续更新中…)

    Twitter BootStrap已经火过大江南北,对于无法依赖美工的程序员来说,这一成熟前卫的前端框架简直就一神器,轻轻松松地实现出专业的UI效果.GitHub上相关的的开源项目更是层出不穷,在此整 ...

  5. C# foreach 中获取索引index的方法

    方法一: int i = 0; foreach (var item in arr) { i++; } 方法二: foreach (var item in arr) { int index = arr. ...

  6. 使用nuget打包类库并发布

    前言 NuGet 是免费.开源的包管理开发工具,专注于在 .NET 应用开发过程中,简单地合并第三方的组件库.今天的目的就是记录一下如何打包一个类库,并发布到官网.在开始之前需要在www.nuget. ...

  7. 簡單工廠模式-之-什麼是產品線 And 抽象工廠模式-之-什麼是產品族

    簡單工廠模式-之-什麼是產品線 簡單工廠模式中,有一個概念就是使用了多層次的產品結構,那麼什麼是產品結構或者說什麼是產品線? 假定我們有一個基準的產品標準Product,那麼所有繼承該基類或者傳遞基類 ...

  8. IOS 动画播放案例

    #import "ViewController.h" @interface ViewController () @property (weak,nonatomic) IBOutle ...

  9. Bootstrap之表单控件状态

    Bootstrap中的表单控件状态主要有三种:焦点状态,禁用状态,验证状态.   一.焦点状态:该状态告诉用户可输入或选择东西 焦点状态通过伪类“:focus”以实现. bootstrap.css相应 ...

  10. GJM : 数据结构学习笔记

    --------------------------数据结构 --------------------数据结构分 线性数据结构给非线性数据结构 数据和结合 线性表(顺序存储方式)特点:有且仅有一个开始 ...