VSCodeVim / VSCodeVim/Vim

Refactoring `:e` options + support windows host

Open
#5,158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

This is both a request/issue/discussion. I reimplemented :e option a while back to support both the tab completion and opening file on remote. I learned that a few days ago that vscode-remote support windows machine as remote, and the assumption I made here

https://github.com/VSCodeVim/Vim/blob/e7c5c70f9f5ebc79004bf86cd69a3b242e51b623/src/util/path.ts#L115-L116

is no longer valid.


Since I just worked on a feature on another extension that touches on path manipulation, I learned more about how to handle different edge cases and I am thinking to refactor the work I did here to support some new features for :e:

  • Support :e and auto completion with *nix remoting into Windows

  • Change the base directory of the :e for relative path to the workspace folder of the active editor (to be more like vim) than just the folder containing the active editor
    Local cases:

    • A folder /home/steven/Vim is opened in vscode, and the active editor is src/statusBar.ts. :e ./ should autocomplete contents in the directory of /home/steven/Vim instead of /home/steven/Vim/src.
    • A folder /home/steven/Vim is opened in vscode, and the active editor is an untitled document. :e ./ should autocomplete contents the directory of /home/steven/Vim/ instead of /home/steven/Vim/src/
      A folder /home/steven/Vim is opened in vscode, and the active editor is file outside of the workspace like /home/steven/.bashrc. :e ./ should autocomplete contents the directory of /home/steven/ instead of /home/steven/Vim -OR- No folder is opened, and the active editor is /home/steven/Vim/src/statusBar.ts, :e ./ should complete the contents in the directory of /home/steven/Vim/src/
    • No folder is opened, and the active editor is an untitled, only absolute path can be autocompleted

    Remote cases are the same as the local case except:

    • No folder is opened, and the active editor is an untitled, it can also autocomplete local absolute path.
  • Remove auto extension completion when execute :e command (vim doesn't do that. I don't know why it was there in the first place - Maybe it was there because there wasn't any autocompletion)

    • This feature only auto completes using the active buffer's extension. For example: if I opened src/statusBar.ts and entered :e textEditor, vscode vim will tried to open src/textEditor.ts
    • AFAIK, this doesn't exist in regular vim, and doesn't make much sense now that we have auto completion.

I started part of the work, and just want to make sure those features/fixes make sense before I get to far.

Other related issues:
https://github.com/VSCodeVim/Vim/issues/4859

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/util/path.ts at the linked lines and review related issue #4859. Trace the existing :e completion and remote-file handling before checking how workspace, active-editor, untitled, and Windows paths are resolved. Done means the listed local and remote cases work, and extension auto-completion is no longer added by :e.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.