Skip to content

Instantly share code, notes, and snippets.

View hotoo's full-sized avatar
🎯
Focusing

闲耘™ hotoo

🎯
Focusing
View GitHub Profile
" Normal Mode, Visual Mode, and Select Mode,
" use <Tab> and <Shift-Tab> to indent
" @see http://c9s.blogspot.com/2007/10/vim-tips.html
nmap <tab> v>
nmap <s-tab> v<
vmap <tab> >gv
vmap <s-tab> <gv
" 选中一段文字并全文搜索这段文字
vnoremap * y/<C-R>=escape(@", '\\/.*$^~[]')<CR><CR>
vnoremap # y?<C-R>=escape(@", '\\/.*$^~[]')<CR><CR>
inoremap ( <c-r>=OpenPair('(')<CR>
inoremap ) <c-r>=ClosePair(')')<CR>
inoremap { <c-r>=OpenPair('{')<CR>
inoremap } <c-r>=ClosePair('}')<CR>
inoremap [ <c-r>=OpenPair('[')<CR>
inoremap ] <c-r>=ClosePair(']')<CR>
" just for xml document, but need not for now.
"inoremap < <c-r>=OpenPair('<')<CR>
"inoremap > <c-r>=ClosePair('>')<CR>
function! OpenPair(char)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\cmdhere]
@="Cmd&Here"
[HKEY_CLASSES_ROOT\*\shell\cmdhere\command]
@="cmd.exe /c start cmd.exe /k pushd \"%L\\..\""
" @see http://blog.chinaunix.net/u/8681/showart_1226043.html
" @usage 50g| jump to 50% of the lines columns.
nnoremap <expr> g<Bar> '<Esc>' . float2nr( round( (col('$')-1) * min([100, v:count]) / 100.0)) . '<Bar>'
" Toggle Menu and Toolbar
" @see http://liyanrui.is-programmer.com/articles/1791/gvim-menu-and-toolbar-toggle.html
set guioptions-=m
set guioptions-=T
map <silent> <F2> :if &guioptions =~# 'T' <Bar>
\set guioptions-=T <Bar>
\set guioptions-=m <bar>
\else <Bar>
\set guioptions+=T <Bar>
\set guioptions+=m <Bar>
function Js_css_compress ()
let cwd = expand('<afile>:p:h')
let nam = expand('<afile>:t:r')
let ext = expand('<afile>:e')
if -1 == match(nam, "[\._]src$")
let minfname = nam.".min.".ext
else
let minfname = substitute(nam, "[\._\-]src$", "", "g").".".ext
endif
if ext == 'less'
Output folder: D:\Vim\vim72
Extract: gvim.exe... 100%
Extract: install.exe... 100%
Extract: uninstal.exe... 100%
Extract: vimrun.exe... 100%
Extract: xxd.exe... 100%
Extract: diff.exe... 100%
Extract: vimtutor.bat... 100%
Extract: README.txt... 100%
Extract: uninstal.txt... 100%
--langdef=css
--langmap=css:.css
--regex-css=/^[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*\{/.\1/c,class/
--regex-css=/^[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*,/.\1/c,class/
--regex-css=/,[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*\{/.\1/c,class/
--regex-css=/,[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*,/.\1/c,class/
--regex-css=/^[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*\{/#\1/o,object/
--regex-css=/^[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*,/#\1/o,object/
--regex-css=/,[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*\{/#\1/o,object/
--regex-css=/,[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*,/#\1/o,object/
" encoding
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set langmenu=zh_CN.utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_cn.utf-8