Skip to content

XDG directory support & Tmux errors #15

@olbrew

Description

@olbrew

First of all I would like to thank you for your work! I have long been looking for some sane session management in vim and your plugin is the best option I have found so far. Unfortunately I have found some bugs though. I've been trying at fixing them myself but since I don't know any viml this would be non-trivial for me. I'll just list them here in one list but if you want me to split them up in more scoped bugs I'd be happy to do that too.

  1. It works with Neovim but the sessions dir is hardcoded to ~/.vim directory on *nix systems.
    Neovim uses the xdg default of ~/.config/nvim so it would be great to use that directory when neovim is detected.
  2. When I then tried the option for setting an absolute path with let g:gitsessions_dir = '/absolute/path/' to let g:gitsessions_dir = '~/.config/nvim/sessions/' it didn't work either.
    It looks like the ~ is not properly expanded or escaped because the sessions directory will again be created under .vim with an empty ~ directory.
    Setting the complete path with /Users/username/... works but using ~ is easier and a habit for many people.

Porting the tmux issue into a separate ticket: #19

3. When saving form inside a Tmux session the session file gets a faulty name. In my case: ?Ptmux\;\e\e\]50\;CursorShape=0\cg\emaster. The contents of the file look good but it cannot be loaded afterwards because of the faulty filename.

I think a hashing strategy would fix or avoid some of these errors and also avoid some of the overhead of creating all the shadow directories in the sessions dir.
For example:

if git:
    session_string = fully_qualified_path + git_branch_name
else:
    session_string = fully_qualified_path

session_hash = hash(unique_session_string)

function save(session_hash):
    write(sessions_dir/session_has.vim)

function restore(session_hash):
    read(sessions_dir/session_has.vim)

What do you think? I don't know if this is even possible in viml but I think this would definitely solve some problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions