çãæ¥æ¬èªã§ã¿ã¤ãã«ããã¾ã表ç¾ã§ããªãã£ãã®ã§ããã以ä¸ã®çç±ã§ãfoldexprãè©ä¾¡ããã ãã®é¢æ°ï¼ãããã¯ã³ãã³ãï¼ãä½ããæåã§foldexprãè©ä¾¡ããããã£ãã®ã§ãã ãã£ã¨foldmethodãexprã®ã¾ã¾ã ã¨ãè¡æ°ã®å¤ããã¡ã¤ã«ãç·¨éæã«ãã®ãããéãï¼ autocmdã§åçã«ãã¾ãfoldmethodãåãæ¿ãããããããã®ã§ãããã¡ããã©è¯ãè¨å®ãå®ç¾ã§ããªãã :setlocal foldmethod=exprãä¸ã ã¿ã¤ãããã®ãããã©ãã ã§ã以ä¸ãå®ç¾ã§ããã³ã¼ãã§ããããã£ã¦ãã¾ãã°ç°¡åã ã£ãã®ã§ãããredrawãè¡ãã¨foldexprãè©ä¾¡ãããredrawãè¡ããªãã¨foldexprãè©ä¾¡ããã¾ããã§ããã function! s:eval_foldexpr() let saved_foldmethod = &foldmethod let saved_
Vim script ã«ã¯ä»ã¾ã§ fold marker ãåãè¾¼ãã§ããã®ã ãã©ãæ¯ååãè¾¼ãã®é¢åã ããè¦ãç®ããã¾ãã¤ã±ã¦ãªãã®ã§ foldexpr ã§æãç³ããã¨ã«ããã https://github.com/thinca/vim-ft-vim_fold æãç³ã¾ããç®æ function ã endfunction augroup ã augroup END è¡ç¶ç¶ (:help line-continuation) 'foldmarker' ç¹ã«è¡ç¶ç¶ã®æãç³ã¿ã¯ 'foldtext' ãããã£ã¦ä¸èº«ã1è¡ã«è¦ããããã«ãªã£ã¦ããä¾ãã°ã ãããã ãããªãã 'foldmarker' ã«ãããç¨åº¦å¯¾å¿ãã¦ããã®ã§ãé¢æ°ã¨ã¯å¥ã«ã«ãã´ãªå¥ã«æãç³ã¿ããã£ã¦å ´åã§ãä½µç¨ã§ããã ã¨ããããèªåã欲ãããã®ãä½ã£ãã ããªã®ã§ããè¦æã¨ãããã°è¨ã£ã¦ãããã°åãè¾¼ãããã
ç¶ç·¨âæãç³ã¿å«ãã®ç·ãä¸å¤ã§Folding freakã«ã¾ã§ãªã£ã話2 - cafegale Vim Advent Calendar 2011 23æ¥ç®å¤©çèªçæ¥æ å½ã¯ç§@LeafCageã§ãã ã¿ãªããæãç³ã¿ï¼Fordingï¼ã¯ä½¿ã£ã¦ãã§ããããï¼ ç§ã¯æãç³ã¿ãå«ãã§ããã æãç³ã¿ããã¡ãªçç±ã¯å¤§ãã2ã¤ããã¾ãã è¦ãç®ãæªã æä½æ§ãæªã ãã®2ã¤ãã«ã¤ã¼ã³ãã¦å¿«é©ãªæãç³ã¿ç°å¢ãæ§ç¯ãããã¨ã«ãã¾ãã è¦ãç®ã®ã«ã¤ã¼ã³ ã¾ããè¦ãç®ã«ã¤ãã¦ã§ãã Vimæ¨æºã®æãç³ã¿è¡¨ç¤ºã¯ã¤ã³ãã³ããå´©ãããæåã®è¡ã®å 容ãåããã«ããã¨ãããã¨ã§ç´æçã§ã¯ããã¾ããã ããã§æãç³ã¿ããã¹ããçæããé¢æ°ãå·®ãæ¿ãã¦ãããèªåã«æã¾ããããã«è¡¨ç¤ºãå¤ãã¦ãã¾ãã¾ãããã æ¨æºã§ã¯set foldtext=foldtext()ã«ãªã£ã¦ãã¾ããããããèªåã§ç¨æããé¢æ°ã«å·®ãæ¿ãã¾ãã é©ç¨
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}