Smart-Dash redefines the dash key to insert an underscore within C-style identifiers and a dash otherwise.
The goal is to allow you to type the
just type your code like you normally would, but stop pressing the shift key when you need an underscore inside an identifier.
If you need to type a literal dash right after an identifier (say, to type a
cramped arithmetic expression like
Will It Get in My Way?
TL;DR: no, not if you put spaces around "
In creating Smart-Dash I've tried to make sure that it doesn't get in your way. For example, Smart-Dash uses the syntax information provided by the current language mode to always insert a dash inside strings and comments, and has special cases for common idioms in C-like languages (described below).
However, since its behavior is heuristic, it may not interact well with your
particular coding style. If you are in the habit of putting spaces between your
identifiers and your arithmetic operators as in "
Additional Features for C-Like Languages
C has two situations where almost all developers and style guides put a dash
directly after an identifier. They are the
The first is that if you type
The second is a little more complicated, but I've found that it works in all syntactically-valid scenarios. If you type a dash and the previous character is an underscore, both characters are replaced by dashes. That sequence looks like this:
This requires that if you want a double-underscore in your identifier in a
C-like language, you will have to type it yourself. As for the rare case where you
want to type
Apply C fixups at all cursors
Initial release of Smart-Dash