camelCase-mode
Edit (java) camelCaseIdentifiers using Emacs word-command keystrokes
camelCase-mode is a Gnu Emacs minor mode which extends the forward-word, backward-word, delete-word, etc. keystroke-commands so they also work on words within a camelCase identifier. As a minor mode, camelCase-mode can be used within any other editing mode --- Java-mode, text-mode, etc. No functionality is lost, since the forward s-expression, backward s-expression, delete s-expression, etc. commands are still available to navigate over entire camelCase names.
Word boundaries within a camelCase name are marked only by letter case. For example lowerCapitalUPPERCase has four words. A word may be lowercase, Capitalized, UPPERCASE, or a sequence of digits. Besides non-letter to letter and letter to non-letter word boundaries, word boundaries in the middle of a sequence of letters are located at lowercaseCapital, CapitalCapital, lowercaseUPPERCASE, CapitalUPPERCASE, and UPPERCASECapital boundaries.
Rebound keys:
(Italic means only in Gnu Emacs, not in XEMacs; the original
binding is not to the word command in XEmacs, so it is not overridden.)
M-f M-right C-right camelCase-forward-word M-b M-left C-left camelCase-backward-word M-d M-delete C-delete camelCase-forward-kill-word M-DEL M-backspace C-backspace camelCase-backward-kill-word M-t camelCase-transpose-words M-c camelCase-capitalize-word M-u camelCase-upcase-word M-l camelCase-downcase-word
camelCase-mode
prefix arg:
0 turns off, 1 turns on, nil toggles mode.
Handles uppercase acronyms within camelCase words. For example "URLConnection" is like "URL_Connection", not "URLC_onnection".
camelCase-mode has been developed and tested on Gnu Emacs 20.7. It is also known to work on XEmacs 21.4. It may well work on other versions of Emacs. (There may be variation in how minor modes are installed. There may also be variation in syntax for keybindings.)
To unpack, use your favorite unzipping tool, or use tar directly
(note: .tgz = .tar.gz):
tar -xzf camelCase.tgzTo load:
M-x Load-file camelCase/camelCase-mode.elcTo toggle on or off from any buffer:
M-x camelCase-mode
To make it always available, load it from your initialization file.
A suggested Gnu Emacs .emacs
(or XEmacs
.xemacs/init.el
) file initialization:
(autoload 'camelCase-mode "camelCase/camelCase-mode") (add-hook 'java-mode-hook '(lambda () (camelCase-mode 1)))More global hooks are also possible:
find-file-hooks
, post-command-hook
Copyright (C) 2001 C.R.Manning
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
If any maintainenace updates are created, they will become available at the CaromaLab page.
camelCase-mode is free, open-source software. If you enjoy this software, please consider contributing to the author's tipjar to show your appreciation for creating and distributing it, and to encourage future development. Tips are accepted at the CaromaLab TipJar on HotDispatch.
camelCase-mode extends Gnu Emacs, so if you have more time may also consider showing your appreciation to the creators and maintainers of Gnu Emacs by making a donation to the Free Software Foundation.