Skip to content

Instantly share code, notes, and snippets.

@paul-nameless
Last active July 13, 2024 12:37
Show Gist options
  • Save paul-nameless/a14e4a6ba310119df2cf5409cbb3738b to your computer and use it in GitHub Desktop.
Save paul-nameless/a14e4a6ba310119df2cf5409cbb3738b to your computer and use it in GitHub Desktop.
#...
alias theme-reset="kitty @ --to unix:/tmp/kitty set-colors --reset"
alias theme="cd ~/.config/kitty/themes && fzf --preview 'head -n 40 {} && kitty @ --to unix:/tmp/kitty set-colors -a -c {}'; cd -"
#...
background #1c2836
foreground #ffffff
cursor #bbbbbb
selection_background #b4d5ff
color0 #000000
color8 #545454
color1 #f9555f
color9 #fa8b8e
color2 #20af89
color10 #34bb99
color3 #fdf029
color11 #ffff55
color4 #589cf5
color12 #589cf5
color5 #934d95
color13 #e75598
color6 #1e9ee6
color14 #3978bb
color7 #bbbbbb
color15 #ffffff
selection_foreground #1c2836
# vim:fileencoding=utf-8:ft=conf
tab_bar_style powerline
font_family JetBrains Mono Regular
italic_font JetBrains Mono Italic
bold_font JetBrains Mono ExtraBold
bold_italic_font JetBrains Mono ExtraBold Italic
adjust_line_height 110%
# Font size (in pts)
font_size 16.0
# The cursor shape can be one of (block, beam, underline)
cursor_shape block
# The interval (in seconds) at which to blink the cursor. Set to zero to
# disable blinking.
cursor_blink_interval 0
# Stop blinking cursor after the specified number of seconds of keyboard inactivity. Set to
# zero to never stop blinking.
cursor_stop_blinking_after 15.0
# Number of lines of history to keep in memory for scrolling back
scrollback_lines 4000
# Program with which to view scrollback in a new window. The scrollback buffer is passed as
# STDIN to this program. If you change it, make sure the program you use can
# handle ANSI escape sequences for colors and text formatting.
scrollback_pager less +G -R
# When viewing scrollback in a new window, put it in a new tab as well
# scrollback_in_new_tab no
# Wheel scroll multiplier (modify the amount scrolled by the mouse wheel). Use negative
# numbers to change scroll direction.
wheel_scroll_multiplier 5.0
# The interval between successive clicks to detect double/triple clicks (in seconds)
click_interval 0.5
# Characters considered part of a word when double clicking. In addition to these characters
# any character that is marked as an alpha-numeric character in the unicode
# database will be matched.
# select_by_word_characters @:-./_~?&=%+#
select_by_word_characters -./_~%+#
# Hide mouse cursor after the specified number of seconds of the mouse not being used. Set to
# zero to disable mouse cursor hiding.
mouse_hide_wait 3.0
# The enabled window layouts. A comma separated list of layout names. The special value * means
# all layouts. The first listed layout will be used as the startup layout.
# For a list of available layouts, see the file layouts.py
enabled_layouts *
# If enabled, the window size will be remembered so that new instances of kitty will have the same
# size as the previous instance. If disabled, the window will initially have size configured
# by initial_window_width/height, in pixels.
remember_window_size yes
initial_window_width 640
initial_window_height 400
# Delay (in milliseconds) between screen updates. Decreasing it, increases fps
# at the cost of more CPU usage. The default value yields ~100fps which is more
# that sufficient for most uses.
repaint_delay 10
# Visual bell duration. Flash the screen when a bell occurs for the specified number of
# seconds. Set to zero to disable.
visual_bell_duration 0.0
# Enable/disable the audio bell. Useful in environments that require silence.
enable_audio_bell yes
# The modifier keys to press when clicking with the mouse on URLs to open the URL
open_url_modifiers ctrl+shift
# The program with which to open URLs that are clicked on. The special value "default" means to
# use the operating system's default URL handler.
open_url_with default
# The value of the TERM environment variable to set
term xterm-256color
# The width (in pts) of window borders. Will be rounded to the nearest number of pixels based on screen resolution.
window_border_width 2
# The window margin (in pts) (blank area outside the border)
window_margin_width 0
# The window padding (in pts) (blank area between the text and the window border)
window_padding_width 0
# Key mapping
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
# You can use the special action no_op to unmap a keyboard shortcut that is
# assigned in the default configuration.
# Clipboard
map ctrl+shift+v paste_from_clipboard
map ctrl+shift+s paste_from_selection
map ctrl+shift+c copy_to_clipboard
map shift+insert paste_from_selection
copy_on_select yes
#### Scrolling
# map ctrl+shift+up scroll_line_up
# map ctrl+shift+down scroll_line_down
map super+up scroll_line_up
map super+down scroll_line_down
map super+shift+up scroll_page_up
map super+shift+down scroll_page_down
map super+ctrl+shift+k scroll_home
map ctrl+ctrl+shift+j scroll_end
map super+b show_scrollback
#### Window management
map ctrl+shift+enter new_window
# map super+shift+enter new_window
map super+shift+enter launch --type=window --cwd=current
map ctrl+shift+w close_window
map super+] next_window
map ctrl+shift+] next_window
map super+[ previous_window
map super+alt+] move_window_forward
map super+alt+[ move_window_backward
map ctrl+shift+[ previous_window
map ctrl+shift+f move_window_forward
map ctrl+shift+b move_window_backward
map ctrl+shift+` move_window_to_top
map ctrl+shift+1 first_window
map ctrl+shift+2 second_window
map ctrl+shift+3 third_window
map ctrl+shift+4 fourth_window
map ctrl+shift+5 fifth_window
map ctrl+shift+6 sixth_window
map ctrl+shift+7 seventh_window
map ctrl+shift+8 eighth_window
map ctrl+shift+9 ninth_window
map ctrl+shift+0 tenth_window
#### Tab management
map super+1 goto_tab 1
map super+2 goto_tab 2
map super+3 goto_tab 3
map super+4 goto_tab 4
map super+5 goto_tab 5
map super+6 goto_tab 6
map super+7 goto_tab 7
map super+8 goto_tab 8
map super+9 goto_tab 999
map super+o goto_tab -1
map super+shift+] next_tab
map super+shift+[ previous_tab
map ctrl+shift+t new_tab
map ctrl+shift+q close_tab
map ctrl+shift+l next_layout
map super+l next_layout
map super+alt+shift+] move_tab_forward
map super+alt+shift+[ move_tab_backward
# default
map ctrl+shift+alt+t set_tab_title
map super+shift+t set_tab_title
tab_switch_strategy last # last, left, previous
tab_title_template {index}:{title}
map super+t new_tab_with_cwd
map super+е new_tab_with_cwd
map super+enter new_tab_with_cwd
# map super+t @new-window --new-tab --cwd=/Users/paul/Downloads/ --tab-title='1'
#### Miscellaneous
update_check_interval 0
#### Hints
# url
map super+e kitten hints
# copy url
map super+shift+e kitten hints --program @
# copy selected path
map super+shift+c kitten hints --type path --program @
# file path
map super+p kitten hints --type path --program -
map super+shift+p kitten hints --multiple --type path --program -
# any line
map super+i kitten hints --type line --program -
map super+shift+i kitten hints --multiple --type line --program -
# copy line
map super+y kitten hints --type line --program @
# copy multiple line
map super+shift+y kitten hints --multiple --type line --program @
# paste timestamp in vim
#map ctrl+shift+p>t kitten hints --customize-processing /Users/paul/Downloads/ts.py --program -
map super+equal increase_font_size
map super+minus decrease_font_size
map super+0 restore_font_size
map super+backspace send_text all \x15
hide_window_decorations yes
# for retina
# macos_thicken_font 0.5
# for low res monitors
macos_thicken_font 0
macos_option_as_alt yes
# ansi (colorized text in vim)
map super+d pipe @text overlay vim -c 'nnoremap q :q!<CR>' -c 'map $ g_' -c ':silent! %s#\($\n\s*\)\+\%$##' '+$' -
map super+f pipe @ansi overlay /Users/paul/Documents/bin/vim-ansi
allow_remote_control yes
#### theme ####
# The color for the border of the active window
active_border_color #0087ff
# The color for the border of inactive windows
inactive_border_color #cccccc
# Tab-bar colors
active_tab_foreground #75715e
active_tab_background #353535
inactive_tab_foreground #75715e
inactive_tab_background #272822
include colors.conf
# shortcuts
# unicode input (emojies)
# ctrl+shift+u
# path or filename and then insert it into the terminal
# ctrl+shift+p>f
# select anything that looks like a path or filename followed by a colon and a line number and open the file in vim at
# ctrl+shift+p>n
# select anything that looks like a path or filename followed by a colon and a line number and open the file in vim at
# ctrl+shift+p>n
# set tab title
# map ctrl+shift+alt+t set_tab_title
# map super+shift+t set_tab_title
#: The modifiers to use rectangular selection (i.e. to select text in
#: a rectangular block with the mouse)
# rectangle_select_modifiers ctrl+alt
shell /bin/zsh
window_padding_width 10
# Next window
# map ctrl+shift+] next_window
# Previous window
# map ctrl+shift+[ previous_window
# Move window forward
# map ctrl+shift+f move_window_forward
# Move window backward
# map ctrl+shift+b move_window_backward
# Move window to top
# map ctrl+shift+` move_window_to_top
# Start resizing window
# map ctrl+shift+r start_resizing_window
# First window
# map ctrl+shift+1 first_window
confirm_os_window_close 1
#!/bin/sh
# vim -c 'nnoremap q :q!<CR>' -c 'map $ g_' -c ':silent! %s#\($\n\s*\)\+\%$##' '+$' -
cat - | awk '/^$/ {nlstack=nlstack "\n";next;} {printf "%s",nlstack; nlstack=""; print;}' > /tmp/buff
vim -c 'term tail -n 200 /tmp/buff' -c ':only' -c 'nnoremap q :q!<CR>' -c 'map $ g_' < /dev/tty
# TODO: create unique file and remove at the end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment