VSCodeVim / VSCodeVim/Vim

Home directory `~` not expanded in command mode

Open
#4,703 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/commandline kind/bug system/mac
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug

pwd
/Users/zach/Projects

I enter command mode and tabedit a file :tabedit ~/.bashrc for example. The output is

Unable to open '.bashrc': Unable to read file '/Users/zach/Projects/~/.bashrc' (Error: Unable to resolve non-existing file '/Users/zach/Projects/~/.bashrc').

Another bug is if I have the directory /Users/zach/Projects/test-project and run :tabedit test-pr<tab> a tab is inserted where my cursor was in the file instead of the expected behavior of auto-completing test-project.

I believe these issues are caused by the same thing.

To Reproduce
Steps to reproduce the behavior:
Open a file and attempt to tabedit open some other file. Also try opening a file with ~

Expected behavior
I expect ~/.bashrc to be opened in the first case and test-project to be auto completed without any tabs inserted in my file in the second case.

Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.13.1
  • VSCode version: 1.43.2
  • OS: OSX Catalina 10.15.3

Additional context
Add any other context about the problem here.

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

Reproduce the issue in command mode with :tabedit ~/.bashrc and with filename completion such as :tabedit test-pr<Tab>. Trace the command-mode handling for path expansion and completion, then verify that ~/.bashrc opens from the home directory and completion does not insert a tab into the edited file.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.