talonhub/community

Please provide a way to change settings without modifying the repository

jaresty opened this issue · 14 comments

Currently, the talon settings file is committed to this repository. If I want to change those settings that are committed to the repository I need to deal with uncommitted changes or maintain my own branch. Some options that could work:

  • don't commit the settings at all (provide an example instead)
  • clearly document how to override settings using your own file that is more specific
  • instead of configuring settings in the configuration file, set the defaults in code

A fourth option (which I currently use) is to maintain your own .talon Git repository, put almost everything but the user directory into .gitignore, and add community as a Git submodule (along with other plugins like cursorless). Then, to override stuff from community:

  • to customize CSV files: add a community-settings directory (as shown below) and link to it with
    rm -rf user/community/settings
    ln -s ../community-settings user/community/settings
    
    so community can find it. This emulates the approach cursorless uses out of the box.
    grafik
  • to customize settings: just add a .talon file (like the one below) including your overridden settings. The key is to make sure that this is loaded after the community repository, for example by putting it into a directory starting with d (which comes after community lexicographically).
    settings():
        user.mouse_enable_pop_click = 2
        user.mouse_hide_mouse_gui = 1
    
    tag(): user.prefixed_numbers
    

This has the added benefit that you can control (using Git submodule commands) the versions of community and other plugins (e.g., to update to new versions without tedious merging or to roll back undesired changes). Also, setting up talon on another computer is now a simple git clone --recursive and creating the symbolic link as shown above.

I've been told that the trick with talon files is that more specific matching always wins. You can override the settings file by adding a more specific tag. There is also an open pull request which changes many settings to talon list files that can be overridden #1382

I think there are various ways of solving this problem and this is evidence that this is a real issue for some.

Adding some documentation to the README to explain how to use the talon list files to override things such as modifier keys (#1477)

I also added a pull request to the contributing guidelines to suggest a way to provide settings that will be a little more friendly to folks who are not forking the community repository: #1482