jmorag / kakoune.el

A very simple simulation of the kakoune editor inside of emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Really really basic emulation of running basic commands

alecStewart1 opened this issue · comments

This can run a command at : in a minibuffer. But it's very very very basic.

(defun evil-ex-smol (expr)
  "Takes the EXPR found after :, places it in a list, and will evaluate it."
  (interactive
   (let ((expr (format "(%s)" (read-string ":"))))
     (list (read expr))))
  (eval expr))

It's incredibly cheap. I've been working on creating a function that makes use of cond and string= to run vim-like commands (like if bn or buffer-next are found will run next-buffer). Some of those, like e/db/cdand any ! commands woud need some wrapper functions, but for now the above function works fine sans completions and history.

Sorry I'm just getting to this now. For some reason I didn't get any notification about the issue. Anyway, in my personal config, I bind : to M-x, which I find to be a lot more powerful than ex-mode, even though they have nothing to do with each other. Have you seen the function (eldoc-eval-expression)? It doesn't place the expression in a list, but it allows you to evaluate arbitrary elisp and kind of looks like ex-mode. It also has completion and history already worked out :) The default binding is M-:. If you think it would be an appropriate default binding for : in normal mode, it would be very quick to add it. I'm not super enthusiastic about re-implementing ex-mode, though.