nchudleigh / vimac

Productive macOS keyboard-driven navigation
https://vimacapp.com
GNU General Public License v3.0
3.38k stars 124 forks source link

Add a config file that is easily saveable to dotfiles #447

Open gibfahn opened 2 years ago

gibfahn commented 2 years ago

Currently if I want to save my config, I can go symlink ~/Library/Preferences/dexterleng.vimac.plist into my dotfiles repo, however there are two issues with this:

  1. On startup, if the file is a symlink, Vimac deletes the symlink and creates a new file, so any changes I make in Vimac aren't persisted.
  2. the defaults file includes the SULastCheckTime, which means it changes on every launch, polluting git history.

Current file looks something like this:

{
    "HintCharacters" => "tnseriaodhplfuwyq;gjvmc,x.z/bk4738291056"
    "hintModeActivationCount" => 5
    "HintModeShortcut" => {length = 257, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 000000c7 }
    "holdSpaceHintModeActivationEnabled" => 0
    "NSWindow Frame com.sindresorhus.Preferences.FrameAutosaveName" => "000 000 000 000 0 0 0000 0000 "
    "ScrollCharacters" => "h,n,e,i,d,u,G,gg"
    "ScrollModeShortcut" => {length = 257, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 000000c7 }
    "ScrollSensitivity" => 49
    "SUHasLaunchedBefore" => 1
    "SULastCheckTime" => 2021-08-05 10:44:43 +0000
    "SULastProfileSubmissionDate" => 2021-08-05 10:44:42 +0000
    "SUSendProfileInfo" => 1
}

Today you can use defaults write for most things, e.g.:

defaults write dexterleng.vimac.plist holdSpaceHintModeActivationEnabled -bool true

which is probably a reasonable alternative, although persisting still has to be done manually.

But that gets a bit harder with HintModeShortcut and ScrollModeShortcut, which are of type data.