PRIMARY CATEGORY → SETUP
kitty → Fast and Feature-Rich GPU Based Terminal Emulator
It is an enhanced terminal with a tabbed/tiling structure focused in performance and customization
Each tab can be divided into several panes/windows
Some of this features are →
- Multiple Instances and Windows
- Setting of Keybinds/Hotkeys via a simple configuration file
- Image and Emojis Display
IMPORTANT
Note that some dependencies are required to display images in this Kitty Terminal Emulator through the command above such as imagemagick
Just check that the package is installed →
If not →
Anyways, It should be installed, as It is indicated as environment dependency to be installed in the Setup’s components section
- SSH Protocol support
Note that the above commands use the syntax kitty +kitten
kittens
are small integrated programs that extend kitty
’s capacity - See here
kitty
is launched by the sxhkd daemon when a certain input event, such as a Hotkey, is performed
Configuration File → ~/.config/kitty/kitty.conf
More information here
💫 Awesome Documentation → Kitty Site
Installation
CAUTION
First, see the bspwm’s installation before proceeding with this one related to
sxhkd
There are some dependencies that are needed in the following installation steps
Download the binary and its related files from the project’s release page. The required one, in this Environment Setup is the Linux amd64 binary bundle
Being root →
INFO
That .TXZ file is simply a TAR package compressed via XZ. As the above command does, It can be decompressed and unpacked using the
tar
commandIt can also be done in two steps through →
That’s it
As for the kitty’s Configuration File, It need to be created
Just create it in ~/.config/kitty
and paste this Configuration File’s content into it →
Moreover, as mentioned below, a color.ini file must also be created in the ~/.config/kitty
directory to apply various terminal colours
Copy the Color.ini file from here and paste into it →
Once the above is done, as Root, copy the entire /home/al3xbb/.config/kitty
directory’s content into his kitty’s configuration directory
Hack Nerd Fonts
See here to download them
To install them, as root →
Once installed, just check in the kitty.conf
file that the font_family
parameter is set as follows →
More info here
Configuration File
Kitty.conf Configuration File Sample Fully documented
kitty.conf
→ Copy from here the kitty
’s Full Customised Configuration File
color.ini
→ Likewise, copy from here the kitty
’s Colours File
Configuration File Documentation → kitty.conf
Parameters
Font
Several parameters related to the kitty terminal’s font such as the font_family
or font_size
can be specificed in the kitty.conf
configuration file
Take a look at this installation for more information
Shell
This Enviroment Setup make use of a ZSH as the Default Shell
IMPORTANT
The following action requires the ZSH shell to be installed on the system
Just installed it via the apt repositories as follows →
Anyway, See this to get it all set up as far as ZSH is concerned
Then, It’s necessary to tell it to Kitty. This can be done via the shell
parameter
Background Opacity
The kitty terminal’s opacity is set by the background_opacity
parameter
Its value ranges from 0, fully transparent, to 1, opaque
IMPORTANT
Note that the Terminal’s Background Opacity will probably not work until the picom component is correctly configured
Colours
Regarding the kitty terminal’s colours, a .ini file is included in the kitty.conf
Get the color.ini
file content here
Actions and Default Shortcuts
All mappable actions here
All default shortcuts here related to Windows, Tabs, Layouts…
Custom Shortcuts ~ TL;DR
Layouts
Action | Shortcut |
---|---|
Toogle between Split and Stack Layout | C-S-z |
Split Rotation | C-S-o |
Windows
Action | Shortcut |
---|---|
Vertical Split | C-S-Enter |
Horizontal Split | C-S-dash/hyphen |
Adaptative Split | C-S-plus |
Windows Closing | C-S-w |
Windows Movement ⬆️⬅️➡️⬇️ | C-M-{k,h,l,j} |
Windows Focus ⬆️⬅️➡️⬇️ | C-S-{k,h,l,j} |
Windows Resize ⬆️⬅️➡️⬇️ | M-S-{k,h,l,j} |
Windows Resize - Reset | M-S-r |
Windows Detach | M-S-w |
Tabs
Action | Shortcut |
---|---|
Tab Creation | C-S-t |
Tab Closing | C-S-q |
Tab Detach | C-M-o |
Tab Rename | C-M-S-t |
Tab Movement (Backward ~ Forward) ⬅️➡️ | C-{S-TAB,TAB} |
Tab Focus (Previous - Next) ⬅️➡️ | C-S{commma,dot} |
Misc
Action | Shortcut |
---|---|
Paginate last Command Output | C-S-g |
Clear Screen and Scrollback Buffer | C-l |
Copy to Clipboard | C-S-c |
Paste from Clipboard | C-S-v |
Copy to Buffer A | f1 |
Paste from Buffer A | f2 |
Copy to Buffer B | f3 |
Paste from Buffer B | f4 |
Increase/Decrease Font Size | C-S-{plus,minus} (Block-Num) |
Restore Font Size | C-S-Backspace |
Custom Shortcuts
Note that, as mentioned earlier, a keybind is mapped to a specific action
Keybind → Action
INFO
All the following block codes are snippets extracted from the Kitty’s Configuration File
Layouts Management
All the Layouts are enabled by default. To switch between them use default shorcut → C-S-l
In the configuration file, the selected ones are the Splits Layout and the Stack Layout
Most of the mappeable actions used there have been implemented in the kitty.conf
file, such as the below ones
As mentioned in the reference link above, the Splits Layout is the most flexible layout
The Stack Layout is simple enabled to allow zooming in and out a specific Window, i.e. switching between the two layouts via the toogle_layout
mappeable action below
Switch to Stack Layout (Window Zoom {in,out}) → C-S-z
Switch to Stack Layout
IMPORTANT
The
toogle_layout
action switches to the layout specified as argumentA handy action is implemented in the code above, which allows Zoom due to the change to the Stack Layout
If the action is performed again being in the specificed layout, It switches to the latest layout
Basically it removes the zoom generated by the Stack Layout
Split Rotation → C-S-o
Shown in the Split Layout Section
Basically rotates the current Windows Split (i.e. Horizonal ↔ Vertical)
Window Management
Most of the mappeable actions below are implemented in the Split Layout Section
Window Split
Different types of Split are implemented through the launch action
- Vertical Split →
C-S-enter
- Horizontal Split →
C-S-dash/hyphen
- Adaptative Split →
C-S-plus
The --cwd=current
option of the launch
action causes the terminal of the newly generated window to retain the previous CWD
CWD → Current Work Directory
IMPORTANT
Take into account that the split orientation is being handled by the
--location
optionSee here
Windows Movement → C-M-{k,h,l,j}
Moves the Windows in the specificed direction. It is like a Windows Exchange
Action → move_window
INFO
Note that Vim-like Motions are being used here to increase efficiency
Windows Focus → C-S-{k,h,l,j}
Move the Focus in the specified selection between the adjacent Windows in the current Tab
Action → neighboring_window
Windows Resize → M-S-{k,h,l,j,r}
Default Shorcut to enter the Windows Resize Mode → C-S-r
Thus, the Window is resized using:
w
→ Widern
→ Narrowert
→ Tallers
→ Shorterr
→ Reset Windows Size
To resize a Windows in a customised way, use the resize_window
action
As mentioned earlier, Nvim-like Motions are used to increase efficiency. Therefore, instead of use the above ones, use these →
IMPORTANT
The above
resize_window
mappeable action receives two argumentsThe First one is simply the windows resize motion to be made (i.e. Narrower, Taller, Shorter, Wider)
While the second one controls the resizing increment
To reset all Windows to their initial size, use the reset
option in the resize_window
actions rather than a specific motion
Windows Detach → M-S-w
Completely detach a Window in a new Window OS
Actions → detach_window
Tab Management
Tab Creation → C-S-t
Default shortcut to open a new tab → C-S-t
The above one keybind is overwritten in the Configuration File by the new_tab_witch_cmd
mappeable action
This allows to create a new tab while keeping the CWD
Tab Detach → C-M-o
Completely detach a tab in a new Window OS
Action → detach_tab
Copy ~ Paste
Traditional Clipboards → C-S-{c,v}
This environment setup make use of several Copy/Paste mappeable actions such as:
copy_to_clipboard
→C-S-c
paste_from_clipboard
→C-S-v
The above ones are mapped with the default shortcuts
Additional Clipboards (Buffers) → {f1,f2,f3,f4}
The customised ones are the related to the Buffers
A Buffer simply is a string that stores the value copied into it. Then, that value can be pasted from the Buffer to any location
In this case, two Buffers are declared in kitty.conf
and used →
Miscellaneous
Clear Screen and Scrollback Buffer
IMPORTANT
The same or similar actions can also be performed via functions declaration in a shell rc file such as the zshrc
- Clear Screen →
- Clear Screen and Scrollback Buffer →
- Clear Screen saving its content in Scrollback Buffer →
Note that the ZSH Line Editor
zle
is used in the above functions to prevent some undesired actions and perform a more optimal cleanup
zle
→ Verify if the ZSH Line Editor is available
zle .reset-prompt
→ Prompt Restart to prevent corruption due to clear or reset actions
zle -R
→ Prompt Redisplay to prevent visual problemsSee this pull request discussion
In this environment setup, this action is implemented in the zshrc as follows →
INFO
The last commands above perform the following actions:
zle -N FUNCTION_NAME
→ Function register as a New Widget in ZSH Line Editor
bindkey KEYBIND FUNCTION_NAME
→ A certain keybind runs the passed function