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

'viewdir' doesn't work by default after migration to XDG_BASE_DIR #14680

Closed
returnDanilo opened this issue May 1, 2024 · 0 comments
Closed
Labels

Comments

@returnDanilo
Copy link

Steps to reproduce

First, verify normal behavior(that is, without patch 9.1.0327):

  1. Put viewoptions=cursors in your vimrc.
  2. Open a file.
  3. Scroll down a bit to change cursor position.
  4. Close the file.
  5. Open the same file.
  6. Notice how the cursor position was remembered as intended.

Now, using a build which includes patch 9.1.0327:

  1. Move your ~/.vim directory under ~/.config.
  2. Put viewoptions=cursors in ~/.config/vim/vimrc.
  3. Open a file
  4. Scroll down a bit to change cursor position.
  5. Close the file.
  6. Open the same file.
  7. Notice how the cursors position is not remembered: It always starts at line 1.

To get the old behavior, one has to change the viewdir value to, for example, ~/.config/vim/view.

Note: If a ~/.vim directory exists, even if empty, the cursor position will be correctly remembered, but the view file will be created under this directory instead; thus not respecting the xdg base dir set.

Related to: #14182

Expected behaviour

Expected for vim to continue working normally, without further tweaks, after moving .vim to .config.

Alternatively, expected viewdir option to default to using an XDG_BASE_DIR-friendly value if other options(such as rtp) are set to follow the XDG_BASE_DIR.

Version of Vim

9.1 Included patches: 1-384

Environment

OS: Linux

Logs and stack traces

No response

chrisbra added a commit to chrisbra/vim that referenced this issue May 2, 2024
Problem:  'viewdir' not respecting $XDG_CONFIG_HOME
          (Danilo Rezende, after v9.1.327)
Solution: adjust 'viewdir' option when enabling XDG config mode

fixes: vim#14680

Signed-off-by: Christian Brabandt <[email protected]>
chrisbra added a commit to chrisbra/vim that referenced this issue May 2, 2024
Problem:  'viewdir' not respecting $XDG_CONFIG_HOME
          (Danilo Rezende, after v9.1.327)
Solution: adjust 'viewdir' option when enabling XDG config mode

fixes: vim#14680

Signed-off-by: Christian Brabandt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant