Skip to content

Instantly share code, notes, and snippets.

@aben
Last active October 2, 2015 07:48
Show Gist options
  • Save aben/2204172 to your computer and use it in GitHub Desktop.
Save aben/2204172 to your computer and use it in GitHub Desktop.
my vimrc
se nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
Bundle "vimwiki"
Bundle "mattn/calendar-vim"
Bundle "mattn/gist-vim.git"
Bundle "scrooloose/nerdtree.git"
Bundle "scrooloose/nerdcommenter.git"
Bundle "Lokaltog/vim-powerline.git"
Bundle "tpope/vim-fugitive"
Bundle "Aben/moria"
Bundle "nathanaelkane/vim-indent-guides"
"Bundle "samsonw/vim-task"
Bundle "altercation/vim-colors-solarized"
Bundle "Lokaltog/vim-easymotion"
Bundle "kien/ctrlp.vim"
Bundle "groenewege/vim-less"
Bundle "mattn/zencoding-vim"
Bundle "goldfeld/vim-seek"
Bundle "tpope/vim-repeat"
Bundle "tpope/vim-unimpaired"
Bundle "tpope/vim-surround"
Bundle "pangloss/vim-javascript"
Bundle "kchmck/vim-coffee-script"
Bundle "closetag.vim"
"Bundle "scrooloose/syntastic"
syntax on
filetype plugin indent on
set history=100 " keep 100 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
se wildmenu " 命令行补全
set incsearch " do incremental searching 实时显示查找结果
se hlsearch " 高亮搜索结果
"se nu " number
se rnu "relative number
se nowrap
"git 切换分支有觉察不到啊
"se autoread
se showmode "显示模式
"se mouse-=a " Disable mouse
"se mousehide " Hide mouse after chars typed
"se showmatch " Show matching brackets.
"se matchtime=5 " Bracket blinking.
"se novisualbell " No blinking
"se noerrorbells " No noise.
"se vb t_vb= " disable any beeps or flashes on error
"encodings
se encoding=utf-8
se fileencoding=utf-8
se fileencodings=ucs-bom,utf-8,chinese,taiwan,japan,koren,latin1
"se helplang=cn
"indent
se linespace=4
se shiftwidth=4
se tabstop=4
"se softtabstop=4
se expandtab " Tab 转换为 space
se smarttab " use tabs at the start of a line, spaces elsewhere
se ai " Auto indent
se si " Smart indent
se cc=141
"map <leader>v "*p<CR>:exe ":echo 'pasted from clipboard'"<CR>
"map <leader>c "*y<CR>:exe ":echo 'copied to clipboard'"<CR>
" 命令行bash快捷键
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-F> <Right>
cnoremap <C-B> <Left>
"set mapleader
"let mapleader = ","
" Fast saving
"nmap <leader>w :w<cr>
" edit vimrc
command Vimrc e ~/.vimrc
nmap <leader>nt :NERDTree<cr>
se background=dark
"macvim
if has("gui_macvim")
"colorscheme
"colo moria
colo solarized
"font
se guifont=Vera_Sans_YuanTi_Mono_for_Powerline:h14
"se guifont=Monaco:h14
"se guifont=Menlo:h14
"se transparency=0
"非插入模式禁用输入法
se noimd
"se imd
"se imi=1
se ims=1
"au InsertEnter * se noimd
"au InsertLeave * se imd
"au FocusGained * se imd
"se imactivatekey=<D-space>
"se imc
"if has('multi_byte_ime')
" highlight Cursor guifg=NONE guibg=Green
" highlight CursorIM guifg=NONE guibg=Purple
"endif
"au CursorMoved * se imi=0
"au FocusLost * se imd
"au WinEnter * se imd
"inoremap <ESC> <ESC>:se imi=0<CR>
" fullscreen
"se fuoptions=maxvert,maxhorz
"au GUIEnter * se fullscreen
"取消默认快捷键
let macvim_skip_cmd_opt_movement = 1
let macvim_hig_shift_movement = 1
"no toolbar
se guioptions-=T
"mac cmd keys "map <D-v> <C-v>
"map <D-e> <C-e>
"map <D-y> <C-y>
"map <D-f> <C-f>
"map <D-b> <C-b>
"map <D-d> <C-d>
"map <D-u> <C-u>
"map <D-o> <C-o>
"map <D-w> <C-w>
"map <D-g> <C-g>
"map <D-r> <C-r>
"map <D-t> :tabnew<CR>
map <D-1> 1gt
map <D-2> 2gt
map <D-3> 3gt
map <D-4> 4gt
map <D-5> 5gt
map <D-6> 6gt
map <D-7> 7gt
map <D-8> 8gt
" map <D-9> 9gt
" map <D-9> 10gt
map <D-0> gt
map <D-9> gT
" Powerline
se ls=2 " Always show the statusline
let g:Powerline_symbols = 'fancy'
endif
"indent guides bg color
let g:indent_guides_auto_colors = 0
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=black ctermbg=3
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=darkgrey ctermbg=4
"vimwiki
let g:vimwiki_ues_mouse=1
"let g:vimwiki_ext2syntax = {'.md': 'markdown', '.mkd': 'markdown', '.wiki': 'media'}
let wiki = {}
let wiki.path = '~/Documents/wiki/'
let wiki.path_html = '~/Documents/wiki/html/'
let wiki.template_path = '~/Documents/wiki/wiki_templates/'
let wiki.template_default = 'header'
let wiki.template_ext = '.tpl'
"let wiki.syntax = 'markdown'
"let wiki.ext = '.md'
"let wiki.diary_rel_path = 'diary/'
"let wiki.nested_syntaxs = {'python': 'python'}
"let wiki.index = 'main'
"let blog = {}
"let blog.path = '~/Documents/.blog/'
"let blog.path_html = '~/Documents/.blog/html/'
"let g:vimwiki_list=[wiki, blog]
let g:vimwiki_list=[wiki]
":hi VimwikiHeader1 guifg=#FF0000
":hi VimwikiHeader2 guifg=#00FF00
":hi VimwikiHeader3 guifg=#1F49F6
":hi VimwikiHeader4 guifg=#FF00FF
":hi VimwikiHeader5 guifg=#00FFFF
":hi VimwikiHeader6 guifg=#FFFF00
"EasyMotion
let g:EasyMotion_do_shade = 0
let g:EasyMotion_leader_key = '<Leader>'
"hi EasyMotionTarget ctermbg=none ctermfg=green
"Calendar
"let g:calendar_diary = '~/Documents/diary/'
"let g:calendar_options='fdc=0 nonu nornu'
map cal :Calendar<cr>
"自动当前窗口局部工作目录
"autocmd! BufWinEnter * lcd %:p:h
se autochdir
"失去焦点自动保存
"au FocusLost * :wa
au FocusLost * silent! wa
"au FocusLost * silent! up
"au FocusLost *.html :wa
"vim-task
"inoremap <silent> <buffer> <C-D-CR> <ESC>:call Toggle_task_status()<CR>i
"noremap <silent> <buffer> <C-D-CR> :call Toggle_task_status()<CR>
"vim-seek
let g:SeekKey = 'e'
let g:SeekBackKey = 'E'
let g:seek_enable_jumps = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment