zedapp / zed

Rethinking code editing.
http://zedapp.org
MIT License
2.22k stars 162 forks source link

vi keys support? #41

Closed Shados closed 10 years ago

Shados commented 10 years ago

Given you're using ACE, is there any chance of getting support for using its vi keybindings mode? I like a lot about the editor, but I'm not sure how long I can go without vim's modal editing anymore ._.

zefhemel commented 10 years ago

This may be tricky to implement since Zed overrides ACE's key handlers to make it more configurable (all key bindings are defined here: https://github.com/zedapp/zed/blob/master/app/settings/keys.default.json).

However, never say never. I'm a vim fan myself too. But moded editing would require quite some changes I think.

Shados commented 10 years ago

I can certainly see how that would make things harder, but really, being "keyboard oriented" is less impressive when I still have to move my right hand off the home row over to the arrow keys and back all the time :P.

zefhemel commented 10 years ago

If you're on Mac, you can use many Emacs cursor movements right now (Ctrl-e, Ctrl-a, Ctrl-n, Ctrl-p, Ctrl-f, Ctrl-b, Alt-f, Alt-b etc.) Wanted to enable that on Windows/Linux too, but you have too few modifier keys ;)

ijaaz commented 10 years ago

I could also really use vi keybinding. I love zed enough to move away from my beloved Sublime and Vim, but its text editing ability (for me) is less than optimal without vi keybindings (of course this is more due to the fact that I do not have a mac than anything else).

uptownhr commented 10 years ago

Yo! Loving Zed but any update in this are? Would really love to see vim and emacs bindings. I know some emacs are enabled but would love to go fully into emacs mode.

zefhemel commented 10 years ago

I'd love to add vim keybindings. I have to investigate whether I can reuse Ace's vim mode or we have to build something custom, or a mix.

farnoy commented 10 years ago

+1, would start using Zed right now if it supported basic vim keybinds.

I'm seeing configuration for modes (default: ace/mode/text) but they are applied per language configuration (for syntax highlighting) so I guess we can't implement vim modes with Zed modes?

nabn commented 10 years ago

+1

marfarma commented 10 years ago

I'd be happy if the j & k keys would traverse the tree views on commands & files pop-ups. Happier still If I could have full out vi style moded editing.

+1

bhoward00 commented 10 years ago

Great editor, but...

+1 for VI key bindings

stephencheng commented 10 years ago

+1 for vim key bindings. Can borrow things from vim.js?

jbuedel commented 10 years ago

+1 Would also really like vim bindings.

ijaaz commented 10 years ago

From what I understand, vim.js is server side, and needs nodejs. It is also very memory intensive, I looked at manually building vim.js, and my computer did not fit the requirements. Perhaps using some of the keybinding's of vim.js is possible?

On Mon, Apr 7, 2014 at 12:39 PM, Josh Buedel notifications@github.comwrote:

+1 Would also really like vim bindings.

Reply to this email directly or view it on GitHubhttps://github.com/zedapp/zed/issues/41#issuecomment-39753420 .

SuspendedPhan commented 10 years ago

+1 I tried it out and this is a deal breaker for me. I'm dropping Sublime as soon as this is addressed

tenfourty commented 10 years ago

+1 for vim key bindings as well.

zefhemel commented 10 years ago

Don't tell anybody, but vim keybindings just landed. Switching between keybindings may be a bit buggy sometims, so you may have to close the window first (especially between vim -> zed mode).

Command: Configuration:Preferences:KeyBinding:Vim, also: Configuration:Preferences:KeyBinding:Emacs and the default: Configuration:Preferences:KeyBinding:Zed. Thanks to @nightwing for this.

farnoy commented 10 years ago

I'm getting errors when switching to vim mode:

[Sandbox]: Error while loading file /default/command/set_preference.js 404  (line: 173) log.js:26
[Sandbox]: Uncaught Error: Load timeout for modules: configfs!/default/command/set_preference.js
http://requirejs.org/docs/errors.html#timeout (line: 32)

I'm not seeing set_preference.js in the git tree and the only mention of this file is done when defining the keybind-switching commands. Am I missing something?

zefhemel commented 10 years ago

I forgot to add a new file I created, please pull and try again.

zefhemel commented 10 years ago

Ah, also run make install-dep again to fetch the ACE update.

farnoy commented 10 years ago

I can enter Vim mode now, but no vim-specific functionality works. I don't think any vim keybinds are registered.

Also, just guessing at this point, but does Zed prevent ACE from switching modes or something like that? Vim-like functionality is probably implemented with many modes in ACE itself, maybe it can't switch it internally?

Thanks for the progress!

zefhemel commented 10 years ago

vim specific functionality? What do you mean? I can now use j, k, l, h to move around, have insert mode etc.

farnoy commented 10 years ago

Oh, it works on my projects too now. I was checking by opening up Configuration. Does it work for you there?

Edit:

This is awesome :)

zefhemel commented 10 years ago

It does work, but weird things happen when you switch back and forth. Have to investigate exactly what's going on.

bhoward00 commented 10 years ago

Once I figured out that I needed to change the configuration using CMD-. rather than through the configuration window, it works great. Basic editing there, but no using colon+number to jump to a line number, slash searching, or number-command (e.g. 5 >> to indent five lines).

zefhemel commented 10 years ago

Jump to line 10 using 10GAnd number commands work in most cases, perhaps not >> yet.  — Zef

Sent from my iPhone

On Tue, Apr 15, 2014 at 8:37 PM, bhoward00 notifications@github.com wrote:

Once I figured out that I needed to change the configuration using CMD-. rather than through the configuration window, it works great. Basic editing there, but no using colon+number to jump to a line number, slash searching, or number-command (e.g. 5 >> to indent five lines).

Reply to this email directly or view it on GitHub: https://github.com/zedapp/zed/issues/41#issuecomment-40517806

stephencheng commented 10 years ago

Hi Zef

Not sure how to follow and config it. Could you elaborate a little?

Am I correct I will need to upgrade the zed app? and how?and where to make the configuration? When I click the configuration, it gives a readonly text file showing manual file.

Sorry, I look lost.

On Thu, Apr 10, 2014 at 11:24 PM, Zef Hemel notifications@github.comwrote:

Don't tell anybody, but vim keybindings just landed. Switching between keybindings may be a bit buggy sometims, so you may have to close the window first (especially between vim -> zed mode).

Command: Configuration:Preferences:KeyBinding:Vim, also: Configuration:Preferences:KeyBinding:Emacs and the default: Configuration:Preferences:KeyBinding:Zed. Thanks to @nightwight for this.

— Reply to this email directly or view it on GitHubhttps://github.com/zedapp/zed/issues/41#issuecomment-40080173 .

zefhemel commented 10 years ago

It's in version 0.11, which is the current downloadable version and the one in the Chrome store. To enable run the Configuration:Preferences:KeyBinding:Vim command (via Ctrl-. or Command-.)

uptownhr commented 10 years ago

Hi Zef,

I just tried emacs mode but not sure what this is supposed to change. Do you happen to know? Seems to be the same.

farnoy commented 10 years ago

Just checked 0.11.3 and the Vi mode starts in Insert mode (behavior changed since 0.11.2), should I create a new issue?

zefhemel commented 10 years ago

@farnoy ah, that's strange. Yes, please create a new issue.