8

I need to ability to navigate and edit parts of a camel cased word in Emacs. Functionality similar to camel humps in Intellij IDEA. For example I need Blah,Foo and Bar in the string BlahFooBar to be identified as 3 separate words so I could navigate/edit them like they are separate words.

I have tried playing with syntax table

(modify-syntax-entry ?A ".")
(modify-syntax-entry ?F ".")

This has the effect of making lah, oo, and ar words and chars B and F word separators. So the navigation backwards (and backward-kill-word) does not work as expected.

What I need is word boundaries based on regex and not a separator.

Raghu
  • 2,004
  • 1
  • 16
  • 18

3 Answers3

20

M-xsubword-mode should do exactly that.

  • Hey Thanks. This is a better solution, since it comes packaged with emacs. – Raghu Oct 15 '12 at 21:24
  • @Gizak (via [suggested edit](http://stackoverflow.com/review/suggested-edits/6328229)): Post that as a separate answer. Edits that add in an alternative method should generally be posted as new answers. – Pokechu22 Nov 27 '14 at 01:39
1

Get py-forward-, resp. py-backward-into-nomenclature from python-mode.el

It works with any mode

https://launchpad.net/python-mode/+download

Andreas Röhler
  • 4,804
  • 14
  • 18
0

The solution seems to be camelcase mode. http://www.eecs.ucf.edu/~leavens/emacs/camelCase/camelCase-mode.html

Raghu
  • 2,004
  • 1
  • 16
  • 18