help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outline-mode to recognize Vim-type foldmarkers {{{1 {{{2 {{{3


From: Andreas Politz
Subject: Re: outline-mode to recognize Vim-type foldmarkers {{{1 {{{2 {{{3
Date: Thu, 27 Nov 2008 00:03:20 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Teemu Likonen wrote:
Is it possible to configure outline-mode to recognize folding levels by
Vim-type foldmarkers? How? By default, Vim's foldmarker is {{{ and a
number after the marker defines the folding level, like this:

    {{{1            (= first-level heading)
    {{{2            (= second-level heading)
    {{{3            (= third-level heading)



;; vim outline

Eval the next 2 expressions in the buffers context.

;; (set (make-local-variable 'outline-regexp)  ".*{{{\\([0-9]+\\)")
;; (set (make-local-variable 'outline-level) 'vim-outline-level)

(defun vim-outline-level ()
  (save-excursion
    (re-search-forward "{{{\\([0-9]+\\)" nil t)
    (string-to-number (match-string 1))))

-ap


reply via email to

[Prev in Thread] Current Thread [Next in Thread]