Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please use vscode's config folder for .cmdline_history #2799

Closed
jleclanche opened this issue Jul 1, 2018 · 13 comments
Closed

Please use vscode's config folder for .cmdline_history #2799

jleclanche opened this issue Jul 1, 2018 · 13 comments

Comments

@jleclanche
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Enhancement

  • Extension (VsCodeVim) version: 0.14.1
  • VSCode version: 1.24.1
  • OS version: Arch Linux

vscode-vim has recently started creating a ~/.VSCodeVim folder in $HOME, which pollutes the home dir :(

There already is a config folder for vscode in $XDG_CONFIG_HOME/Code. Can you move that folder there instead please?

@xconverge
Copy link
Member

@jpoon Do you know where we are "supposed" to put this stuff?

I am able to get the path in .vscode/extension/vscodevim with exposed APIs and can put it there....

@jpoon
Copy link
Member

jpoon commented Jul 2, 2018

My vote is for .vscode/extension/vscodevim.

@jleclanche
Copy link
Author

Please don't use ~/.vscode either as it doesn't respect XDG. The vscode config is split right now and the "correct" one is in the XDG dir. Also see: microsoft/vscode#3884

@xconverge
Copy link
Member

We will not be hardcoding it, we will be using an API provided by vscode to get the working directory for the extension that is installed. So for now, that would be .vscode/extension/vscodevim but as soon as the issue you linked is executed upon, we would be placing the file in the new location automatically

@yanoryuichi
Copy link

Please use %AppData% in Windows. Configuration files should not be stored in %UserProfile% in Windows.

@dsifford
Copy link

How can we disable history from being saved and this directory and file from being created for the time being?

Setting vim.history: 0 doesn't seem to cut it.

@xconverge
Copy link
Member

No one has suggested a folder that other people havent disagreed with so I am a bit stuck here... I can implement it for the next release if we can agree on a location

@jleclanche
Copy link
Author

I guess to be clean this would be blocked by microsoft/vscode#2741 ?

@dsifford
Copy link

@xconverge Speaking about specifically the ~/.VSCodeVim/.cmdline_history file (which seems like the only file that is currently being added into the ~/.VSCodeVim directory:

The canonical location for Mac and Linux systems I think would be ~/.cache/VSCodeVim/cmdline_history (AKA $XDG_CACHE_HOME/VSCodeVim/cmdline_history).

As an aside: I'd also personally prefer the directory to be completely lowercase with optional word hyphenation, rather than pascal case since sorting will be a bit more sane. (so, vscodevim or vscode-vim rather than VSCodeVim)

@yanoryuichi
Copy link

@xconverge
Copy link
Member

Ok I think XDG_CACHE_HOME or LOCALAPPDATA for windows will keep everyone happy for now.

If anything fails, it falls back to the current location (home directory). On my mac I didn't have XDG_CACHE_HOME set for example so it used the home directory still.

How does that sound?

@dsifford
Copy link

dsifford commented Jul 25, 2018

That works for me since I have that explicitly set, but it's technically non-compliant to the specification, since it should automatically fall back to ~/.cache/<app_name>/ if XDG_CACHE_HOME is not set.

Just throwing that out there for completeness. If this is just a temporary solution until a better one can be made, that's totally fine.

@xconverge
Copy link
Member

Ok I decided to use a library for now, just tested it on 3 platforms with these results:

Windows:
C:\Users\xxxxx\AppData\Local\VSCodeVim\VSCodeVim\Cache

MacOS:
/Users/xxxxx/Library/Caches/VSCodeVim

Linux:
/home/xxxxx/.cache/VSCodeVim

This issue will be closed and I will push a release. Please let me know if something still doesn't seem right once you start using the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants