this post was submitted on 27 Nov 2023
1 points (100.0% liked)

Emacs

311 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I would like to select the whole function by going to VISUAL mode and using $ to go to the last character and then going to the matching bracket with %. Doing this in NORMAL mode works fine, but when in VISUAL, it doesn't. How can I fix this? Or, what should I check to fix this?

you are viewing a single comment's thread
view the rest of the comments
[–] javajunkie314@alien.top 1 points 11 months ago

If I understand what you're describing, your point is on the first line of a function (not necessarily at the end). You press V to go into (line) visual mode, and then $%. And that's not working?

When I do that, I do wind up with the entire function selected as I'd expect. FWIW, I'm using evil mode as configured by Spacemacs, and I tested it out in a random Go file I had open. It looks like Spacemacs does add a bunch of extra packages in their evil layer*, but I checked and % is bound to evil-jump-item from the evil package.

* Not to be confused with their evil lair.