立神gvim
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的更多相关文章
- [转载] ubuntu下定制Vim/Gvim及使用技巧
vim是linux下的编辑器之神,是玩linux的必备工具,同样emacs是神的编辑器,两个编辑器是各有千秋,看个人的喜好,青菜萝卜各有所爱.我是比较喜欢vim,用vim编写bash,perl,pyt ...
- gVim 配置方案 采用Vundle管理插件
在Linux下配置vim非常简单,尤其是采用Vundle来管理插件,使得一切用起来得心应手. Maple大神在github上公布了自己的vim配置方案,相当方便好用.详见 https://github ...
- 大神的vim配置
大神的vim配置,O(∩_∩)O spf13-vim : Steve Francia's Vim Distribution __ _ _____ _ ___ _ __ / _/ |___ / __ _ ...
- 关于GVIM的配置。
最近开始考虑从常用的 Dev-Cpp 和 Visual Studio 开发环境中转到gvim+gcc+gdb. 我一直觉得IDE很好方便,不是很明白别人这样的配置.但还是开始有意识的去尝试更换环境. ...
- scrapy爬取校花网男神图片保存到本地
爬虫四部曲,本人按自己的步骤来写,可能有很多漏洞,望各位大神指点指点 1.创建项目 scrapy startproject xiaohuawang scrapy.cfg: 项目的配置文件xiaohua ...
- Vim-编辑器之神
几点声明: 作者只是一位小小的 \(OIer\) ,并不会什么过于神仙的东西,我这篇文章只是帮助人入门的而已. 若有人在 OI-Wiki上见过了原文章,原作者是我 \(......\) ,真不是抄 \ ...
- “吃神么,买神么”的第二个Sprint计划(计划过程内容)
“吃神么,买神么”项目Sprint计划 ——6.1(第二天)立会内容与进度 团队组员各自任务: 陈键.吴舒婷:继续完善前台设局与布局 林欢雯.冯美欣:开展后台的界面的设计与布局 任务的进度: 陈键. ...
- “吃神么,买神么”的第一个Sprint计划(第七天)
“吃神么,买神么”项目Sprint计划 ——5.25 星期一(第五天)立会内容与进度 摘要: 所有的部件都完成,在贴每个人负责的部件时发现很多问题,很多网页布局的运用不熟练,一部分的div会跑位置~ ...
- “吃神么,买神么”的第一个Sprint计划(第六天)
“吃神么,买神么”项目Sprint计划 ——5.26 星期二(第六天)立会内容与进度 摘要:logo最终出来了,,背景也出来了,可以开始将完成的部分放到同一个文件中,决定剩下的时间把昨晚的部分贴上去 ...
随机推荐
- ActiveMQ学习教程/2.简单示例
ActiveMQ学习教程(二)——简单示例 一.应用IDEA构建Maven项目 File->New->Module...->Maven->勾选->选择->Next ...
- docker--docker 网络管理
9 docker 网络管理 9.1 默认网络 1.查看docker网络: docker network ls Docker中默认的三种网络分别为bridge.host和none,其中名为bridge的 ...
- 一个实用的iptables脚本(各种过滤写法参考)
#!/bin/shmodprobe ipt_MASQUERADEmodprobe ip_conntrack_ftpmodprobe ip_nat_ftpiptables -Fiptables -t n ...
- mysqlreport 安装&使用
安装包:mysqlreport-3.5.tgz 下载地址:http://hackmysql.com/scripts/mysqlreport-3.5.tgz 安装办法:[root@nagios ~]# ...
- 【Linux 环境搭建】ubuntu下nfs安装与配置
(1)安装 #sudo apt-get install nfs-kernel-server portmap(2)修改配置文件 修改/etc/exports,增加以下内容, /root/wksp/roo ...
- shell学习笔记3---shell变量
Shell变量的定义.赋值和删除 脚本语言在定义变量时通常不需要指明类型,直接赋值就可以,Shell 变量也遵循这个规则. 在 Bash shell 中,每一个变量的值都是字符串,无论你给变量赋值时有 ...
- STL 之 queue
默认容器为双端队列deque 常用的函数有: empty Test whether container is empty (public member function ) size Return s ...
- input check复选框选择后修改<a>标签超链接href
1. 给复选框添加onclick事件 获取标签id <tbody> <c:forEach var="file" items="${files}" ...
- Python multiprocessing使用详解
multiprocessing包是Python中的多进程管理包. 与threading.Thread类似,它可以利用multiprocessing.Process对象来创建一个进程. 该进程可以运行在 ...
- git设置Eclipse中忽略的文件
GitHub 官网样例文件https://github.com/github/gitignorehttps://github.com/github/gitignore/blob/master/Java ...