conf.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. kitty.conf
  2. ================
  3. .. highlight:: conf
  4. .. only:: man
  5. Overview
  6. --------------
  7. |kitty| is highly customizable, everything from keyboard shortcuts, to rendering
  8. frames-per-second. See below for an overview of all customization possibilities.
  9. You can open the config file within |kitty| by pressing :sc:`edit_config_file`
  10. (:kbd:`⌘+,` on macOS). A :file:`kitty.conf` with commented default
  11. configurations and descriptions will be created if the file does not exist.
  12. You can reload the config file within |kitty| by pressing
  13. :sc:`reload_config_file` (:kbd:`⌃+⌘+,` on macOS) or sending |kitty| the
  14. ``SIGUSR1`` signal with ``kill -SIGUSR1 $KITTY_PID``. You can also display the
  15. current configuration by pressing :sc:`debug_config` (:kbd:`⌥+⌘+,` on macOS).
  16. .. _confloc:
  17. |kitty| looks for a config file in the OS config directories (usually
  18. :file:`~/.config/kitty/kitty.conf`) but you can pass a specific path via the
  19. :option:`kitty --config` option or use the :envvar:`KITTY_CONFIG_DIRECTORY`
  20. environment variable. See :option:`kitty --config` for full details.
  21. **Comments** can be added to the config file as lines starting with the ``#``
  22. character. This works only if the ``#`` character is the first character in the
  23. line.
  24. **Lines can be split** by starting the next line with the ``\`` character.
  25. All leading whitespace and the ``\`` character are removed.
  26. .. _include:
  27. You can **include secondary config files** via the :code:`include` directive. If
  28. you use a relative path for :code:`include`, it is resolved with respect to the
  29. location of the current config file. Note that environment variables are
  30. expanded, so :code:`${USER}.conf` becomes :file:`name.conf` if
  31. :code:`USER=name`. A special environment variable :envvar:`KITTY_OS` is available,
  32. to detect the operating system. It is ``linux``, ``macos`` or ``bsd``.
  33. Also, you can use :code:`globinclude` to include files
  34. matching a shell glob pattern and :code:`envinclude` to include configuration
  35. from environment variables. For example::
  36. include other.conf
  37. # Include *.conf files from all subdirs of kitty.d inside the kitty config dir
  38. globinclude kitty.d/**/*.conf
  39. # Include the *contents* of all env vars starting with KITTY_CONF_
  40. envinclude KITTY_CONF_*
  41. .. note:: Syntax highlighting for :file:`kitty.conf` in vim is available via
  42. `vim-kitty <https://github.com/fladson/vim-kitty>`__.
  43. .. include:: /generated/conf-kitty.rst
  44. Sample kitty.conf
  45. --------------------
  46. .. only:: html
  47. You can download a sample :file:`kitty.conf` file with all default settings
  48. and comments describing each setting by clicking: :download:`sample
  49. kitty.conf </generated/conf/kitty.conf>`.
  50. .. only:: man
  51. You can edit a fully commented sample kitty.conf by pressing the
  52. :sc:`edit_config_file` shortcut in kitty. This will generate a config file
  53. with full documentation and all settings commented out. If you have a
  54. pre-existing :file:`kitty.conf`, then that will be used instead, delete it to
  55. see the sample file.
  56. A default configuration file can also be generated by running::
  57. kitty +runpy 'from kitty.config import *; print(commented_out_default_config())'
  58. This will print the commented out default config file to :file:`STDOUT`.
  59. All mappable actions
  60. ------------------------
  61. See the :doc:`list of all the things you can make |kitty| can do </actions>`.
  62. .. toctree::
  63. :hidden:
  64. actions