Skip to content

Iooon/wezterm-default-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

WezTerm Default Config and Key Bindings Generator

This repository contains a default configuration file for the WezTerm terminal and a Python script to automatically generate a the wezterm.lua config file by fetching and parsing the default key bindings from the official WezTerm GitHub page.

Project Structure

  • wezterm.lua: The default configuration file for WezTerm.
  • script/get_config.py: A Python script that fetches the default key bindings from WezTerm's GitHub repository, parses them, and generates a wezterm.lua configuration file.

Configuration

  1. Clone the repository:
    git clone https://github.com/Iooon/wezterm-default-config.git
  2. Once generated, you can move the wezterm.lua file to your WezTerm configuration directory (~/.config/wezterm/ for Linux/macOS or in the same directory as the wezterm.exe for Windows). For more information about the configuration check here.

Or alternativly

  1. Backup your configuration

    mv ~/.config/wezterm{,.bak}
  2. Clone the config

    git clone https://github.com/Iooon/wezterm-default-config.git ~/.config/wezterm

Configuration Details

The configuratio file disables the default key bindings by setting config.disable_default_key_bindings = true. This allows to customize the key bindings as needed in the generated config. Example of the configuration file:

-- Disable default key bindings and allow custom bindings
config.disable_default_key_bindings = true

-- Custom key bindings can be added here, for example:
config.keys = {
    { key="C", mods="CTRL", action=wezterm.action.CopyTo("Clipboard") },
    { key="V", mods="CTRL", action=wezterm.action.PasteFrom("Clipboard") },
    -- Add more custom key bindings here
}

This allows you to customize your key bindings while ensuring that the default bindings do not conflict with your custom configuration.

About the script

  1. Run the Python script to generate the WezTerm config file:

    python3 get_config.py

    This will:

    • The script uses the requests library to download the markdown file from the WezTerm GitHub repository containing the default key bindings.
    • It then uses the re (regex) module to extract key bindings in the format of the table from the markdown file.
    • The key bindings are then transformed into Lua configuration format and written to a new wezterm.lua file.

Acknowledgments

  • Thanks to the WezTerm project for their amazing terminal emulator.
  • This project leverages the WezTerm community and documentation to automate the generation of configuration files.

Feel free to contribute to this repository by submitting issues or pull requests to improve the functionality or add new features!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published