On 6/21/24 10:56, Daniel M Gessel wrote:
I haven't been able to switch to an IDE - I still go to the command
line to build and test, but now it's just for fun and curiosity -
productivity takes a back seat.
I still use a command line, too. But emacs itself turns out can be a
good IDE, and some IDE stuff I do need (to try to keep up with the kids
and their terrible Jetbrains IDEs).
What I have is roughly:
1. Code completion (start typing a function or variable name and it
suggests actual existing functions, variables, etc.),
2. Documenting functions (hover and stuff pops up, start typing a
function call and details pop up as I fill out the parameter list),
3. Navigation (jump to the the definition or implementation of this
thing, and of this next thing, then go back, and go back again),
4. Searching (see all references in another buffer, a bit like M-x grep
but much faster to invoke and more specific, and not just string search
but savvy search for the right kind of thing, such as the variable named
foo, not other things called foo, and not comments including the word
"foolish"),
5. Some automated code editing (such as rename this thing
everywhere——except I discovered it seems to only apply to open buffers),
6. There is some inconsistent auto-typing of things like closing braces
but that seems to annoy me at least as much as help,
7. There are some code refactoring that I haven't figured out yet, I
don't know whether it be useful.
8. Syntax coloring, which is always iffy, particularly because I don't
like current fashion of dim gray on a dimmer gray background, so I'll
get, say, yellow that on white is pretty much invisible, but this is
still mostly useful territory.
9. At least in Rust as I type code it will complain about problems, a
little like a continuous compiler run. Not too annoying, even. And I can
see a list of problems in another buffer, if I want. This can't work as
well in C because the C compiler doesn't know as much, but I don't have
enough experience with that to really know, yet.
There are probably more features I have left out.
Other than #3, these features are easily discoverable, making the
learning curve of emacs as an IDE easier than that of the crappy GUI
programs!
Much of those features work in a pure text UI. Some are right-click
features, but there might be a keyboard way to do that. Mouse hover is
obviously going to be tricky in a pure text UI, but maybe some key
equivalent exists.
I have used the Rust features *far* more than I have C, I certainly
don't yet have all of that working in C. Things like rename and savvy
search might never work as well in C because C is more wild-west and
ambiguous. Seems to me things like refactoring might be particularly
tricky (and valuable!). Donno.
My most recent C additions included something called "helm" was really
annoying and I seem to remember wanted to do lots of stuff I do on the
command line and have no interested in, so I commented it out.
Cool discovery: The key bindings for navigation and searching seemed to
be the same between C and Rust!
Balancing of things like brackets has been in emacs for ages, and so has
auto-indenting when I start a new line, and typing tab to move the line
to its logical indentation——these seem mostly unchanged,
For years I have appreciated gdb support in emacs: showing me what line
I am at, letting me see and toggle breakpoints, but I still use the
keyboard to do other stuff, "step in" and "stop over" buttons just use
up valuable screen real estate, in my opinion. I don't think I have
anything new in this department.
Some of these popup things are annoying as they block what I am trying
to see, or an "informative" and too-big emacs buffer appears, taking up
space, but I have started to learn how to minimize that frustration (I
think I do things like move my mouse or my cursor in from another
direction, get out of these soft modes quickly, etc., I forget what all).
No expensive Jetbrains license needed! Better than MS's free "code", too.
If you are interested in how I set it up, I'm happy to share. Just don't
expect me to be able to answer many questions, I have never learned
emacs lisp, and I mostly don't know how to make any sense of what is in
~/.emacs/…
-kb
_______________________________________________
Discuss mailing list
Discuss@driftwood.blu.org
https://driftwood.blu.org/mailman/listinfo/discuss