{"id":16811666,"url":"https://github.com/philrunninger/vim-sessions","last_synced_at":"2026-01-04T05:02:34.176Z","repository":{"id":83800856,"uuid":"106681544","full_name":"PhilRunninger/vim-sessions","owner":"PhilRunninger","description":"A simple Vim session manager","archived":false,"fork":false,"pushed_at":"2023-12-21T16:22:20.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-22T00:00:42.586Z","etag":null,"topics":["sessions","vim-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilRunninger.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,"dei":null}},"created_at":"2017-10-12T11:02:03.000Z","updated_at":"2024-04-15T15:48:45.402Z","dependencies_parsed_at":null,"dependency_job_id":"bfbcd6d6-7cb1-444e-8637-0fbeef2ba5e1","html_url":"https://github.com/PhilRunninger/vim-sessions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRunninger%2Fvim-sessions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRunninger%2Fvim-sessions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRunninger%2Fvim-sessions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilRunninger%2Fvim-sessions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilRunninger","download_url":"https://codeload.github.com/PhilRunninger/vim-sessions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244021480,"owners_count":20385122,"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":["sessions","vim-plugin"],"created_at":"2024-10-13T10:19:24.077Z","updated_at":"2026-01-04T05:02:29.148Z","avatar_url":"https://github.com/PhilRunninger.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-sessions\n## Intro\nThis simple **vim** session manager looks for a `.session.vim` file in the current or closest parent directory. On startup, if one is found, the user is asked whether it should be opened. The plugin will continue asking until a 'Yes' answer is given, or no more `.session.vim` files are found. If a session is being used, it is saved automatically when exiting **vim**.\n\n## Installation\n\nUse your favorite plugin manager. If you don't have one, try one of these: [vim-pathogen](https://github.com/tpope/vim-pathogen), [vim-plug](https://github.com/junegunn/vim-plug), [Packer.nvim](https://github.com/wbthomason/packer.nvim) or [lazy.nvim](https://github.com/folke/lazy.nvim). Alternatively, you can use packages and submodules, as Greg Hurrell ([@wincent](https://github.com/wincent)) describes in his excellent Youtube video: [Vim screencast #75: Plugin managers](https://www.youtube.com/watch?v=X2_R3uxDN6g)\n\n## Commands\nThere are four commands defined by this plugin:\n* `:OpenSession` does the same search for a session file that is done at startup.\n* `:SaveSession` creates a new `.session.vim` file in the current working directory, or rewrites the active session file.\n* `:CloseSession` stops associating the current session with the `.session.vim` file. All buffers remain open.\n* `:DeleteSession` closes the session (`:CloseSession`) and deletes the `.session.vim` file.\n\n## Customization\nAll customizations are done through a single dictionary variable. This is a change from the prior variables, which are now deprecated: `g:sessionAskOnStartup` and `g:sessionConfirmQuit`. The dictionary looks like this one, which shows the default values:\n\n```vim\n\" vimscript\nlet g:SessionsSetup = {\n    \\ 'askOnStartup':      1,\n    \\ 'normalBuffersOnly': 0,\n    \\ 'excludedFileTypes': [],\n    \\ 'confirmQuit':       1\n\\ }\n```\n```lua\n-- lua\nvim.g.SessionsSetup = {\n    askOnStartup =      1,\n    normalBuffersOnly = 0,\n    excludedFileTypes = {},\n    confirmQuit =       1\n\\ }\n```\n\nYou need not specify all keys in your `.vimrc`, just the ones you want to override. Each key's purpose is detailed below:\n\n### `askOnStartup: \u003cboolean\u003e`\nBy default, starting vim with no file specified on the command-line will cause the plugin to search for session files. To disable this function, use `'askOnStartup': 0`.\n\n### `normalBuffersOnly: \u003cboolean\u003e`\nVim will save some non-normal buffers (see `:h 'buftype'`) in session files, and provides no option to do otherwise. When these are restored, they become empty buffers. To keep only normal buffers (ones with `\u0026buftype == \"\"`) in your session file, use `'normalBuffersOnly': 1`.\n\n### `excludedFileTypes: \u003clist of filetypes\u003e`\nBuffers of specified filetypes can be excluded from the session file. The list must contain filetypes, not file extensions, for example: `excludedFileTypes: ['markdown','vim']`. **Note:** this and the `normalBuffersOnly` setting take effect only when exiting vim, not when using the `:SaveSession` command.\n\n### `confirmQuit: \u003cboolean\u003e`\nThis plugin modifies the `:q` command to prevent unwanted alteration of your window layout. It will ask:\n```\nQuit all windows and tabs?\n[Y]es, (N)o, (C)ancel:\n```\n\n*Yes* closes all buffers and exits **vim**, *No* closes the current window, and *Cancel* does nothing. To avoid this prompt, use `:quit`, \u003ckbd\u003eCtrl-W\u003c/kbd\u003e\u003ckbd\u003ec\u003c/kbd\u003e, or `:qa`. Use `confirmQuit: 0` to disable this feature.\n\n## Status Line\nThe `SessionNameStatusLineFlag()` function returns the name of the current session, or an empty string if no session is being used. The session's name is the subdirectory in which the active `.session.vim` file exists. Use a statement like this one to display it in the statusline:\n```vim\n\" vimscript\nset statusline+=%{SessionNameStatusLineFlag()}\n```\n```lua\n-- lua\nvim.opt.statusline:append('%{SessionNameStatusLineFlag()}')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilrunninger%2Fvim-sessions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilrunninger%2Fvim-sessions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilrunninger%2Fvim-sessions/lists"}