Vim: Please use vscode's config folder for .cmdline_history

Created on 1 Jul 2018  路  13Comments  路  Source: VSCodeVim/Vim

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?

good first issue help wanted kinenhancement sizXS

Most helpful comment

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: https://github.com/Microsoft/vscode/issues/3884

All 13 comments

@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....

My vote is for .vscode/extension/vscodevim.

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: https://github.com/Microsoft/vscode/issues/3884

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

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

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.

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

I guess to be clean this would be blocked by https://github.com/Microsoft/vscode/issues/2741 ?

@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)

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?

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// 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.

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

triztian picture triztian  路  3Comments

jaredly picture jaredly  路  3Comments

ghost picture ghost  路  3Comments

Jimmy-Z picture Jimmy-Z  路  3Comments

elithrar picture elithrar  路  3Comments