Gvim-Li-Shen

Source: Internet
Author: User
Tags imap

Set Cursorline
Set history=1700
Set nocompatible "Remove nasty about VI consistency mode, avoid some bugs and limitations of previous versions
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 "Hide Menu bar
Set Guioptions-=t "Hide the toolbar
Set Guioptions-=l "Hide left scroll bar
Set Guioptions-=r "Hide right scroll bar
Set Guioptions-=b "Hide Bottom scroll bar
Set Autochdir
Syntax enable
Autocmd insertleave * se nocul "highlight when moving forward with light
Autocmd insertenter * se cul "highlight when moving forward with light
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> &LT;ESC&GT;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 &LT;ESC&GT;GCC
Map XX &LT;ESC&GT;GCU
Map nn GC
Map ZD &LT;ESC&GT;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 = ' [Email protected] '
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
"Go back to the last edit location
Autocmd Bufreadpost *
\ If line ("' \" ") > 0 && line (" ' \ "") <= Line ("$") |
\ exe "normal! G ' \ "" |
\ endif
The 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 "setting python comment characters
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-Li-Shen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.