thaerkh / vim-workspace

📑 Automated Vim session management with file auto-save and persistent undo history
Apache License 2.0
466 stars 30 forks source link

Allow saving session files in a single directory #18

Closed snaveevans closed 5 years ago

snaveevans commented 6 years ago

I didn't like having another file in my workspace directory and thought I'd try modifying a plugin for the first time (very new to VIM and VIM's plugins).

thaerkh commented 6 years ago

Hi there,

I'm happy that your first plugin contribution was this one! This is a reasonable addition, it can go with the support for external .undodir paths, allowing for people to either use everything either locally (with local/global gitignore settings) or globally.

Couple requests before merging this: 1) To maintain homogeneous indentation using spaces instead of tab characters 2) To remove l:sessionDirectory in line 24 since you're already using an unaltered g:workspace_session_directory within s:GetSessionDirectoryPath(). For example, lines 28-31 could be replaced with return g:workspace_session_directory . substitute(getcwd(), "/", '%', "g") ('%' instead of '-' because undodir filename paths have this convention)

Thanks in advance, Thaer

snaveevans commented 6 years ago

Sure thing, been busy with other things, but I'll make those changes when I get a chance.

williamwu2k12 commented 5 years ago

This looks great @snaveevans! What do you think about this functionality for undo history also?

snaveevans commented 5 years ago

@thaerkh I apologize for the test escape function commit, it didn't work the way I thought it would, had to use escapes to get the % to work properly, but now it works.

thaerkh commented 5 years ago

No worries I'll squash the commits - looks great, thanks @snaveevans!