| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- local wezterm = require 'wezterm'
- local config = {}
- if wezterm.config_builder then
- config = wezterm.config_builder()
- end
- config.font = wezterm.font 'JetBrainsMono Nerd Font'
- config.enable_tab_bar = false
- -- Function to determine if the system is in dark mode
- local function is_dark()
- if wezterm.gui then
- return wezterm.gui.get_appearance():find 'Dark'
- end
- return true
- end
- -- Define color schemes
- local dark_colors = {
- foreground = '#e4e1e6',
- background = '#1b1b1f',
- cursor_bg = '#add8e6',
- cursor_fg = 'black',
- cursor_border = '#add8e6',
- selection_fg = 'black',
- selection_bg = '#fffacd',
- scrollbar_thumb = '#222222',
- split = '#444444',
- ansi = {
- '#3b4252', '#bf616a', '#a3be8c', '#ebcb8b',
- '#81a1c1', '#b48ead', '#88c0d0', '#e5e9f0',
- },
- brights = {
- '#4c566a', '#bf616a', '#a3be8c', '#ebcb8b',
- '#81a1c1', '#b48ead', '#8fbcbb', '#eceff4',
- },
- indexed = { [136] = '#af8700' },
- }
- local light_colors = {
- foreground = '#2e3440',
- background = '#eceff4',
- cursor_bg = '#5e81ac',
- cursor_fg = 'white',
- cursor_border = '#5e81ac',
- selection_fg = '#eceff4',
- selection_bg = '#4c566a',
- scrollbar_thumb = '#d8dee9',
- split = '#d8dee9',
- ansi = {
- '#3b4252', '#bf616a', '#a3be8c', '#ebcb8b',
- '#81a1c1', '#b48ead', '#88c0d0', '#e5e9f0',
- },
- brights = {
- '#4c566a', '#bf616a', '#a3be8c', '#ebcb8b',
- '#81a1c1', '#b48ead', '#8fbcbb', '#eceff4',
- },
- indexed = { [136] = '#af8700' },
- }
- -- Apply colors based on appearance
- if is_dark() then
- config.colors = dark_colors
- else
- config.colors = light_colors
- end
- config.cursor_blink_rate = 0
- config.disable_default_key_bindings = true
- config.keys = {
- {
- key = 'c',
- mods = 'ALT',
- action = wezterm.action.CopyTo('Clipboard'),
- },
- {
- key = 'v',
- mods ='ALT',
- action = wezterm.action.PasteFrom('Clipboard')
- },
- {
- key = 'k',
- mods = 'ALT|SHIFT',
- action = wezterm.action.IncreaseFontSize
- },
- {
- key = 'j',
- mods = 'ALT|SHIFT',
- action = wezterm.action.DecreaseFontSize
- },
- {
- key = '0',
- mods = 'ALT',
- action = wezterm.action.ResetFontSize
- },
- {
- key = 'u',
- mods = 'ALT',
- action = wezterm.action.ScrollByPage(-1)
- },
- {
- key = 'd',
- mods = 'ALT',
- action = wezterm.action.ScrollByPage(1)
- },
- {
- key = 'k',
- mods = 'ALT',
- action = wezterm.action.ScrollByLine(-1)
- },
- {
- key = 'j',
- mods = 'ALT',
- action = wezterm.action.ScrollByLine(1)
- },
- {
- key = 'f',
- mods = 'ALT',
- action = wezterm.action.Search { CaseInSensitiveString = '' },
- },
- }
- return config
|