Ai
1 Star 0 Fork 0

南寻/vim

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vimrc 4.56 KB
一键复制 编辑 原始数据 按行查看 历史
南寻 提交于 2017-04-04 22:20 +08:00 . 第一次提交
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/'}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/nanxun/vim.git
git@gitee.com:nanxun/vim.git
nanxun
vim
vim
master

搜索帮助