Skip to content

Instantly share code, notes, and snippets.

View hotoo's full-sized avatar
🎯
Focusing

闲耘™ hotoo

🎯
Focusing
View GitHub Profile
@hotoo
hotoo / button.type.md
Last active August 29, 2015 14:06
button.type
  • document.createElement("button").type
  • document.createElement("button").getAttribute("type")
  • document.createElement("input").type
  • document.createElement("input").getAttribute("type")
Browser button.type button.getAttribute("type") input.type input.getAttribute("type")
Chrome submit null text null
Firefox submit null text null
ie11 submit null text null
" 选中一段文字并全文搜索这段文字
vnoremap * y/<C-R>=escape(@", '\\/.*$^~[]')<CR><CR>
vnoremap # y?<C-R>=escape(@", '\\/.*$^~[]')<CR><CR>
" 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
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)
" @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%
if has("win32")
set guifont=Courier_New:h12:cANSI
"set guifontwide=YouYuan:h11:cGB2312
endif
" 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