This page shows you how to edit lisp code using ErgoEmacs keybinding and without paredit mode.
For programing lisp in emacs, there's a mode called “paredit-mode”, see: ParEdit.
Jorge Dias posted in twitter, asking how to get it to work with ErgoEmacs Keybinding, because a lot keys clash.
I never tried ParEdit mode, because i'm not sure by principle it is efficient. Here's what i do.
When cursor is on a bracket, the entire bracketed region is highlighted. For how to setup, see: How to Edit Lisp Code with Emacs.
Any brackets are ALWAYS inserted and removed in pairs. For how to setup, see: How to Edit Lisp Code with Emacs.
To navigate nested brackets as tree structure, use built-in keys provided by GNU Emacs. e.g. 【Ctrl+Alt+←】【Ctrl+Alt+→】【Ctrl+Alt+↑】【Ctrl+Alt+↓】. For detail, see: How to Edit Lisp Code with Emacs.
To move cursor to previous/next brackets freely, i use custom commands with these keys {【Alt+→】,【Alt+←】,【Alt+↑】,【Alt+↓】}. See: Emacs: Commands and Keys to Navigate Brackets.
To select a lisp expression, put cursor on the beginning bracket, press the key 【Alt+8】 to select the entire expression, 【Alt+x】 to cut.
Both are in ErgoEmacs keybinding. For the code and detail, see:
To remove empty lines, type 【Alt+w】 (shrink-whitespaces)
To compact ending brackets, place your cursor there then press 【Alt+q】 (compact-uncompact-block)
When you need to make the format pretty, do them in batch on a region. Select text or whole file, then use the built-in command 【Ctrl+Alt+\】 (indent-region).
One principle i adhere is this: programers should NEVER HAVE TO SPEND EFFORT TO MANUALLY PRETTY FORMAT CODE. In particular, never on a line-by-line basis.
Ideally, the formatting should be done automatically, as in auto-fill-mode and Mathematica. I haven't coded this in ErgoEmacs yet. See:
For name completion and function templates, i use {elisp abbrev, auto-complete-mode, yasnippet}, all are bundled and with ErgoEmacs and already configured.
bsnp ▮ ⇒ buffer-substring-no-properties ▮ (➲ YASnippet Templates for Emacs Lisp Mode)search-forward▮ ⇒ (search-forward "▮" &optional BOUND NOERROR COUNT).