Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

[Feature-request] ex-mode goto line #11

Open
sethwoodworth opened this issue Jan 14, 2014 · 4 comments
Open

[Feature-request] ex-mode goto line #11

sethwoodworth opened this issue Jan 14, 2014 · 4 comments

Comments

@sethwoodworth
Copy link

: enters vim-like ex-mode. In Vim, :32 would jump to line 32.
How would I go about adding this as a command function?

Or would this interfere with the behavior of cmd+l which takes a second argument after cmd+l?

@jiripospisil
Copy link

I agree that :32 should be supported. In the meanwhile, you can use 32G or 32gg to do the same. I actually prefer it.

@Morgawr
Copy link

Morgawr commented Jan 29, 2014

+1 for this

@cldwalker
Copy link
Member

This functionality is available in CodeMirror, LightTable's editor. Try for yourself in this demo. However, LT's current ex-mode only autocompletes to vim LT commands and only processes LT commands.

The latter could be remedied with an ltexec that delegates unknown commands back to CodeMirror:

  (ex-command {:name "ltexec"
               :func (fn [cm info]
                       (let [command (-> (.-args info) first keyword)
                              ex-args (next (.-args info))]
                         (if (cmd/by-id command)
                           (apply cmd/exec! command  ex-args)
                           (when-let [ed (pool/last-active)]
                             (js/CodeMirror.Vim.handleEx (editor/->cm-ed ed)
                                                                            (clojure.string/join " " ex-args))))})

However, the UI would also have to allow this which it currently doesn't.

Alternatively, we could opt for an optional way to disable LT's ex-command UI but I've tried that and LT still causes CodeMirror's showPrompt to get thrown as an alert box.

I'd love to see the latter solution, appearing the same as the above demo.

@ibdknox Any thoughts?

@cldwalker
Copy link
Member

After thinking about this more, I'm happy with 32G. We don't have enough bandwidth to tackle this but if anyone is passionate about this, happy to discuss a pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants