macvim-dev / macvim-dev/macvim

Feature request: reopen files on launch

Open
#102 29 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

I'm really enjoying using MacVim – however one feature that I really miss from Sublime Text is the ability for the editor to automatically reopen whatever files were open when it last exited. Do you know if there are any plans to add this behavior to MacVim?

I'm guessing the simplest way to achieve this would be to store the arglist of each active vim process (i.e. one arglist per GUI window) on quit, and then on startup you could automatically spawn a new GUI window for each of these stored arglists – but then again I'm quite new to Vim and I don't know anything about the internals of MacVim so this could be a terrible approach :)

N.B. I'm not talking about restoring the full session state (tabs/splits/etc), seeing as that can easily be accomplished with autocommand-triggered user scripts via :mksession and :source. The missing piece of the puzzle seems to be automatically spawning the vim instances with the correct arglist in the first place…

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing MacVim's launch and quit behavior, then inspect how each GUI window's arglist could be preserved and restored. Compare the requested behavior with the issue's existing :mksession and :source workaround. Done means previously open files are reopened in the appropriate GUI windows without requiring full session restoration.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.