zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.71k stars 3.14k forks source link

vimrc support #4456

Open bluc41 opened 1 year ago

bluc41 commented 1 year ago

Check for existing issues

Describe the feature

Being able to point to a .vimrc file and have vim mode use those bindings

If applicable, add mockups / screenshots to help present your vision of the feature

No response

ConradIrwin commented 1 year ago

Thanks for the suggestion @bluc41! Supporting all of vimrc is probably out of scope for now, but it sounds like maybe the primary things you care about are your keybindings?

If so, would you mind giving me some examples of things you use, and I'll see if we can figure out how to make them work in Zed.

What other things do you really want from there?

bluc41 commented 1 year ago

Thanks for the suggestion @bluc41! Supporting all of vimrc is probably out of scope for now, but it sounds like maybe the primary things you care about are your keybindings?

If so, would you mind giving me some examples of things you use, and I'll see if we can figure out how to make them work in Zed.

What other things do you really want from there?

Yea totally understand -- was just thinking about lowering onboarding friction. I love that y'all start with a base set of key bindings, makes it really easy to switch to Zed.

My personal needs are fairly simple, I map ctrl-j to 5j (down 5 lines) for fast nav, jk to go back to normal mode, etc.

I poked around the vim.json but couldn't figure out how to bind something to repeat an action.

avi-cenna commented 9 months ago

I've been using Zed and it's an awesome editor, but it seems that the keybinding features are quite limited right now.

Would it be easy to allow for chaining multiple commands? This way, people could replicate special functions with arrays of commands.

So for example, to comment out a paragraph, we would map g c i p to a sequence of commands like [ "SelectParagraph", "Comment", "Unselect" ].

If we could map a keybinding to an arbitrary sequence of keypresses that might work as well.

ConradIrwin commented 9 months ago

Yup! This is tracked at #7033. If you’d like to work on it with me, feel free to book time at https://calendly.com/conradirwin/pairing

giorgioskij commented 7 months ago

Hi! I too would love to have a configurable .vimrc: the main thing I miss is jk and kj to go back to normal mode, U mapped to redo and stuff like that. I'm writing on this thread because #7033 is not really the same thing, I'm note sure whether the two things can be considered a single feature or two separate ones. If you guys agree that this is useful, I would love to work on this.

giorgioskij commented 7 months ago

Nevermind, I just found out that I can actually do what I want with zed keybindings (https://zed.dev/docs/vim). Sorry for not reading docs earlier, with the issue being open I thought that this wouldn't be possible.

awvalenti commented 3 months ago

I'd love to be able to use my vimrc file, too. Some of my most important stuff:

nnoremap U <C-r>
noremap ' `
noremap - ^
nnoremap = $
vnoremap = $h
onoremap = $
noremap H <C-b>
noremap M zz
noremap L <C-f>
noremap _ g~l
nnoremap <Tab> "_
imap jk <Esc>
nnoremap K kJ
set clipboard=unnamed,unnamedplus
betoharres commented 1 month ago

it's really hard to move from vim/neovim if it's not something like gvim inside the editor; until that happens I'm going to stick with just good old vim