{"id":13898280,"url":"https://github.com/thaerkh/vim-workspace","last_synced_at":"2025-07-17T15:32:53.006Z","repository":{"id":45863473,"uuid":"77312894","full_name":"thaerkh/vim-workspace","owner":"thaerkh","description":"📑 Automated Vim session management with file auto-save and persistent undo history","archived":true,"fork":false,"pushed_at":"2023-05-29T04:02:21.000Z","size":5340,"stargazers_count":467,"open_issues_count":25,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-07T18:45:50.770Z","etag":null,"topics":["autosave","session","session-management","session-manager","trailing-spaces","vim","vim-session","workspace"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thaerkh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-25T05:58:12.000Z","updated_at":"2024-07-08T23:47:28.000Z","dependencies_parsed_at":"2024-01-17T16:08:39.581Z","dependency_job_id":"75bff578-8971-4fc7-991d-13cc5e2e2b37","html_url":"https://github.com/thaerkh/vim-workspace","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaerkh%2Fvim-workspace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaerkh%2Fvim-workspace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaerkh%2Fvim-workspace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaerkh%2Fvim-workspace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thaerkh","download_url":"https://codeload.github.com/thaerkh/vim-workspace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226274740,"owners_count":17598860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autosave","session","session-management","session-manager","trailing-spaces","vim","vim-session","workspace"],"created_at":"2024-08-06T18:04:12.376Z","updated_at":"2024-11-25T04:31:06.216Z","avatar_url":"https://github.com/thaerkh.png","language":"Vim Script","funding_links":[],"categories":["Vim script","Vim Script"],"sub_categories":[],"readme":"```diff\n- Note: This plugin is considered feature complete, and is no longer being maintained.\n```\n```vim\n\" Feel free to use this alternative to the plugin's core autosave and session management features:\n\n\" Autosave\nset noswapfile\nau BufLeave,CursorHold,FocusLost * if(getbufinfo('%')[0].changed) | do BufWritePre | sil! up | do BufWritePost | endif\n\n\" Autosession\nau VimEnter * nested if (len(v:argv) == 1) | silent! source Session.vim | endif\nau VimLeave * if (len(v:argv) == 1) | mksession! | endif\n\" available since v8.1.2233 (2019-10-28), v:argv doubles for both stdin and argful cases (instead of argc() and a StdinReadPre autocmd flag)\n\" v:argv length check may need to be 2 if using Neovim since it includes an --embed argument on launch\n```\n---\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/thaerkh/vim-workspace/master/wiki/screenshots/logo.png\" height=\"220\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/thaerkh/vim-workspace/master/wiki/screenshots/demo.gif\" \u003e\n\u003c/p\u003e\n\n# Features\n\n## Workspace Sessions\n\n#### Persistent Vim Session\n\nSession tracking can be activated automatically (disabled by default):\n```\nlet g:workspace_autocreate = 1\n```\n\nToggling the `ToggleWorkspace` command on will persistently track your session found in a current working directory, and all workspace features will be enabled. Conversely, toggling the command off will remove the session and disable the workspace features.\n\nIf Vim is run with a file argument and it's already in the session's workspace, Vim will load the session and go to the tab window that contains it. Otherwise, it will be loaded as a new tab in the session. If you would rather create a new buffer in the existing tab instead of creating a new tab:\n```\nlet g:workspace_create_new_tabs = 0  \" enabled = 1 (default), disabled = 0\n```\n\nIt is recommended you bind this command to a convenient shortcut, such as the following:\n```\nnnoremap \u003cleader\u003es :ToggleWorkspace\u003cCR\u003e\n```\nThe following default can be configured if you wish to change the session name:\n```\nlet g:workspace_session_name = 'Session.vim'\n```\n\nUse `g:workspace_session_directory` to save all your session files in a single directory outside of your workspace. Example:\n```\nlet g:workspace_session_directory = $HOME . '/.vim/sessions/'\n```\nNote: this will use the workspace directory as the session file name, overriding `g:workspace_sesssion_name`.\n\nIf you'd like sessions to not load if you're explicitly loading a file in a workspace directory (as opposed to an argument-less `vim`), the following in your vimrc will provide that behaviour:\n```\nlet g:workspace_session_disable_on_args = 1\n```\n\n#### Hidden Buffers\nOver time, hidden buffers can build up to a point where most are unnecessary, with only those currently tied to a tab window being important.\nWhen called, the command `CloseHiddenBuffers` will close any hidden buffers meeting this criteria.\n\n#### Undo History\n\nWhen in a workspace, file undo history is persisted between sessions, without needing to keep Vim on. Cursor positions will also persist across session reloads.\n\nThe following defaults can be configured if you wish to change feature behaviour:\n```\nlet g:workspace_persist_undo_history = 1  \" enabled = 1 (default), disabled = 0\nlet g:workspace_undodir='.undodir'\n```\n\n#### Omni Completion\nPreview windows will close on InsertLeave, to mitigate the default behaviour of being an orphaned window.\n\n## Autosave\nFiles edited in a workspace session will autosave on InsertLeave, idle (CursorHold), pane switches (FocusLost and FocusGained), or buffer switches (BufLeave).\n\nFocusLost and FocusGained triggers will typically trigger only with GUI versions of Vim. However, there are plugins that enables these for the console version within Tmux (i.e. sjl/vitality.vim).\n\nThis autosave feature enforces a last writer wins policy (eventual consistency).\n\nYou can manually enable the autosave feature outside of a workspace session with the `ToggleAutosave` command.\n\nIf you would like autosave to be always on, even outside of a session, add the following to your vimrc:\n```\nlet g:workspace_autosave_always = 1\n```\n\nIf you would like to disable autosave for some reason (i.e. too much IO on disk), it can be disabled as shown here:\n```\nlet g:workspace_autosave = 0\n```\n\n#### Untrailing Spaces \u0026 Untrailing Tabs\nBy default, all trailing spaces and tabs are trimmed before a buffer is autosaved. If you don't prefer this behaviour, add this line:\n```\nlet g:workspace_autosave_untrailspaces = 0\nlet g:workspace_autosave_untrailtabs = 0\n```\n\n#### Ignore List\nGit commit filetypes won't autosave (or trim trailing spaces) by default. You can customize the ignore list with this line:\n```\nlet g:workspace_autosave_ignore = ['gitcommit']\n```\n\n## Indent Guides\nThis feature has been moved to its own plugin [vim-indentguides](https://github.com/thaerkh/vim-indentguides).\n\n# Installation\nThis plugin requires Vim 8.0, follows the standard runtime path structure, and can be installed with a variety of plugin managers.\n### Using Plug\nPaste the following in your `~/.vimrc` file:\n```\nif empty(glob('~/.vim/autoload/plug.vim'))\n  silent execute \"!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\"\n  autocmd VimEnter * PlugInstall | source $MYVIMRC\nendif\n\ncall plug#begin('~/.vim/plugged')\nPlug 'thaerkh/vim-workspace'\ncall plug#end()\n```\nIf you don't already have Plug, this will auto-download Plug for you and install the workspace plugin.\n\nIf you already have Plug, simply paste `Plug 'thaerkh/vim-workspace'` and call `:PlugInstall` to install the plugin.\n\nRemember to `:PlugUpdate` often to get all the latest features and bug fixes!\n### Using Vundle\nPaste this in your `~./vimrc`:\n```\nPlugin 'thaerkh/vim-workspace'\n```\n### Using Pathogen\ncd into your bundle path and clone the repo:\n```\ncd ~/.vim/bundle\ngit clone https://github.com/thaerkh/vim-workspace\n```\n\n# License\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaerkh%2Fvim-workspace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthaerkh%2Fvim-workspace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaerkh%2Fvim-workspace/lists"}