티스토리 뷰
tip karma Rating 90/41, Viewed by 5472
created: September 6, 2001 2:51 complexity: intermediate
author: Max Ischenko as of Vim: 6.0
When viewing/editing a folded file, it is often needed to inspect/close some fold.
To speed up these operation use the following (put in your $HOME/.vimrc):
" Toggle fold state between closed and opened.
"
" If there is no fold at current line, just moves forward.
" If it is present, reverse it's state.
fun! ToggleFold()
if foldlevel('.') == 0
normal! l
else
if foldclosed('.') < 0
. foldclose
else
. foldopen
endif
endif
" Clear status line
echo
endfun
" Map this function to Space key.
noremap <space> :call ToggleFold()<CR>
See :help folding for more information about folding.
vim.org에서 내가 가장 좋아하는 팁..
http://www.vim.org/tips/tip.php?tip_id=108
- Total
- Today
- Yesterday
- chromecast
- vc++
- 컬러스킴
- iis7
- gantt
- 실패한요청규칙추적
- 아이폰가죽케이스
- VIM
- GanttChart
- Natural Ergonomic Desktop 7000
- win2k8
- FREB
- 小米
- 샤오미
- 무시 패턴
- 小蚁
- ignore pattern
- GVim
- syntaxhighlight
- random colors
- LOG_FILE_MAX_SIZE_TRUNCATE
- php
- GanttCalendar
- apache22
- 아이폰
- FreeBSD
- 크롬캐스트
- 스마트웹캠
- 小蚁智能摄像机
- 샤오이
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |