[wingide-users] Navigating via Underscores
Mitchell L Model
dev at software-concepts.org
Wed Jul 11 13:51:18 MDT 2012
> From: Wing IDE Support <support at wingware.com>
> To: Jeffrey Spencer <jeffspencerd at gmail.com>
> Cc: wingide-users at wingware.com
> Subject: Re: [wingide-users] Navigating via Underscores
> Message-ID: <4FFD8E5F.8050503 at wingware.com>
> On 7/11/12 3:39 AM, Jeffrey Spencer wrote:
>> I was wondering if there is a setting in 4.1 that allows the delimiter
>> for navigating to stop at underscores like in Ipython. I figured there
>> might be a setting but couldn't find it.
> Wing doesn't current support treating _ as a non-word character.
I have script functions for this. I will clean them up and post them on http://wiki.wingware.com soon. I recently found myself working on a large existing code base that had many function names and even modules with many underscores. I would have gone nuts without being able to choose between moving back and forth by underscores or by entire symbols.
I have long used Emacs macros written by me and others to distinguish three kinds of "words": syllables, words, and symbols. The details depend on what kind of thing is being edited -- plain text, python code, html, etc., but the general idea is that syllables are demarcated by appropriate delimiters (_ in Python, - in text, . in a file name, etc., and there could be more than one delimiter) or an uppercase letter following a lowercase letter; symbols are the longest meaningful character sequences (a Unix style path, a URL, etc.), and words are the natural units in between. Of course depending on the character sequence, a word could contain a single syllable and a symbol could contain a single word. Unfortunately this use of the term "symbol" conflicts with the traditional programming language concept of "symbol", which the usage I am describing would call a word.
Being (still) a heavy Emacs user and programmer, I have done a lot of work (and gotten a lot of assistance from Wing support) to add keybindings and commands to Wing that fill out its Emacs-like capabilities, including ones I have added myself. I have some down time in the next few weeks and will try to collect, clean up, and post my Emacs-motivated scripts and keybindings. Many of these could be used with other keyboard settings in Wing.
Similarly, as a Mac user since I bought a 128K Mac in 1984, I have done some things -- mostly around keybindings -- in both Emacs and Wing to support my reflexive use of command-modified keys as standard Mac commands. I will post those too.
More information about the wingide-users