Author Topic: S-Expression Navigation  (Read 12694 times)

Lisa

  • Senior Community Member
  • Posts: 238
  • Hero Points: 24
  • User-friendly geek-speak translator extraordinaire
S-Expression Navigation
« on: August 12, 2008, 01:36:38 PM »
Commands (and key bindings) are available for Emacs-like S-expression navigation. These work in all emulations.

  • The next_sexp (Ctrl+Alt+Right) and prev_sexp (Ctrl+Alt+Left) commands can be compared to next_word and prev_word, except that they treat blocks as words.

  • The backward_up_sexp (Ctrl+Alt+Up) command is the shortcut for navigating to the start of the immediately enclosing block (in Lisp, this would be the open paren).
     
  • The forward_down_sexp (Ctrl+Alt+Down) command is used to drill into a block. If the cursor is at the start of a block, it moves the cursor to the first S-expression within the block; otherwise, it behaves like next_sexp.
     
  • The commands select_prev_sexp (Ctrl+Alt+Shift+Left) and select_next_sexp (Ctrl+Alt+Shift+Right) extend a character selection from the cursor position to the start of the next or previous S-expression, respectively. Like the Shift+Cursor commands do to CUA style selections, if executed repeatedly, they will extend the current character selection.

  • The cut_prev_sexp (Ctrl+Alt+Backspace) command will delete the S-expression to the left of the cursor and copy it to the clipboard. Again, if called repeatedly, this will prepend the subsequent deletions to the clipboard.