Fork me on GitHub
#emacs
<
2022-05-04
>
plexus07:05:24

For folks who are curious about Corgi development, I did a small write-up of how we're approaching key bindings https://github.com/corgi-emacs/corgi/issues/23

corgi-emacs 5
vemv08:05:53

It's also possible to preemptively remove bindings from all foreign modes. It's what I do - my least favorite thing in the world is hitting a shortcut by accident and invoking some crazy command with it IMO Emacs got wrong the whole notion of "modes define keybindings". It's users who should - according to their preferences and usage patterns

plexus08:05:39

100% agree, do you have some pointers for bulk removing key bindings? I've looked at it in the past but didn't find an elegant solution.

vemv08:05:59

I think that my approach boils down to iterating https://github.com/zenmacs/.emacs.d/blob/cbe6088f8e8cd892b81c10cf9e2400f02b1942f7/lib/non-submodules/vemv.data.el#L11-L22 and invoking global-unset-key over each item. There might be some other step needed for a comphensive removal, but that should buy a good first 99%!

1
practicalli-johnny11:05:42

Would Corgi provide / support an alternative keybinding for Esc, for example pressing fd in quick succession in insert mode returns to normal mode? This is the first thing I usually add to Neovim, so assume its not a common Vim binding

plexus13:05:14

it conflicts with a vim binding, you'll have to make a case that this is an order of magnitude more useful and thus worth breaking vim compat over

practicalli-johnny15:05:01

Can you elaborate on what vim binding the fd key binding conflicts with? I am aware of the f binding by itself in normal mode to find a character on the current line, but not aware of a vim binding for the fd combination. I couldnt find anything in a search. Its something I specifically add to NeoVim, so curious as to what I am replacing. Thank you.

plexus15:05:25

if f is bound then you can't bind fd, right? it's either a command or a prefix key

f               f{char}         1  cursor to Nth occurrence of {char} to the
                                   right

practicalli-johnny15:05:33

But f isn't bound to anything but the f character in insert mode, or have I missed something?

plexus15:05:19

oh of course right we're talking about insert mode, yes f inserts itself, sorry for being a bit slow 🙂

plexus15:05:12

I'm aware of this fd hack but not sure how widespread it is... feel free to open an issue, it's worth considering, or at least providing a snippet for people

👍 1
Benjamin08:05:35

turn  this

  [de.otto/nom "0.2.0"]

  into this

  de.otto/nom {:mvn/version "0.2.0"}

(defun lein-deps-to-deps (beg end)
  (interactive "r")
  (replace-regexp-in-region
   "\\[\\(.+?\\)\\s-\\(\".+?\"\\)\\]"
   "\\1 {:mvn/version \\2}"
   beg
   end))
I wanted this function sometimes

plexus08:05:15

related, this is a bb script I use to turn project.clj into deps.edn. Sometimes still requires manual editing afterwards but it's very helpful as a starting point https://gist.github.com/688735af4d8b0879f7a98a9d2d8d3cbb

👍 1
👀 1