Pular para o conteúdo

Kitty Cheat Sheet

Overview

Kitty is a fast, feature-rich, GPU-accelerated terminal emulator written in C and Python. It offloads rendering to the GPU using OpenGL, resulting in extremely smooth scrolling and low input latency. Kitty supports modern terminal features including true color, ligatures, Unicode, image display (via its graphics protocol), tabs, window splits, and remote control.

Kitty is cross-platform (Linux, macOS) and highly extensible through “kittens” — small Python programs that add functionality like SSH integration, diff viewing, Unicode input, and clipboard management. Its configuration is file-based with no GUI settings, making it ideal for developers who prefer text-based configuration.

Installation

# macOS
brew install --cask kitty

# Linux (binary installer)
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin

# Ubuntu/Debian
sudo apt install kitty

# Arch Linux
sudo pacman -S kitty

# Fedora
sudo dnf install kitty

# Add to PATH (Linux binary install)
ln -sf ~/.local/kitty.app/bin/kitty ~/.local/bin/
ln -sf ~/.local/kitty.app/bin/kitten ~/.local/bin/

# Verify
kitty --version

Key Bindings

Window Management

ShortcutAction
Ctrl+Shift+EnterNew window (split)
Ctrl+Shift+NNew OS window
Ctrl+Shift+WClose window
Ctrl+Shift+]Next window
Ctrl+Shift+[Previous window
Ctrl+Shift+FMove window forward
Ctrl+Shift+BMove window backward
Ctrl+Shift+RResize window mode
Ctrl+Shift+LNext layout
Ctrl+Shift+1-9Switch to window N

Tab Management

ShortcutAction
Ctrl+Shift+TNew tab
Ctrl+Shift+QClose tab
Ctrl+Shift+RightNext tab
Ctrl+Shift+LeftPrevious tab
Ctrl+Shift+.Move tab forward
Ctrl+Shift+,Move tab backward
Ctrl+Shift+Alt+TSet tab title

Scrolling and Clipboard

ShortcutAction
Ctrl+Shift+UpScroll up
Ctrl+Shift+DownScroll down
Ctrl+Shift+Page_UpScroll page up
Ctrl+Shift+Page_DownScroll page down
Ctrl+Shift+HomeScroll to top
Ctrl+Shift+EndScroll to bottom
Ctrl+Shift+HBrowse scrollback in pager
Ctrl+Shift+CCopy to clipboard
Ctrl+Shift+VPaste from clipboard
Ctrl+Shift+SPaste from selection

Font Size

ShortcutAction
Ctrl+Shift+EqualIncrease font size
Ctrl+Shift+MinusDecrease font size
Ctrl+Shift+BackspaceReset font size

Configuration

# Config file location
# Linux: ~/.config/kitty/kitty.conf
# macOS: ~/Library/Preferences/kitty/kitty.conf

# Generate default config
kitty +runpy "from kitty.options.definition import *; print(option_spec())" > ~/.config/kitty/kitty.conf
# ~/.config/kitty/kitty.conf

# Font settings
font_family      JetBrains Mono
bold_font        auto
italic_font      auto
bold_italic_font auto
font_size        13.0
disable_ligatures never

# Cursor
cursor_shape beam
cursor_blink_interval 0.5
cursor_stop_blinking_after 15.0

# Scrollback
scrollback_lines 10000
scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER

# Mouse
copy_on_select clipboard
mouse_map left click ungrabbed mouse_handle_click selection link prompt
strip_trailing_spaces smart

# Performance
repaint_delay 10
input_delay 3
sync_to_monitor yes

# Window layout
remember_window_size  yes
initial_window_width  120c
initial_window_height 35c
window_padding_width  4
window_margin_width   0
enabled_layouts       tall,fat,grid,splits,stack

# Tab bar
tab_bar_style         powerline
tab_powerline_style   slanted
tab_bar_min_tabs      2
tab_title_template    "{index}: {title}"

# Color scheme
background #1e1e2e
foreground #cdd6f4
selection_background #585b70
selection_foreground #cdd6f4
cursor #f5e0dc

# Bell
enable_audio_bell no
visual_bell_duration 0.1

# URLs
url_style curly
detect_urls yes
open_url_with default

# macOS specific
macos_option_as_alt yes
macos_titlebar_color background

Kittens (Built-in Tools)

# SSH kitten (replaces ssh with improved terminal features)
kitten ssh user@server

# Diff kitten
kitten diff file1.txt file2.txt
kitten diff dir1/ dir2/

# Unicode input
# Press Ctrl+Shift+U in terminal

# Clipboard kitten
echo "text" | kitten clipboard
kitten clipboard --get-clipboard

# Image display (icat)
kitten icat image.png
kitten icat --place 80x24@0x0 image.png

# Transfer files (via SSH)
kitten transfer file.txt remote:~/file.txt

# Themes
kitten themes
kitten themes --reload-in=all Catppuccin-Mocha

# Hints (extract URLs, paths, etc.)
# Ctrl+Shift+E to open URLs
# Ctrl+Shift+P>F to insert file path
# Ctrl+Shift+P>H to insert line from scrollback

Remote Control

# Enable remote control in kitty.conf
allow_remote_control yes
listen_on unix:/tmp/kitty
# Control kitty from scripts
kitten @ launch --title "Build" --cwd ~/project make build
kitten @ set-tab-title "Development"
kitten @ focus-window --match title:Build
kitten @ send-text --match title:Build "npm run dev\n"
kitten @ close-window --match title:Build
kitten @ set-font-size 14
kitten @ set-colors background=#282828
kitten @ ls  # List all windows and tabs

Layouts

# Available layouts
enabled_layouts tall,fat,grid,horizontal,vertical,splits,stack

# Layout-specific settings
# Tall layout: one main window on left, stack on right
# Fat layout: one main window on top, stack on bottom
# Grid layout: windows in a grid
# Splits layout: arbitrary splits
# Stack layout: one window at a time (like tmux zoom)

Advanced Usage

Custom Key Mappings

# Custom mappings in kitty.conf
map ctrl+shift+enter new_window_with_cwd
map ctrl+shift+t new_tab_with_cwd
map f1 launch --type=overlay --stdin-source=@screen_scrollback less
map f5 launch --location=hsplit --cwd=current
map f6 launch --location=vsplit --cwd=current
map f11 toggle_fullscreen
map ctrl+shift+z toggle_layout stack

# Open URLs with specific apps
map ctrl+shift+e open_url_with_hints
map ctrl+shift+p>f kitten hints --type path --program -
map ctrl+shift+p>l kitten hints --type line --program -

Session Startup

# ~/.config/kitty/sessions/dev.conf
new_tab Development
cd ~/project
launch zsh
layout splits
launch --location=hsplit zsh -c "npm run dev"

new_tab Monitoring
cd ~/project
launch zsh -c "htop"
# Start with a session
kitty --session ~/.config/kitty/sessions/dev.conf

Custom Kittens

# ~/.config/kitty/mykitten.py
from kittens.tui.handler import result_handler

def main(args):
    pass

@result_handler(no_ui=True)
def handle_result(args, answer, target_window_id, boss):
    boss.call_remote_control(None, ('send-text', f'Hello from kitten!\n'))

Troubleshooting

IssueSolution
Fonts not renderingInstall font; run kitty +list-fonts to verify detection
Ligatures not showingSet disable_ligatures never; ensure font supports ligatures
Images not displayingUse kitten icat; ensure GPU drivers are working
Slow renderingCheck GPU drivers; try LIBGL_ALWAYS_SOFTWARE=1 kitty
SSH features missingUse kitten ssh instead of plain ssh command
Key bindings not workingCheck for conflicts; use kitty --debug-input to test
Colors wrongRun kitten themes to apply a theme; check color settings
High memory usageReduce scrollback_lines; check for memory leaks in shell