set cursorline
set history=1700
set nocompatible  "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限  
set nu
filetype plugin on
filetype indent on
set autoread
set so=7
set wildmenu
set wildignore=*.o,*~,*.pyc
set wildignore+=.git\*,.hg\*,.svn\*
set ruler
set cmdheight=2
set hid
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set smartcase
set hlsearch
set incsearch
set lazyredraw
set magic
set showmatch
set noerrorbells
set novisualbell
set tm=500
set foldcolumn=1
set guioptions-=m " 隐藏菜单栏
set guioptions-=T " 隐藏工具栏
set guioptions-=L " 隐藏左侧滚动条
set guioptions-=r " 隐藏右侧滚动条
set guioptions-=b " 隐藏底部滚动条
set autochdir      
syntax enable
autocmd InsertLeave * se nocul  " 用浅色高亮当前行  
autocmd InsertEnter * se cul    " 用浅色高亮当前行  
color molokai
if has("gui_running")
    set guioptions-=T
    set guioptions-=e
    set t_Co=256
    set guitablabel=%M\ %t
endif
set fileencoding=utf-8
set ffs=unix,dos,mac
set formatoptions+=m  
set formatoptions+=B  
set nobackup
set nowb
set noswapfile
set mouse=a
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set lbr
set tw=500
set ai
set si
set wrap
set viminfo^=%
" set guifont=Liberation\Mono\ 12
set guifont=Courier\ New\ 12  
set laststatus=2
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
set list lcs=tab:\|\
inoremap ( ()<ESC>i
inoremap { {<CR>}<ESC>o
inoremap [ []<ESC>i
inoremap " ""<ESC>i
inoremap ' ''<ESC>i
inoremap ;; <ESC>o
inoremap <C-a> <esc>ggVGm     
inoremap <C-s> <esc>:w<CR>i
inoremap <C-v> <esc>"+Pi
inoremap <C-c> <esc>"+Yi
inoremap <C-z> <esc>ui
map <C-s> :w<CR>
map <C-a> ggVG
map <C-c> "+Y
map <C-v> "+P
map <C-z> u
map ff <ESC>:NERDTree<CR>
map ss <ESC>:!google-chrome %<CR>
map fp <ESC>:vsplit<CR>
map cfp <ESC>:split<CR>
map rr <ESC>ysiw
map cc <ESC>gcc
map xx <ESC>gcu
map nn gc
map zd <ESC>zfap
map ll :IndentLinesToggle<CR>
let mapleader = ","
let g:mapleader = ","
let g:Source="/home/wangzhili/wzl/"  
let python_highlight_all = 1
let g:author = 'wangzhili'
let g:Email  = 'wangstdio.h@gmail.com'
let g:html_indent_inctags = "html,body,head,tbody"  
let g:html_indent_script1 = "inc"  
let g:html_indent_style1 = "inc"
let g:pyflakes_use_quickfix = 0
let g:indentLine_color_gui = '#F8F8FF'
let g:indentLine_char = '┆'
au FileType python syn keyword pythonDecorator True None False self
au BufNewFile,BufRead *.jinja set syntax=htmljinja
au BufNewFile,BufRead *.mako set ft=mako
au FileType python map <buffer> F :set foldmethod=indent<cr>
au FileType python inoremap <buffer> $r return
au FileType python inoremap <buffer> $i import
au FileType python inoremap <buffer> $p print
au FileType python map <buffer> <leader>1 /class
au FileType python map <buffer> <leader>2 /def
au FileType python map <buffer> <leader>C ?class
au FileType python map <buffer> <leader>D ?def
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
au FileType javascript setl nocindent
au FileType javascript imap <c-t> AJS.log();<esc>hi
au FileType javascript imap <c-a> alert();<esc>hi
au FileType javascript inoremap <buffer> $r return
"回到上次编辑的位置
autocmd BufReadPost *      
            \ if line("'\"") > 0 && line("'\"") <= line("$") |
            \   exe "normal! g`\"" |
            \ endif
"end

function! JavaScriptFold()
    setl foldmethod=syntax
    setl foldlevelstart=1
    syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
    function! FoldText()
        return substitute(getline(v:foldstart), '{.*', '{...}', '')
    endfunction
    setl foldtext=FoldText()
endfunction

map e :call Do_OneFileMake()<CR>
function Do_OneFileMake()
    exec "w"
    if &filetype=="java"
        exec "!javac %"
        exec "!gnome-terminal -t JAVA -x bash -c \"java %<;rm %<.class;read;\""
    endif
    if &filetype=="python"
        exec "!gnome-terminal -t Python -x bash -c \"python %;read;\""
    endif
    if &filetype=="sh"
        exec "!gnome-terminal -t SH -x bash -c \"sh %; read;\""
    endif
    if &filetype=="c"
        exec "!gnome-terminal -t C -x bash -c \"g++ % -o %<;./%<;rm %<;read;\""
    endif
    if &filetype=="cpp"
        exec "!gnome-terminal -t CPP -x bash -c \"g++ % -o %<;./%<;rm %<;read;\""
    endif
    if &filetype=="markdown"
        exec "!gnome-terminal -t -MD -x bash -c\"submit.sh;read;\""
    endif
    normal o
    exec "c"
endfunction
    
function InsertPythonComment()
    exe 'normal'.1.'G'
    let line = getline('.')
    if line =~ '^#!.*$' || line =~ '^#.*coding:.*$'
        return
    endif
    normal O
    call setline('.', '#!/usr/bin/env python')
    normal o
    call setline('.', '# -*- coding:utf-8 -*-')
    normal o
    call cursor(4, 17)
endfunc

function InsertCommentWhenOpen()
    if a:lastline == 1 && !getline('.')
        call InsertPythonComment()
    end
endfunc

function CppHeadFlie()
    call setline('.','#include<map>')
    normal o
    call setline('.','#include<cmath>')
    normal o
    call setline('.','#include<queue>')
    normal o
    call setline('.','#include<cstdio>')
    normal o
    call setline('.','#include<vector>')
    normal o
    call setline('.','#include<string>')
    normal o
    call setline('.','#include<cstring>')
    normal o
    call setline('.','#include<sstream>')
    normal o
    call setline('.','#include<iostream>')
    normal o
    call setline('.','#include<algorithm>')
    normal o
    call setline('.','using namespace std;')
    normal o
endfunc

function CallCppFunction()
     if a:lastline == 1 && !getline('.')
        call CppHeadFlie()
    end
endfunc

function JavaFile()
    call setline('.','public class '.expand("%<").expand('{'))
    normal o
    call setline('.','    public static void main(String[] args){')
    normal o
    normal o
    call setline('.','    }')
    normal o
    call setline('.','}')
    call cursor(3,9)
endfunc

function CallJavaFunction()
    if a:lastline == 1 && !getline('.')
        call JavaFile()
    end
endfunc

au FileType cpp :%call CallCppFunction()
au FileType java :%call CallJavaFunction()
au FileType python :%call InsertCommentWhenOpen()
autocmd FileType python,shell set commentstring=#\ %s                 " 设置Python注释字符
autocmd FileType mako set cms=##\ %s
set nocompatible
filetype off
filetype plugin indent on
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle "airblade/vim-gitgutter"
Bundle "gregsexton/gitv"
Bundle "tpope/vim-commentary"
Bundle "tpope/vim-surround"
Bundle "Raimondi/delimitMate"
Bundle "mattn/emmet-vim"
Bundle 'scrooloose/nerdtree'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
Bundle "honza/vim-snippets"
Bundle 'pkufranky/VimRepress'
Bundle 'hallison/vim-markdown'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
Bundle "honza/vim-snippets"
Bundle 'gmarik/vundle'
Bundle 'kien/ctrlp.vim'
Bundle 'sukima/xmledit'
Bundle 'sjl/gundo.vim'
Bundle 'jiangmiao/auto-pairs'
Bundle 'klen/python-mode'
Bundle 'SirVer/ultisnips'
Bundle 'scrooloose/syntastic'
Bundle 't9md/vim-quickhl'
Bundle 'Lokaltog/vim-powerline'
Bundle 'scrooloose/nerdcommenter'
Bundle 'hdima/python-syntax'
Bundle 'Yggdroot/indentLine'
Bundle 'Shougo/neocomplete'
Bundle 'kevinw/pyflakes-vim'  
Bundle 'pangloss/vim-javascript'
Bundle 'mathematic.vim'
inoremap <buffer> <C-X><C-U> <C-X><C-U><C-P>
inoremap <buffer> <C-S-Space> <C-X><C-U><C-P>
autocmd Filetype java setlocal omnifunc=javacomplete#Complete
autocmd Filetype java setlocal completefunc=javacomplete#CompleteParamsInfo
autocmd Filetype java,javascript,jsp inoremap <buffer>  .  .<C-X><C-O><C-P>
autocmd FileType python setlocal completeopt-=preview
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 3
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags

立神gvim的更多相关文章

  1. [转载] ubuntu下定制Vim/Gvim及使用技巧

    vim是linux下的编辑器之神,是玩linux的必备工具,同样emacs是神的编辑器,两个编辑器是各有千秋,看个人的喜好,青菜萝卜各有所爱.我是比较喜欢vim,用vim编写bash,perl,pyt ...

  2. gVim 配置方案 采用Vundle管理插件

    在Linux下配置vim非常简单,尤其是采用Vundle来管理插件,使得一切用起来得心应手. Maple大神在github上公布了自己的vim配置方案,相当方便好用.详见 https://github ...

  3. 大神的vim配置

    大神的vim配置,O(∩_∩)O spf13-vim : Steve Francia's Vim Distribution __ _ _____ _ ___ _ __ / _/ |___ / __ _ ...

  4. 关于GVIM的配置。

    最近开始考虑从常用的 Dev-Cpp 和 Visual Studio 开发环境中转到gvim+gcc+gdb. 我一直觉得IDE很好方便,不是很明白别人这样的配置.但还是开始有意识的去尝试更换环境. ...

  5. scrapy爬取校花网男神图片保存到本地

    爬虫四部曲,本人按自己的步骤来写,可能有很多漏洞,望各位大神指点指点 1.创建项目 scrapy startproject xiaohuawang scrapy.cfg: 项目的配置文件xiaohua ...

  6. Vim-编辑器之神

    几点声明: 作者只是一位小小的 \(OIer\) ,并不会什么过于神仙的东西,我这篇文章只是帮助人入门的而已. 若有人在 OI-Wiki上见过了原文章,原作者是我 \(......\) ,真不是抄 \ ...

  7. “吃神么,买神么”的第二个Sprint计划(计划过程内容)

     “吃神么,买神么”项目Sprint计划 ——6.1(第二天)立会内容与进度 团队组员各自任务: 陈键.吴舒婷:继续完善前台设局与布局 林欢雯.冯美欣:开展后台的界面的设计与布局 任务的进度: 陈键. ...

  8. “吃神么,买神么”的第一个Sprint计划(第七天)

    “吃神么,买神么”项目Sprint计划 ——5.25  星期一(第五天)立会内容与进度 摘要: 所有的部件都完成,在贴每个人负责的部件时发现很多问题,很多网页布局的运用不熟练,一部分的div会跑位置~ ...

  9. “吃神么,买神么”的第一个Sprint计划(第六天)

    “吃神么,买神么”项目Sprint计划 ——5.26  星期二(第六天)立会内容与进度 摘要:logo最终出来了,,背景也出来了,可以开始将完成的部分放到同一个文件中,决定剩下的时间把昨晚的部分贴上去 ...

随机推荐

  1. linux系统高级命令进阶

    输出重定向 >:覆盖文件内容 echo "123" > test:把原来的内容覆盖 echo "123" >> test:把原来的存在( ...

  2. 关于linux中的目录配置标准以及文件基本信息

    关于Linux中的目录配置标准 在查看docker.k8的运行日志,修改相关的运行记录的时候,学长总是能很快地找到目录,这个多多少少和Linux的FHS(File Hierarchy Standard ...

  3. echars 柱状图正常状态 --》二次封装

    <template> <!-- 柱状图 正常 1. 调用页面引入 import EcharsColumnNormal from '@/components/echarsColumnN ...

  4. Java类加载器总结网址

    http://blog.csdn.net/gjanyanlig/article/details/6818655

  5. 20191127 Spring Boot官方文档学习(5)

    5.Spring Boot Actuator:可投入生产的功能 Spring Boot包含许多其他功能,可帮助您在将应用程序投入生产时监控和管理您的应用程序.您可以选择使用HTTP端点或JMX管理和监 ...

  6. Centos7安装protobuf3.6.1

    简介 最近学习go语言,需要安装protobuf,但是网上的教程很多都不太适用于centos7 的系统.现在总结下protobuf在centos7下的安装教程. protobuf是Google开发出来 ...

  7. Mysql函数----控制流函数介绍

    MySQL有4个函数用来进行条件操作的,可以实现SQL的条件逻辑,允许开发者将一些应用程序业务逻辑转换到数据库后台.   MySQL控制流函数: 1.CASE WHEN[test1] THEN [re ...

  8. java中使用SimpleDateFormat实现字符串和日期的相互转换

    java中使用SimpleDateFormat实现字符串和日期的相互转换 import java.text.ParseException; import java.text.SimpleDateFor ...

  9. python基础知识的入门介绍

    一.什么是编程语言 任何词语都是一种高度的概括和总结,所以找关键字.如下: (1)1.什么是"语言":一个人与另一个人沟通的介质 2人将自己的思维逻辑和想法通过计算机能过识别的语言 ...

  10. media(上传的文件或图片路径配置)

    urls url(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), settings MED ...