refactor: Moving the wezterm local file linux cursor fix into the main

config file, fixing treesitter folding (maybe) and removing the old
attempt at a fix, slight fixes to formatting in other files.
This commit is contained in:
2026-03-31 15:56:08 -05:00
parent f80e5aa318
commit 36c3852bc3
7 changed files with 68 additions and 84 deletions

View File

@@ -16,8 +16,7 @@ declare -A configs=(
["nvim/after"]="$HOME/.config/nvim/" ["nvim/after"]="$HOME/.config/nvim/"
["nvim/snippets"]="$HOME/.config/nvim/" ["nvim/snippets"]="$HOME/.config/nvim/"
["tmux.conf"]="$HOME/.tmux.conf" ["tmux.conf"]="$HOME/.tmux.conf"
["wezterm.lua"]="$HOME/.config/wezterm/wezterm.lua" ["wezterm/wezterm.lua"]="$HOME/.config/wezterm/wezterm.lua"
# ["wezterm.local_linux.lua"]="$HOME/.config/wezterm/local.lua" # TODO: switch contents to elsewhere, be aware of OS, or refactor elsewise
["npmrc"]="$HOME/.npmrc" ["npmrc"]="$HOME/.npmrc"
) )

View File

@@ -1,10 +1,3 @@
-- Fix for treesitter folds, as folds are not recalculated upon buffer changes (especially when pasting text)
-- vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNew', 'BufWinEnter' }, {
-- pattern = '*',
-- group = vim.api.nvim_create_augroup('telescope_fold_workaround', { clear = true }),
-- command = 'set foldexpr=nvim_treesitter#foldexpr()',
-- })
-- Disables syntax, treesitter and folding on larger files -- Disables syntax, treesitter and folding on larger files
vim.api.nvim_create_autocmd({ 'BufReadPre' }, { vim.api.nvim_create_autocmd({ 'BufReadPre' }, {
pattern = '*', pattern = '*',

View File

@@ -7,7 +7,7 @@ vim.opt.expandtab = true -- Expand ta
vim.opt.fileformat = 'unix' -- Explicitly state that files should use the unix style EOL characters. vim.opt.fileformat = 'unix' -- Explicitly state that files should use the unix style EOL characters.
vim.opt.fillchars = 'fold: ' -- Sets the character that fills in a fold line vim.opt.fillchars = 'fold: ' -- Sets the character that fills in a fold line
vim.opt.foldcolumn = '0' -- Disables the foldcolumn vim.opt.foldcolumn = '0' -- Disables the foldcolumn
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' -- Uses Treesitter to determine where code folding should occur vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -- Uses Treesitter to determine where code folding should occur
vim.opt.foldlevel = 10 -- Sets the initial level at which folds will be closed vim.opt.foldlevel = 10 -- Sets the initial level at which folds will be closed
vim.opt.foldlevelstart = 4 -- Sets the initial fold level vim.opt.foldlevelstart = 4 -- Sets the initial fold level
vim.opt.foldmethod = 'expr' -- Attempt to use the syntax of a file to set folds. vim.opt.foldmethod = 'expr' -- Attempt to use the syntax of a file to set folds.

View File

@@ -1,39 +0,0 @@
local wezterm = require('wezterm')
local function setup(config)
-- Fixing the cursor theme
local xcursor_size = nil
local xcursor_theme = nil
local success, stdout, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-theme"
})
if success then
xcursor_theme = stdout:gsub("'(.+)'\n", "%1")
end
local success, _, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-size"
})
if success then
xcursor_size = tonumber(stdout)
end
config.xcursor_theme = xcursor_theme
config.xcursor_size = xcursor_size
-- end cursor theme
return config
end
return {
setup = setup,
}

View File

@@ -1,34 +0,0 @@
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
-- Visual options
config.color_scheme = 's3r0 modified (terminal.sexy)'
-- config.color_scheme = 'darkmatrix'
-- config.color_scheme = 'Mashup Colors (terminal.sexy)'
-- config.color_scheme = 'Gruvbox dark, pale (base16)'
-- config.color_scheme = 'Gruvbox Material (Gogh)'
config.font = wezterm.font 'Inconsolata Nerd Font Mono'
config.font_size = 12
config.enable_tab_bar = false
config.window_close_confirmation = 'NeverPrompt'
config.window_padding = {
left = '0',
right = '0',
top = '0',
bottom = '0'
}
-- config.window_background_opacity = 0.9
-- end visual options
config.automatically_reload_config = true
local local_config_filename = os.getenv('HOME') .. '/.config/wezterm/local.lua'
local local_config = io.open(local_config_filename, 'r')
if local_config~=nil then
local local_setup = require('local')
config = local_setup.setup(config)
end
return config

65
wezterm/wezterm.lua Normal file
View File

@@ -0,0 +1,65 @@
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
-- Visual options
config.color_scheme = 's3r0 modified (terminal.sexy)'
-- config.color_scheme = 'Mashup Colors (terminal.sexy)'
config.font = wezterm.font 'Inconsolata Nerd Font Mono'
config.font_size = 12
config.enable_tab_bar = false
config.window_close_confirmation = 'NeverPrompt'
config.window_padding = {
left = '0',
right = '0',
top = '0',
bottom = '0'
}
config.window_background_opacity = 0.98
-- end visual options
config.automatically_reload_config = true
-- Linux specific fixes
if wezterm.target_triple == 'x86_64-unknown-linux-gnu' then
-- Fixing the cursor theme
local xcursor_size = nil
local xcursor_theme = nil
local theme_success, stdout, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-theme"
})
if theme_success then
xcursor_theme = stdout:gsub("'(.+)'\n", "%1")
end
local cursor_success, _, _ = wezterm.run_child_process({
"gsettings",
"get",
"org.gnome.desktop.interface",
"cursor-size"
})
if cursor_success then
xcursor_size = tonumber(stdout)
end
config.xcursor_theme = xcursor_theme
config.xcursor_size = xcursor_size
-- end cursor theme
end
local local_config_filename = os.getenv('HOME') .. '/.config/wezterm/local.lua'
local local_config = io.open(local_config_filename, 'r')
if local_config ~= nil then
local local_setup = require('local')
config = local_setup.setup(config)
end
return config