Compare commits
9
Commits
8e4f80df2d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d140435ff3 | ||
|
|
a9fbfdb9dd | ||
|
|
d9727e0dec | ||
|
|
1b36392dff | ||
|
|
aaab135fea | ||
|
|
82314996f6 | ||
|
|
b03c503d2d | ||
|
|
c8a1e079ce | ||
|
|
642973f70b |
@@ -1,4 +1,7 @@
|
||||
theme = dark:monodark,light:monolight
|
||||
keybind = global:ctrl+a=toggle_quick_terminal
|
||||
quick-terminal-size = 100%
|
||||
|
||||
theme = dark:default-dark,light:default-light
|
||||
|
||||
# enforce legible text on washed-out colors (esp. light theme)
|
||||
minimum-contrast = 1.15
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Scheme: Default Dark
|
||||
# Generated by Ghostty Base16 Converter
|
||||
background = 181818
|
||||
background = 111111
|
||||
foreground = d8d8d8
|
||||
|
||||
selection-background = 383838
|
||||
selection-foreground = 181818
|
||||
selection-foreground = 111111
|
||||
|
||||
palette = 0=#181818
|
||||
palette = 1=#ab4642
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
# regardless of terminal theme handling.
|
||||
|
||||
foreground: &foreground "#d8d8d8"
|
||||
background: &background "#181818"
|
||||
black: &black "#181818"
|
||||
background: &background "#111111"
|
||||
black: &black "#111111"
|
||||
blue: &blue "#7cafc2"
|
||||
green: &green "#a1b56c"
|
||||
grey: &grey "#585858"
|
||||
|
||||
@@ -8,8 +8,46 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
end,
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
["compose.*%.ya?ml"] = "yaml.docker-compose",
|
||||
["docker%-compose.*%.ya?ml"] = "yaml.docker-compose",
|
||||
[".*/templates/.*%.tpl"] = "helm",
|
||||
[".*/templates/.*%.ya?ml"] = "helm",
|
||||
["values.*%.ya?ml"] = "yaml.helm-values",
|
||||
},
|
||||
})
|
||||
|
||||
-- Language server install commands:
|
||||
-- lua_ls: brew install lua-language-server
|
||||
-- pyright: npm install --global pyright
|
||||
-- gopls: go install golang.org/x/tools/gopls@latest
|
||||
-- clangd: brew install llvm
|
||||
-- helm_ls: brew install helm helm-ls
|
||||
-- bashls: npm install --global bash-language-server
|
||||
-- angularls: npm install --global @angular/language-server
|
||||
-- djls: brew install joshuadavidthomas/homebrew/django-language-server
|
||||
-- docker_language_server: go install github.com/docker/docker-language-server/cmd/docker-language-server@latest
|
||||
-- html: npm install --global vscode-langservers-extracted
|
||||
-- cssls: npm install --global vscode-langservers-extracted
|
||||
-- ts_ls: npm install --prefix "$HOME/.local/share/typescript-lsp" typescript typescript-language-server
|
||||
-- jsonls: npm install --global vscode-langservers-extracted
|
||||
-- emmet_ls: npm install --global emmet-ls
|
||||
-- yamlls: npm install --global yaml-language-server
|
||||
-- Kubernetes: provided by the yamlls schema configuration below
|
||||
|
||||
-- Enable language servers
|
||||
local servers = { 'lua_ls', 'pyright', 'gopls', 'clangd', 'helm_ls', 'bashls', 'angularls', 'djls' }
|
||||
local servers = {
|
||||
'lua_ls',
|
||||
'pyright',
|
||||
'gopls',
|
||||
'clangd',
|
||||
'helm_ls',
|
||||
'bashls',
|
||||
'angularls',
|
||||
'djls',
|
||||
'docker_language_server',
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
vim.lsp.enable(lsp)
|
||||
end
|
||||
@@ -70,11 +108,12 @@ vim.lsp.enable('emmet_ls')
|
||||
|
||||
-- YAML LSP
|
||||
vim.lsp.config('yamlls', {
|
||||
filetypes = { "yaml", "yaml.gitlab", "yaml.helm-values" },
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
kubernetes = "*.yaml",
|
||||
["https://json.schemastore.org/chart.json"] = "Chart.yaml",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -18,7 +18,52 @@ require('lazy').setup({
|
||||
'mfussenegger/nvim-dap',
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'leoluz/nvim-dap-go',
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
local treesitter = require('nvim-treesitter')
|
||||
-- Parsers for the languages enabled in lsp.lua. LESS, Objective-C++,
|
||||
-- and the generic "template" filetype have no matching parser.
|
||||
local parsers = {
|
||||
'angular', 'bash', 'c', 'cpp', 'css', 'cuda', 'dockerfile',
|
||||
'go', 'gomod', 'gotmpl', 'gowork', 'helm', 'html', 'htmldjango',
|
||||
'javascript', 'json', 'lua', 'objc', 'python', 'scss',
|
||||
'templ', 'tsx', 'typescript', 'yaml',
|
||||
}
|
||||
local ready = false
|
||||
|
||||
local function start_highlighting(buf)
|
||||
if not ready or not vim.api.nvim_buf_is_loaded(buf) then
|
||||
return
|
||||
end
|
||||
local lang = vim.treesitter.language.get_lang(vim.bo[buf].filetype)
|
||||
if vim.list_contains(parsers, lang)
|
||||
and vim.list_contains(treesitter.get_installed('parsers'), lang) then
|
||||
vim.treesitter.start(buf, lang)
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
group = vim.api.nvim_create_augroup('UserTreesitter', { clear = true }),
|
||||
callback = function(ev)
|
||||
start_highlighting(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
treesitter.install(parsers):await(vim.schedule_wrap(function(err)
|
||||
if err then
|
||||
vim.notify('Tree-sitter installation failed: ' .. tostring(err), vim.log.levels.ERROR)
|
||||
end
|
||||
ready = true
|
||||
-- Enable buffers opened while the first installation was running.
|
||||
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||
start_highlighting(buf)
|
||||
end
|
||||
end))
|
||||
end,
|
||||
},
|
||||
'luukvbaal/nnn.nvim',
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
'lewis6991/gitsigns.nvim',
|
||||
@@ -54,6 +99,11 @@ require('lazy').setup({
|
||||
org_default_notes_file = '~/doc/org/scratch.org',
|
||||
org_startup_indented = true,
|
||||
org_deadline_warning_days = 0,
|
||||
ui = {
|
||||
folds = {
|
||||
colored = false,
|
||||
},
|
||||
},
|
||||
org_agenda_custom_commands = {
|
||||
i = {
|
||||
description = "Independent",
|
||||
@@ -64,6 +114,15 @@ require('lazy').setup({
|
||||
}
|
||||
}
|
||||
},
|
||||
e = {
|
||||
description = "Employment",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'employment'
|
||||
}
|
||||
}
|
||||
},
|
||||
p = {
|
||||
description = "Personal",
|
||||
types = {
|
||||
@@ -73,34 +132,16 @@ require('lazy').setup({
|
||||
}
|
||||
}
|
||||
},
|
||||
w = {
|
||||
description = "Work",
|
||||
h = {
|
||||
description = "Habits",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'work'
|
||||
org_agenda_tag_filter_preset = 'habits'
|
||||
}
|
||||
}
|
||||
},
|
||||
m = {
|
||||
description = "Milestones",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'milestone'
|
||||
}
|
||||
}
|
||||
},
|
||||
s = {
|
||||
description = "Social",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'social'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -3,6 +3,12 @@ vim.o.shiftwidth = 4
|
||||
vim.o.tabstop = 4
|
||||
vim.o.expandtab = true
|
||||
vim.o.autoindent = true
|
||||
vim.g.python_indent = {
|
||||
open_paren = "shiftwidth()",
|
||||
nested_paren = "shiftwidth()",
|
||||
continue = "shiftwidth()",
|
||||
closed_paren_align_last_line = false,
|
||||
}
|
||||
vim.o.foldmethod = "indent"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.wrap = false
|
||||
@@ -13,6 +19,19 @@ vim.o.splitright = true
|
||||
vim.o.maxmempattern = 100000
|
||||
vim.g.clipboard = "osc52"
|
||||
|
||||
function _G.org_foldexpr()
|
||||
local stars = vim.fn.getline(vim.v.lnum):match("^(%*+)%s")
|
||||
return stars and (">" .. #stars) or "="
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "org",
|
||||
callback = function()
|
||||
vim.opt_local.foldmethod = "expr"
|
||||
vim.opt_local.foldexpr = "v:lua.org_foldexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd([[
|
||||
autocmd ColorScheme * highlight Statement cterm=NONE ctermfg=5
|
||||
autocmd ColorScheme * highlight Keyword ctermfg=5
|
||||
|
||||
@@ -7,5 +7,15 @@
|
||||
"command": ["npx", "@playwright/mcp@latest"],
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"bash": {
|
||||
"*": "ask",
|
||||
"kubectl *": "deny",
|
||||
"kubectl get *": "allow",
|
||||
"kubectl describe *": "allow",
|
||||
"kubectl logs *": "allow",
|
||||
"kubectl top *": "allow"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"password": "4QhoSb7noaFQU7oUWUB-HabVwNkYBtLjdwQsjJDEjHc"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/theme.json",
|
||||
"defs": {
|
||||
"base00": "#181818",
|
||||
"base00": "#111111",
|
||||
"base01": "#282828",
|
||||
"base02": "#383838",
|
||||
"base03": "#585858",
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/theme.json",
|
||||
"defs": {
|
||||
"_dark_bg": "#111111",
|
||||
"_dark_bg_panel": "#1a1a1a",
|
||||
"_dark_bg_element": "#242424",
|
||||
"_dark_border": "#333333",
|
||||
"_dark_border_active": "#5a5a5a",
|
||||
"_dark_border_subtle": "#242424",
|
||||
"_dark_fg": "#d8d8d8",
|
||||
"_dark_fg_accent": "#c8c8c8",
|
||||
"_dark_fg_secondary": "#a8a8a8",
|
||||
"_dark_fg_dim": "#888888",
|
||||
"_dark_fg_muted": "#787878",
|
||||
"_dark_fg_faint": "#585858",
|
||||
"_dark_diff_added_bg": "#1f1f1f",
|
||||
"_dark_diff_removed_bg": "#171717",
|
||||
|
||||
"_light_bg": "#f8f8f8",
|
||||
"_light_bg_panel": "#eeeeee",
|
||||
"_light_bg_element": "#e4e4e4",
|
||||
"_light_border": "#d4d4d4",
|
||||
"_light_border_active": "#a0a0a0",
|
||||
"_light_border_subtle": "#e4e4e4",
|
||||
"_light_fg": "#383838",
|
||||
"_light_fg_accent": "#282828",
|
||||
"_light_fg_strong": "#181818",
|
||||
"_light_fg_secondary": "#585858",
|
||||
"_light_fg_dim": "#686868",
|
||||
"_light_fg_muted": "#808080",
|
||||
"_light_fg_faint": "#a0a0a0",
|
||||
"_light_diff_added_bg": "#e4e4e4",
|
||||
"_light_diff_removed_bg": "#ececec"
|
||||
},
|
||||
"theme": {
|
||||
"primary": { "dark": "_dark_fg", "light": "_light_fg" },
|
||||
"secondary": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"accent": { "dark": "_dark_fg_accent", "light": "_light_fg_accent" },
|
||||
"error": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"warning": { "dark": "_dark_fg_secondary", "light": "_light_fg_secondary" },
|
||||
"success": { "dark": "_dark_fg_dim", "light": "_light_fg_dim" },
|
||||
"info": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
|
||||
"text": { "dark": "_dark_fg", "light": "_light_fg" },
|
||||
"textMuted": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
|
||||
"background": { "dark": "_dark_bg", "light": "_light_bg" },
|
||||
"backgroundPanel": { "dark": "_dark_bg_panel", "light": "_light_bg_panel" },
|
||||
"backgroundElement": { "dark": "_dark_bg_element", "light": "_light_bg_element" },
|
||||
|
||||
"border": { "dark": "_dark_border", "light": "_light_border" },
|
||||
"borderActive": { "dark": "_dark_border_active", "light": "_light_border_active" },
|
||||
"borderSubtle": { "dark": "_dark_border_subtle", "light": "_light_border_subtle" },
|
||||
|
||||
"diffAdded": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"diffRemoved": { "dark": "_dark_fg_muted", "light": "_light_fg_faint" },
|
||||
"diffContext": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
"diffHunkHeader": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"diffHighlightAdded": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"diffHighlightRemoved": { "dark": "_dark_fg_secondary", "light": "_light_fg_muted" },
|
||||
"diffAddedBg": { "dark": "_dark_diff_added_bg", "light": "_light_diff_added_bg" },
|
||||
"diffRemovedBg": { "dark": "_dark_diff_removed_bg", "light": "_light_diff_removed_bg" },
|
||||
"diffContextBg": { "dark": "_dark_bg", "light": "_light_bg" },
|
||||
"diffLineNumber": { "dark": "_dark_fg_faint", "light": "_light_fg_faint" },
|
||||
"diffAddedLineNumberBg": { "dark": "_dark_diff_added_bg", "light": "_light_diff_added_bg" },
|
||||
"diffRemovedLineNumberBg": { "dark": "_dark_diff_removed_bg", "light": "_light_diff_removed_bg" },
|
||||
|
||||
"markdownText": { "dark": "_dark_fg", "light": "_light_fg" },
|
||||
"markdownHeading": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"markdownLink": { "dark": "_dark_fg_accent", "light": "_light_fg_secondary" },
|
||||
"markdownLinkText": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"markdownCode": { "dark": "_dark_fg_accent", "light": "_light_fg_secondary" },
|
||||
"markdownBlockQuote": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
"markdownEmph": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"markdownStrong": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"markdownHorizontalRule": { "dark": "_dark_border", "light": "_light_border" },
|
||||
"markdownListItem": { "dark": "_dark_fg_accent", "light": "_light_fg_secondary" },
|
||||
"markdownListEnumeration": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"markdownImage": { "dark": "_dark_fg_secondary", "light": "_light_fg_dim" },
|
||||
"markdownImageText": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
"markdownCodeBlock": { "dark": "_dark_fg", "light": "_light_fg" },
|
||||
|
||||
"syntaxComment": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" },
|
||||
"syntaxKeyword": { "dark": "_dark_fg", "light": "_light_fg_strong" },
|
||||
"syntaxFunction": { "dark": "_dark_fg_accent", "light": "_light_fg" },
|
||||
"syntaxVariable": { "dark": "_dark_fg", "light": "_light_fg" },
|
||||
"syntaxString": { "dark": "_dark_fg_dim", "light": "_light_fg_dim" },
|
||||
"syntaxNumber": { "dark": "_dark_fg_secondary", "light": "_light_fg_secondary" },
|
||||
"syntaxType": { "dark": "_dark_fg_accent", "light": "_light_fg_secondary" },
|
||||
"syntaxOperator": { "dark": "_dark_fg_dim", "light": "_light_fg_dim" },
|
||||
"syntaxPunctuation": { "dark": "_dark_fg_muted", "light": "_light_fg_muted" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/theme.json",
|
||||
"defs": {
|
||||
"monoBackground": "#111111",
|
||||
"monoSurface": "#1c1c1c",
|
||||
"monoDiffAdded": "#191919",
|
||||
"monoDiffRemoved": "#262626",
|
||||
"monoForeground": "#d8d8d8"
|
||||
},
|
||||
"theme": {
|
||||
"primary": "monoForeground",
|
||||
"secondary": "monoForeground",
|
||||
"accent": "monoForeground",
|
||||
"error": "monoForeground",
|
||||
"warning": "monoForeground",
|
||||
"success": "monoForeground",
|
||||
"info": "monoForeground",
|
||||
|
||||
"text": "monoForeground",
|
||||
"textMuted": "monoForeground",
|
||||
|
||||
"background": "monoBackground",
|
||||
"backgroundPanel": "monoSurface",
|
||||
"backgroundElement": "monoSurface",
|
||||
|
||||
"border": "monoForeground",
|
||||
"borderActive": "monoForeground",
|
||||
"borderSubtle": "monoForeground",
|
||||
|
||||
"diffAdded": "monoForeground",
|
||||
"diffRemoved": "monoForeground",
|
||||
"diffContext": "monoForeground",
|
||||
"diffHunkHeader": "monoForeground",
|
||||
"diffHighlightAdded": "monoForeground",
|
||||
"diffHighlightRemoved": "monoForeground",
|
||||
"diffAddedBg": "monoDiffAdded",
|
||||
"diffRemovedBg": "monoDiffRemoved",
|
||||
"diffContextBg": "monoBackground",
|
||||
"diffLineNumber": "monoForeground",
|
||||
"diffAddedLineNumberBg": "monoDiffAdded",
|
||||
"diffRemovedLineNumberBg": "monoDiffRemoved",
|
||||
|
||||
"markdownText": "monoForeground",
|
||||
"markdownHeading": "monoForeground",
|
||||
"markdownLink": "monoForeground",
|
||||
"markdownLinkText": "monoForeground",
|
||||
"markdownCode": "monoForeground",
|
||||
"markdownBlockQuote": "monoForeground",
|
||||
"markdownEmph": "monoForeground",
|
||||
"markdownStrong": "monoForeground",
|
||||
"markdownHorizontalRule": "monoForeground",
|
||||
"markdownListItem": "monoForeground",
|
||||
"markdownListEnumeration": "monoForeground",
|
||||
"markdownImage": "monoForeground",
|
||||
"markdownImageText": "monoForeground",
|
||||
"markdownCodeBlock": "monoForeground",
|
||||
|
||||
"syntaxComment": "monoForeground",
|
||||
"syntaxKeyword": "monoForeground",
|
||||
"syntaxFunction": "monoForeground",
|
||||
"syntaxVariable": "monoForeground",
|
||||
"syntaxString": "monoForeground",
|
||||
"syntaxNumber": "monoForeground",
|
||||
"syntaxType": "monoForeground",
|
||||
"syntaxOperator": "monoForeground",
|
||||
"syntaxPunctuation": "monoForeground"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/theme.json",
|
||||
"defs": {
|
||||
"monoBackground": "#eeeeee",
|
||||
"monoSurface": "#e3e3e3",
|
||||
"monoDiffAdded": "#e7e7e7",
|
||||
"monoDiffRemoved": "#d8d8d8",
|
||||
"monoForeground": "#383838"
|
||||
},
|
||||
"theme": {
|
||||
"primary": "monoForeground",
|
||||
"secondary": "monoForeground",
|
||||
"accent": "monoForeground",
|
||||
"error": "monoForeground",
|
||||
"warning": "monoForeground",
|
||||
"success": "monoForeground",
|
||||
"info": "monoForeground",
|
||||
|
||||
"text": "monoForeground",
|
||||
"textMuted": "monoForeground",
|
||||
|
||||
"background": "monoBackground",
|
||||
"backgroundPanel": "monoSurface",
|
||||
"backgroundElement": "monoSurface",
|
||||
|
||||
"border": "monoForeground",
|
||||
"borderActive": "monoForeground",
|
||||
"borderSubtle": "monoForeground",
|
||||
|
||||
"diffAdded": "monoForeground",
|
||||
"diffRemoved": "monoForeground",
|
||||
"diffContext": "monoForeground",
|
||||
"diffHunkHeader": "monoForeground",
|
||||
"diffHighlightAdded": "monoForeground",
|
||||
"diffHighlightRemoved": "monoForeground",
|
||||
"diffAddedBg": "monoDiffAdded",
|
||||
"diffRemovedBg": "monoDiffRemoved",
|
||||
"diffContextBg": "monoBackground",
|
||||
"diffLineNumber": "monoForeground",
|
||||
"diffAddedLineNumberBg": "monoDiffAdded",
|
||||
"diffRemovedLineNumberBg": "monoDiffRemoved",
|
||||
|
||||
"markdownText": "monoForeground",
|
||||
"markdownHeading": "monoForeground",
|
||||
"markdownLink": "monoForeground",
|
||||
"markdownLinkText": "monoForeground",
|
||||
"markdownCode": "monoForeground",
|
||||
"markdownBlockQuote": "monoForeground",
|
||||
"markdownEmph": "monoForeground",
|
||||
"markdownStrong": "monoForeground",
|
||||
"markdownHorizontalRule": "monoForeground",
|
||||
"markdownListItem": "monoForeground",
|
||||
"markdownListEnumeration": "monoForeground",
|
||||
"markdownImage": "monoForeground",
|
||||
"markdownImageText": "monoForeground",
|
||||
"markdownCodeBlock": "monoForeground",
|
||||
|
||||
"syntaxComment": "monoForeground",
|
||||
"syntaxKeyword": "monoForeground",
|
||||
"syntaxFunction": "monoForeground",
|
||||
"syntaxVariable": "monoForeground",
|
||||
"syntaxString": "monoForeground",
|
||||
"syntaxNumber": "monoForeground",
|
||||
"syntaxType": "monoForeground",
|
||||
"syntaxOperator": "monoForeground",
|
||||
"syntaxPunctuation": "monoForeground"
|
||||
}
|
||||
}
|
||||
Executable
+71
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
# Tmux Zen Mode - Center your terminal
|
||||
# Usage: tmux-zen.sh [width]
|
||||
|
||||
CENTER_WIDTH="${1:-120}"
|
||||
|
||||
CURRENT_PANE=$(tmux display-message -p '#{pane_id}')
|
||||
PANE_COUNT=$(tmux display-message -p '#{window_panes}')
|
||||
WINDOW_WIDTH=$(tmux display-message -p '#{window_width}')
|
||||
|
||||
# Check if we're already in zen mode
|
||||
is_zen_mode() {
|
||||
[ "$PANE_COUNT" -eq 3 ]
|
||||
}
|
||||
|
||||
create_zen() {
|
||||
if is_zen_mode; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$PANE_COUNT" -ne 1 ]; then
|
||||
tmux display-message "Zen mode: single pane only"
|
||||
return
|
||||
fi
|
||||
|
||||
TOTAL_MARGIN=$((WINDOW_WIDTH - CENTER_WIDTH - 2))
|
||||
if [ "$TOTAL_MARGIN" -lt 10 ]; then
|
||||
tmux display-message "Zen mode: window too narrow"
|
||||
return
|
||||
fi
|
||||
|
||||
SIDE_WIDTH=$((TOTAL_MARGIN / 2))
|
||||
|
||||
tmux split-window -hdt "$CURRENT_PANE" "cat"
|
||||
tmux split-window -hbdt "$CURRENT_PANE" "cat"
|
||||
|
||||
tmux select-layout even-horizontal
|
||||
tmux resize-pane -t "$CURRENT_PANE" -x "$CENTER_WIDTH"
|
||||
|
||||
for pane in $(tmux list-panes -F '#{pane_id}'); do
|
||||
if [ "$pane" != "$CURRENT_PANE" ]; then
|
||||
pane_command=$(tmux display-message -p -t "$pane" '#{pane_current_command}')
|
||||
if [ "$pane_command" = "cat" ]; then
|
||||
tmux resize-pane -t "$pane" -x "$SIDE_WIDTH"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
destroy_zen() {
|
||||
if ! is_zen_mode; then
|
||||
return
|
||||
fi
|
||||
|
||||
for pane in $(tmux list-panes -F '#{pane_id}'); do
|
||||
pane_command=$(tmux display-message -p -t "$pane" '#{pane_current_command}')
|
||||
if [ "$pane_command" = "cat" ]; then
|
||||
tmux kill-pane -t "$pane"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
toggle_zen() {
|
||||
if is_zen_mode; then
|
||||
destroy_zen
|
||||
else
|
||||
create_zen
|
||||
fi
|
||||
}
|
||||
|
||||
toggle_zen
|
||||
@@ -1,5 +1,7 @@
|
||||
# set-option -g default-command "exec /usr/local/bin/bash --login"
|
||||
set-option -g status-style bg=default
|
||||
bind s choose-tree -Zs -O name
|
||||
set-option -g status-position top
|
||||
|
||||
# Enable mouse
|
||||
set -g mouse on
|
||||
@@ -9,6 +11,9 @@ set -g prefix C-space
|
||||
unbind-key C-b
|
||||
bind-key C-space send-prefix
|
||||
|
||||
# Sort the session picker by name
|
||||
bind s choose-tree -Zs -O name
|
||||
|
||||
# Set new panes to open in current directory
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
@@ -77,3 +82,5 @@ bind -T off-prefix O \
|
||||
bind -T off-prefix Any \
|
||||
send-keys C-Space \;\
|
||||
send-keys
|
||||
|
||||
bind z run-shell "~/.config/tmux/scripts/tmux-zen.sh 120"
|
||||
|
||||
Reference in New Issue
Block a user