2010-01-20 36 views
1

是否有內置或第三方elisp命令移至cc模式中的匹配大括號?用於移動到cc模式下匹配大括號的XEmacs命令

我目前使用(paren-set-mode 'paren t)具有XEmacs的突出匹配的括號或括號,但是當支架處於關閉狀態在一塊帶有嵌套if塊代碼在屏幕上,這將是非常有用的,有一個命令,跳轉到匹配支撐。

類似於M-C-fM-C-b但是對於{}而不是()

回答

3

C-M-fC-M-b也應該適用於{}

+0

它似乎並不在XEmacs 21.4.21中。當我在第一個支撐處擊中「C-M-f」時,它跳轉到下一個')'而不是當前塊的右大括號。 – LordOphidian 2010-01-20 16:54:36

+0

沒關係。看起來我沒有正確的字符。您需要在「C-M-f」的開始大括號處以及在「C-M-b」的大括號之後有一個字符。 – LordOphidian 2010-01-20 17:09:17

2

我在XEmacs 21.5中安裝了big-menubar.el。 它增加了一個菜單項「運動」,並在菜單中有自己的鍵綁定以下兩個命令所示:

平衡括號CMP

的平衡括號CMN

開頭的最後,我認爲他們的作爲Control-Meta-next和previous。

他們還有其他一些可能令你感興趣的move-to命令, 這裏是從big-menubar.el中剪切並粘貼,顯示他們正在執行的命令(一旦你知道了什麼,你可以分配給你喜歡的任何鍵命令是...):

(add-submenu 
nil 
'("Motion" 
    ["Goto Mark"     exchange-point-and-mark (mark t)] 
    ["Goto Line..."       goto-line   t] 
    "---" 
    ["End of Balanced Parentheses ()"  forward-list  t] 
    ["Beginning of Balanced Parentheses ()" backward-list  t] 
    ["Next Opening Parenthesis ("   down-list   t] 
    ["Previous Opening Parenthesis ("  backward-up-list t] 
    ["Next Closing Parenthesis)"   up-list    t] 
    "---" 
    ["End of Balanced Expression"   forward-sexp  t] 
    ["Beginning of Balanced Expression"  backward-sexp  t] 
    "---" 
    ["End of Function"      end-of-defun  t] 
    ["Beginning of Function"     beginning-of-defun t] 
    "---" 
    ["Next Page"        forward-page  t] 
    ["Previous Page"       backward-page  t] 
    "---" 
    ["End of Buffer"       end-of-buffer  t] 
    ["Beginning of Buffer"     beginning-of-buffer t] 
    "---" 
    ["Save Current Position..."    point-to-register t] 
    ["Goto Saved Position..."    register-to-point t] 
    "---" 
    ["Set Marker..."       set-user-marker  t] 
    ["Goto Marker..."      goto-user-marker t] 
    ["List Markers"       list-markers  t] 
    "---" 
    ["Set Goal Column"      set-goal-column  t] 
    ["Cancel Goal Column"   (set-goal-column t) goal-column]))