2009-09-23 106 views

回答

23

假設你正在使用nxml模式:

C-M-n runs the command nxml-forward-element, which is an interactive 
compiled Lisp function in `nxml-mode.el'. 

It is bound to C-M-n. 

(nxml-forward-element &optional ARG) 

Move forward over one element. 
With ARG, do it that many times. 
Negative ARG means move backward. 
+2

順便提一下,這與您在許多語言模式下用於導航關閉/打開括號/括號/大括號的綁定相同。 – ocodo 2013-01-02 05:24:30

52

如果你正在使用sgml-mode或其衍生物(如html-mode):

sgml-skip-tag-forward是``SGML互動編譯Lisp函數-mode.el'`。

它被綁定到

C-c C-f

C-c <right>

和結合到菜單欄:

<menu-bar> <sgml> <sgml-skip-tag-forward>` 

從emacslisp:

(sgml-skip-tag-forward arg) 

跳到標籤結尾或匹配結束標籤(如果存在)。使用前綴參數arg,重複此參數時間。如果在結束標記之後返回t。

+1

方便的是,無論模式如何(這些'sgml-mode'庫已經被加載),這些函數都被寫入工作。所以如果你使用其他模式編輯HTML,你仍然可以調用'sgml-skip-tag-forward'和'sgml-skip-tag-backward'。 – phils 2013-01-02 10:00:39

+0

而C-C C-b是當你想要向後跳時。 – 2016-09-23 01:15:56

5

...如果你使用web-modeC-CC-N將從開始標記跳轉到相應的結束標記。該模式還具有其他一些功能(代碼摺疊,自動關閉HTML標籤,...),可能值得一看。