码迷,mamicode.com
首页 > 系统相关 > 详细

个人vim配置

时间:2018-04-26 23:39:09      阅读:416      评论:0      收藏:0      [点我收藏+]

标签:SM   created   检测   string   ring   AC   span   local   ***   

"/*************************************************************************
"    > File Name: .vimrc
"    > Author: LyuCheng
"    > Created Time: 2018-01-14 14:39
"    > Description: 
" ************************************************************************/

syntax on
" 检测文件类型
filetype on
" 针对不同的文件类型采用不同的缩进格式
filetype indent on
" 允许插件
filetype plugin on
" 启动自动补全
filetype plugin indent on

" 主题
set background=light
let g:solarized_termcolors=256
colorscheme solarized

" powerline状态栏

set rtp+=/home/lyucheng/.local/lib/python2.7/site-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256

set nu
set history=1024

set tabstop=4
set shiftwidth=4
set smarttab

set cindent
set nobackup

set noswapfile

set mouse=a

" Plugin {

set rtp+=/home/lyucheng/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin VundleVim/Vundle.vim
Plugin scrooloose/nerdtree

call vundle#end()
filetype plugin indent on

" }

"NERDTree

map <F4> :NERDTreeMirror<CR>
map <F4> :NERDTreeToggle<CR>

map <F6> :call CR()<CR>

func! CR()

exec "w"
exec "!g++ -std=c++11 % -o %<"
exec "!./%<"
endfunc

" 文件头
map <F5> :call AddTitle()<CR>
function AddTitle()
    call setline(1, "/*************************************************************************")
    call append(line("."), "    > File Name: ".expand("%"))
    call append(line(".")+1, "    > Author: LyuCheng")
    call append(line(".")+2, "    > Created Time: ".strftime("%Y-%m-%d %H:%M"))
    call append(line(".")+3, "    > Description: ")
    call append(line(".")+4, " ************************************************************************/")
    call append(line(".")+5, "")
    call append(line(".")+6, "#include <iostream>")
    call append(line(".")+7, "#include <string>")
    call append(line(".")+8, "#include <fstream>")
    call append(line(".")+9, "#include <vector>")
    call append(line(".")+10, "#include <set>")
    call append(line(".")+11, "#include <map>")
    call append(line(".")+12, "#include <algorithm>")
    call append(line(".")+13, "#include <memory>")
    call append(line(".")+14, "")
    call append(line(".")+15, "using namespace std;")
    call append(line(".")+16, "")
    call append(line(".")+17,"int main(int argc, char**argv) {")
    call append(line(".")+18, "")
    call append(line(".")+19, "    return 0;")
    call append(line(".")+20, "}")
    echohl WarningMsg | echo "Successful in adding the copyright." | echohl None
endf
""""""""""""""""""""""""""""""

 

个人vim配置

标签:SM   created   检测   string   ring   AC   span   local   ***   

原文地址:https://www.cnblogs.com/wuwangchuxin0924/p/8955198.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!