zed icon indicating copy to clipboard operation
zed copied to clipboard

vim: Add `:w <filename>` command

Open AidanV opened this issue 7 months ago • 6 comments

Closes https://github.com/zed-industries/zed/issues/10920

Release Notes:

  • vim: Adds support for :w[rite] <filename>

AidanV avatar Apr 23 '25 06:04 AidanV

@ConradIrwin Currently there is no confirmation dialog when writing to a file that already exists. Any ideas on how to fix this?

AidanV avatar Apr 23 '25 06:04 AidanV

you can using prompt

CharlesChen0823 avatar Apr 23 '25 08:04 CharlesChen0823

@CharlesChen0823 can you elaborate on what you mean by using prompt?

AidanV avatar Apr 24 '25 17:04 AidanV

sorry,you can forget what i say,i remember the wrong API name save_item which not exist in editor

CharlesChen0823 avatar Apr 24 '25 23:04 CharlesChen0823

might you can reference the implementation here, do something similar?

CharlesChen0823 avatar Apr 25 '25 06:04 CharlesChen0823

@ConradIrwin I added a confirmation dialog to ask the user if they want to replace the file with the same name. Should we implement auto-completion for file names in this PR or a future PR?

AidanV avatar May 09 '25 06:05 AidanV

Thanks! Let's leave autocomplete for a follow-up. I pushed up a change to fix w! and add a test; I think this should be good to go.

ConradIrwin avatar May 12 '25 07:05 ConradIrwin