代码拉取完成,页面将自动刷新
set nocompatible " 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 'gmarik/Vundle.vim'
"
" " Add all your plugins here (note older versions of Vundle used Bundle
" instead of Plugin)
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
set shortmess=atI " 启动的时候不显示那个援助乌干达儿童的提示
winpos 5 5
set go=
set scrolloff=3 " 光标移动到buffer的顶部和底部时保持3行距离
autocmd InsertLeave * se nocul " 用浅色高亮当前行
set cursorline " 突出显示当前行
set magic " 设置魔术
set syntax=on
set autoindent
set tabstop=4
set softtabstop=4
set history=1000
set langmenu=zh_CN.UTF-8
colorscheme monokai
autocmd BufNewFile *.py,*.cc,*.sh,*.java exec ":call SetTitle()"
"新建.py,.cc,.java,.sh,
""定义函数SetTitle,自动插入文件头
func SetTitle()
"如果文件类型为.sh文件
if &filetype == 'python'
call setline(1,"\#!/usr/bin/python3")
call setline(2, "\#coding=utf8")
call setline(3, "\"\"\"")
call setline(4, "\# Author: cb")
call setline(5, "\# Created Time : ".strftime("%c"))
call setline(6, "")
call setline(7, "\# File Name: ".expand("%"))
call setline(8, "\# Description: Life is too short,Python as a song!")
call setline(9, "")
call setline(10, "\"\"\"")
call setline(11,"")
endif
if &filetype == 'java'
call setline(1, "//coding=utf8")
call setline(2, "/*************************************************************************")
call setline(3, "\ @Author: cb")
call setline(4, "\ @Created Time : ".strftime("%c"))
call setline(5, "")
call setline(6, "\ @File Name: ".expand("%"))
call setline(7, "\ @Description:")
call setline(8, "")
call setline(9, " ************************************************************************/")
call setline(10,"")
endif
if &filetype == 'sh'
call setline(1, "#!/bin/bash")
call setline(2, "/*************************************************************************")
call setline(3, "\ @Author: cb")
call setline(4, "\ @Created Time : ".strftime("%c"))
call setline(5, "")
call setline(6, "\ @File Name: ".expand("%"))
call setline(7, "\ @Description: Life is too short!")
call setline(8, "")
call setline(9, " ************************************************************************/")
call setline(10,"")
endif
endfunc
" modify the last modified time of a file
function SetLastModifiedTime(lineno)
let modif_time = strftime("%c")
if a:lineno == "-1"
let line = getline(6)
else
let line = getline(a:lineno)
endif
if line =~ '^////\sLast Modified'
let line = substitute( line,':\s\+.*\d\{4\}', ':'.modif_time, "" )
else
let line = ' Last Modified: '.modif_time
endif
if a:lineno == "-1"
call setline(5, line)
else
call append(a:lineno, line)
endif
endfunction
" map the SetLastModifiedTime command automatically
au BufWrite *.py,*.java call SetLastModifiedTime(-1)
set number
au BufNewFile,BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
Plugin 'vim-scripts/indentpython.vim'
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
Plugin 'scrooloose/syntastic'
let python_highlight_all=1
Plugin 'nvie/vim-flake8'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。