Vimã§èª¤ã£ã¦":wq"ã®ãããªãã¡ã¤ã«ãä½ã£ã¦ãã¾ãã®ãé²ãæ¹æ³ï¼autocmdã使ãï¼
èæ¯
- Vimã使ã£ã¦ããã
åé¡
- Vimã®ãæ¸ãè¾¼ãã§çµäºãã³ãã³ã㯠":wq" ã ãã誤ã£ã¦ ":w:wq" ã®ããã«ãã¦ãã¾ã㨠":wq" ã¨ããå¤ãªãã¡ã¤ã«ãã§ãã¦ãã¾ãã
解æ³
- autocmdã使ã£ã¦ç¹å®ã®ãã¡ã¤ã«åã®æ¸ãè¾¼ã¿ã«ã¯è¦åãåºãã
詳細
- id:tyruããã®ã¨ã³ã¿ã¼å·»ãè¾¼ã¿äºæ ãé²ãã®ã³ã¼ããå©ç¨ããã
- 以ä¸ã§ã¯ ":" ã§å§ã¾ããã"[" ã§çµãããã"]" ã§çµãããã¡ã¤ã«åã®ã¨ãã«è¦åã表示ãã¦ããã
" Checking typo. " http://d.hatena.ne.jp/tyru/20130419/avoid_tyop ï¼ä¸é¨ä¿®æ£ï¼ autocmd BufWriteCmd :*,*[,*] call s:write_check_typo(expand('<afile>')) function! s:write_check_typo(file) let prompt = "possible typo: really want to write to '" . a:file . "'?(y/n):" let input = input(prompt) if input =~? '^y\(es\)\=$' execute 'write'.(v:cmdbang ? '!' : '') a:file endif endfunction
è¬è¾
- å°ã£ã¦ããã¨ãã«@sgurããã«æãã¦ããã ãã¾ãããæè¬ã