k3s #2

Closed
tomas.mirchev wants to merge 10 commits from k3s into main
40 changed files with 1317 additions and 407 deletions

View File

@ -1,108 +1,166 @@
{
"template": {
"htop": {
"link": { "from": "shared/htop", "to": "~/.config/htop" }
"template": {
"htop": {
"link": {
"from": "shared/htop",
"to": "~/.config/htop"
}
},
"bin": {
"link": {
"from": "shared/bin",
"to": "~/bin"
}
},
"vim": {
"link": {
"from": "shared/vim",
"to": "~/.vimrc"
},
"-post-link": "curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && vim -es -u ~/.vimrc -i NONE -c 'PlugInstall' -c 'qa'"
},
"nvim": {
"link": {
"from": "shared/nvim",
"to": "~/.config/nvim/init.lua"
},
"post-link": "(grep -q 'alias vim=nvim' ~/.zshrc || echo 'alias vim=nvim' >> ~/.zshrc) || true"
},
"zsh": {
"link": {
"from": "shared/zsh_root",
"to": "~/.zshrc"
}
},
"zsh_config": {
"link": {
"from": "shared/zsh_config",
"to": "~/.config/zsh"
}
},
"tmux": {
"link": {
"from": "shared/tmux",
"to": "~/.tmux.conf"
}
},
"git": {
"link": {
"from": "shared/git",
"to": "~/.gitconfig"
}
},
"wezterm": {
"link": {
"from": "shared/wezterm",
"to": "~/.wezterm.lua"
}
},
"alacritty": {
"link": {
"from": "shared/alacritty",
"to": "~/.alacritty.toml"
}
},
"ghostty": {
"link": {
"from": "shared/ghostty",
"to": "~/.config/ghostty"
}
}
},
"bin": {
"link": { "from": "shared/bin", "to": "~/bin" }
},
"vim": {
"link": { "from": "shared/vim", "to": "~/.vimrc" },
"-post-link": "curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim && vim -es -u ~/.vimrc -i NONE -c 'PlugInstall' -c 'qa'"
},
"nvim": {
"link": { "from": "shared/nvim", "to": "~/.config/nvim/init.lua" },
"post-link": "(grep -q 'alias vim=nvim' ~/.zshrc || echo 'alias vim=nvim' >> ~/.zshrc) || true"
},
"zsh": {
"link": { "from": "shared/zsh", "to": "~/.zshrc" }
},
"tmux": {
"link": { "from": "shared/tmux", "to": "~/.tmux.conf" }
},
"git": {
"link": { "from": "shared/git", "to": "~/.gitconfig" }
},
"wezterm": {
"link": { "from": "shared/wezterm", "to": "~/.wezterm.lua" }
},
"alacritty": {
"link": { "from": "shared/alacritty", "to": "~/.alacritty.toml" }
},
"ghostty": {
"link": { "from": "shared/ghostty", "to": "~/.config/ghostty" }
"environments": {
"macos": [
"zsh",
"zsh_config",
{
"package": "bin",
"link": {
"from": "macos/bin",
"to": "~/bin"
}
},
"tmux",
"nvim",
"git",
"ghostty",
"alacritty",
{
"package": "karabiner",
"link": {
"from": "macos/karabiner",
"to": "~/.config/karabiner"
}
},
{
"package": "linearmouse",
"link": {
"from": "macos/linearmouse",
"to": "~/.config/linearmouse"
}
},
{
"package": "rectangle",
"link-comment": "Needs manual import from config/macos/linearmouse"
}
],
"linux-vm": [
"zsh_config",
{
"package": "zsh",
"install": "sudo apt install -y zsh",
"post-link": "./scripts/linux-setup_zsh.sh"
},
{
"package": "tmux",
"link": {
"from": "linux-vm/tmux",
"to": "~/.tmux.conf"
},
"install": "sudo apt install -y tmux"
},
{
"package": "nvim",
"install": "bash -c 'wget -O nvim.deb https://gitea.tomastm.com/tomas.mirchev/neovim/releases/download/v0.10.0/nvim-linux-$(dpkg --print-architecture).deb && sudo dpkg -i nvim.deb && rm nvim.deb'"
},
{
"package": "git",
"install": "sudo apt install -y git"
},
{
"package": "htop",
"install": "sudo apt install -y htop"
},
"bin"
],
"linux-dev": [
"zsh_config",
{
"package": "zsh",
"install": "sudo apt install -y zsh",
"post-link": "./scripts/linux-setup_zsh.sh"
},
{
"package": "tmux",
"install": "sudo apt install -y tmux"
},
{
"package": "nvim",
"ignore-template": true,
"link": {
"from": "linux-dev/nvim",
"to": "~/.config/nvim"
},
"post-link": "nvim --headless '+Lazy! restore' '+MasonUpdate' '+TSUpdate' +qa && (grep -q 'alias vim=nvim' ~/.zshrc || echo 'alias vim=nvim' >> ~/.zshrc) || true"
},
{
"package": "git",
"install": "sudo apt install -y git"
},
{
"package": "htop",
"install": "sudo apt install -y htop"
}
]
}
},
"environments": {
"macos": [
"zsh",
"tmux",
"nvim",
"git",
"ghostty",
"alacritty",
{
"package": "karabiner",
"link": { "from": "macos/karabiner", "to": "~/.config/karabiner" }
},
{
"package": "linearmouse",
"link": { "from": "macos/linearmouse", "to": "~/.config/linearmouse" }
},
{
"package": "rectangle",
"link-comment": "Needs manual import from config/macos/linearmouse"
}
],
"linux-vm": [
{
"package": "zsh",
"install": "sudo apt install -y zsh",
"post-link": "./scripts/linux-setup_zsh.sh"
},
{
"package": "tmux",
"link": { "from": "linux-vm/tmux", "to": "~/.tmux.conf" },
"install": "sudo apt install -y tmux"
},
{
"package": "nvim",
"install": "bash -c 'wget -O nvim.deb https://gitea.tomastm.com/tomas.mirchev/neovim/releases/download/v0.10.0/nvim-linux-$(dpkg --print-architecture).deb && sudo dpkg -i nvim.deb && rm nvim.deb'"
},
{
"package": "git",
"install": "sudo apt install -y git"
},
{
"package": "htop",
"install": "sudo apt install -y htop"
},
"bin"
],
"linux-dev": [
{
"package": "zsh",
"install": "sudo apt install -y zsh",
"post-link": "./scripts/linux-setup_zsh.sh"
},
{
"package": "tmux",
"install": "sudo apt install -y tmux"
},
{
"package": "nvim",
"ignore-template": true,
"link": { "from": "linux-dev/nvim", "to": "~/.config/nvim" },
"post-link": "nvim --headless '+Lazy! restore' '+MasonUpdate' '+TSUpdate' +qa && (grep -q 'alias vim=nvim' ~/.zshrc || echo 'alias vim=nvim' >> ~/.zshrc) || true"
},
{
"package": "git",
"install": "sudo apt install -y git"
},
{
"package": "htop",
"install": "sudo apt install -y htop"
}
]
}
}

View File

@ -0,0 +1 @@
require("themes.invero").load()

View File

@ -1,3 +1,22 @@
require('config.options') -- vim options
require('config.keymaps') -- keymaps
require('config.lazy') -- plugin manager and plugins
--[[
Neovim Lua config: ways to set things
- vim.opt : preferred modern API for options (handles lists, cleaner syntax)
- vim.g : global variables (leader key, plugin settings, disable builtins, etc.)
- vim.o : global-only option (rarely needed directly)
- vim.wo : window-local option (applies to current window only, use in autocmds)
- vim.bo : buffer-local option (applies to current buffer only, use in autocmds)
- vim.env : set environment variables (like PATH, LANG)
- vim.fn : call Vimscript functions (e.g. vim.fn.getcwd())
- vim.cmd : run raw Vimscript/Ex commands (e.g. vim.cmd("colorscheme desert"))
- vim.api : low-level Neovim API (create autocmds, keymaps, buffer/window ops, etc.)
TL;DR -> use vim.opt + vim.g in options.lua for defaults.
Use vim.wo/vim.bo only in context-specific tweaks (autocmds).
Use vim.env, vim.fn, vim.cmd, vim.api as needed for scripting.
]]
require("config.options")
require("config.keymaps")
require("config.lazy")
require("config.autocmds")

View File

@ -1,24 +1,22 @@
{
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"conform.nvim": { "branch": "master", "commit": "d28ccf945374edd9f1c34a82f6c22261dbd8ab98" },
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
"nvim-lspconfig": { "branch": "master", "commit": "bc6ada4b0892b7f10852c0b8ca7209fd39a6d754" },
"nvim-treesitter": { "branch": "master", "commit": "7dc8aabe86db8c2f23520e8334f7584f83e84342" },
"nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" },
"nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" },
"schemastore.nvim": { "branch": "main", "commit": "f8d6e9068861888651f68958521b1958314aac41" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" },
"nvim-tree.lua": { "branch": "master", "commit": "321bc61580fd066b76861c32de3319c3a6d089e7" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"schemastore.nvim": { "branch": "main", "commit": "0fccf9234acfd981867cbd42c4101829e6808790" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
}

View File

@ -0,0 +1,128 @@
-- Highlight when yanking (copying) text
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
----------------------------------------------
-- Reload ColorScheme by clearing cached modules
vim.api.nvim_create_user_command("ReloadColorscheme", function()
local current = vim.g.colors_name
if not current then
vim.notify("No colorscheme is currently set", vim.log.levels.WARN)
return
end
-- clear only the cached modules for this theme
for k in pairs(package.loaded) do
if k:match("^themes%." .. current) then
package.loaded[k] = nil
end
end
-- reload it
vim.cmd("colorscheme " .. current)
vim.notify("Reloaded " .. current .. " colorscheme", vim.log.levels.INFO)
end, { desc = "Reload the current colorscheme" })
----------------------------------------------
--[[
Command :TSHighlightRoots (works but uncomment only when used)
Description:
Collects all Tree-sitter highlight groups, resolves their links,
and outputs the unique root groups actually used (for theming/debugging).
Usage:
:TSHighlightRoots -> prints roots in the command line
:TSHighlightRoots <filename> -> writes roots into <filename> (overwrites)
(filename supports ~ and tab-completion)
]]
-- local function resolve_link(name)
-- local seen = {}
-- while name and not seen[name] do
-- seen[name] = true
-- local hl = vim.api.nvim_get_hl(0, { name = name })
-- if hl.link then
-- name = hl.link
-- else
-- return name
-- end
-- end
-- end
--
-- vim.api.nvim_create_autocmd("VimEnter", {
-- callback = function()
-- vim.api.nvim_create_user_command("TSHighlightRoots", function(opts)
-- local roots = {}
-- for _, group in ipairs(vim.fn.getcompletion("@", "highlight")) do
-- local root = resolve_link(group)
-- if root then
-- roots[root] = true
-- end
-- end
--
-- local output = { "Unique root highlight groups used by Tree-sitter:" }
-- for root in pairs(roots) do
-- table.insert(output, " " .. root)
-- end
--
-- if opts.args ~= "" then
-- -- write to file
-- local filename = vim.fn.expand(opts.args)
-- local fd = assert(io.open(filename, "w"))
-- fd:write(table.concat(output, "\n"))
-- fd:close()
-- print("Wrote roots to " .. filename)
-- else
-- -- default: print to command line
-- for _, line in ipairs(output) do
-- print(line)
-- end
-- end
-- end, {
-- nargs = "?", -- allow 0 or 1 argument
-- complete = "file", -- tab-complete filenames
-- })
-- end,
-- })
----------------------------------------------
-- Useful tricks that do not fully work
----------------------------------------------
-- -- Show cursorline only in the active window
--
-- vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, {
-- callback = function()
-- local ft = vim.bo.filetype
-- vim.notify("enter: " .. ft .. " - " .. vim.bo.buftype)
-- -- if not ft:match("^Telescope") and ft ~= "NvimTree" then
-- -- vim.wo.cursorline = true
-- -- end
-- end,
-- })
-- vim.api.nvim_create_autocmd({ "WinLeave", "BufLeave" }, {
-- callback = function()
-- local ft = vim.bo.filetype
-- vim.notify("exit: " .. ft .. " - " .. vim.bo.buftype)
-- -- if not ft:match("^Telescope") and ft ~= "NvimTree" then
-- -- vim.wo.cursorline = false
-- -- end
-- end,
-- })
----------------------------------------------
-- -- Associate filetype
--
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "text",
-- callback = function()
-- vim.bo.filetype = "markdown"
-- end,
-- })

View File

@ -8,4 +8,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
require('lazy').setup('plugins')
require("lazy").setup({
spec = { { import = "plugins" } },
ui = {
backdrop = 100,
border = "rounded"
},
})

View File

@ -3,19 +3,16 @@ vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Use Nerd Font
vim.g.have_nerd_font = true
vim.g.have_nerd_font = false
-- Add vertical line
-- vim.opt.colorcolumn = "100"
vim.opt.laststatus = 3
vim.opt.signcolumn = "no"
-- Enable TrueColor
vim.opt.termguicolors = true
-- Disable Neovim background
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
vim.opt.termguicolors = false
-- Scroll lines/columns
vim.opt.mousescroll = "hor:1,ver:1"
@ -42,7 +39,8 @@ vim.opt.relativenumber = true
vim.opt.mouse = "a"
-- Full path on status line
vim.opt.statusline = "%F%m%r%h%w%=%l,%c %P"
vim.opt.statusline = "%= %F%m%r%h%w ─ (%l,%c %P) %="
vim.opt.fillchars:append({ stl = "", stlnc = "" })
-- Sync clipboard between OS and Neovim
vim.schedule(function()
@ -78,19 +76,5 @@ vim.opt.guicursor = "n-v-i-c:block"
-- Minimal number of screen lines to keep above and below the cursor
vim.opt.scrolloff = 10
-- Highlight when yanking (copying) text
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
vim.diagnostic.config({
severity_sort = true,
severities = {
[vim.diagnostic.severity.ERROR] = 4,
[vim.diagnostic.severity.WARN] = 3,
[vim.diagnostic.severity.INFO] = 2,
[vim.diagnostic.severity.HINT] = 1,
}
})
-- Load the colorscheme
vim.cmd.colorscheme("invero")

View File

@ -1,11 +0,0 @@
return {
"rose-pine/neovim",
name = "rose-pine",
config = function()
require("rose-pine").setup({
disable_background = true,
disable_float_background = true,
})
vim.cmd("colorscheme rose-pine")
end,
}

View File

@ -21,14 +21,20 @@ return {
"neovim/nvim-lspconfig",
dependencies = {
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
{ "williamboman/mason.nvim", version = "1.8.0", config = true },
{ "williamboman/mason-lspconfig.nvim", version = "1.31.0"},
{ "j-hui/fidget.nvim", opts = {} }, -- side fidget showing status
"hrsh7th/cmp-nvim-lsp", -- completion
"b0o/schemastore.nvim",
},
config = function()
require("mason").setup()
require("mason").setup({
ui = {
border = "rounded",
backdrop = 0
},
})
require("mason-lspconfig").setup()
local lspconfig = require("lspconfig")

View File

@ -1,33 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
keys = {
{ "<Leader>et", ":Neotree position=left toggle<CR>", desc = "Explorer Toggle", silent = true },
{ "<Leader>E", ":Neotree focus<CR>", desc = "Explorer Focus", silent = true },
{ "<Leader>ef", ":Neotree float<CR>", desc = "Explorer Float", silent = true },
{ "<Leader>eb", ":Neotree buffers<CR>", desc = "Explorer Buffers", silent = true },
{ "<Leader>eg", ":Neotree git_status<CR>", desc = "Explorer Git", silent = true },
},
opts = {
filesystem = {
follow_current_file = {
enabled = true, -- Enable this feature
leave_dirs_open = true, -- Leave directories open when following
},
filtered_items = {
visible = true,
},
window = {
mappings = {
["<Leader>e"] = "close_window",
},
},
},
},
}

View File

@ -0,0 +1,188 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
keys = {
{ "<Leader>et", ":NvimTreeToggle<CR>", desc = "Explorer Toggle", silent = true },
},
config = function()
require("nvim-tree").setup({
hijack_cursor = true,
disable_netrw = true,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = true,
root_dirs = { ".git", "package.json" },
prefer_startup_root = true,
sync_root_with_cwd = true,
reload_on_bufenter = true,
respect_buf_cwd = true,
view = {
centralize_selection = false,
cursorline = true,
cursorlineopt = "both",
debounce_delay = 15,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "no",
width = 30,
},
renderer = {
add_trailing = false,
group_empty = false,
full_name = false,
root_folder_label = false,
-- special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
special_files = {}, -- keep to overwrite defaults
symlink_destination = true,
icons = {
padding = "",
glyphs = {
folder = {
arrow_closed = "+",
arrow_open = "-",
},
},
show = {
file = false,
folder = false,
folder_arrow = true,
git = false,
modified = false,
hidden = false,
diagnostics = false,
bookmarks = false,
},
},
},
hijack_directories = {
enable = true,
auto_open = true,
},
update_focused_file = {
enable = true,
update_root = {
enable = true,
ignore_list = {},
},
exclude = false,
},
filters = {
enable = true,
git_ignored = true,
dotfiles = false,
git_clean = false,
no_buffer = false,
no_bookmark = false,
custom = {},
exclude = {},
},
live_filter = {
prefix = "[FILTER]: ",
always_show_folders = true,
},
filesystem_watchers = {
enable = true,
debounce_delay = 50,
ignore_dirs = {
-- C / C++
"/.ccls-cache",
"/build",
"/out",
"/cmake-build-*",
-- Node.js / Web
"/node_modules",
"/dist",
"/.next",
"/.nuxt",
"/coverage",
"/storybook-static",
-- Rust
"/target",
-- Java / JVM
"/target", -- (Maven)
"/build", -- (Gradle)
"/out", -- (IDEA / javac)
-- Python
"/.venv",
"/venv",
"/__pycache__",
"/.mypy_cache",
"/.pytest_cache",
-- Go
"/bin",
"/pkg",
-- General
"/tmp",
"/.cache",
"/.idea",
"/.vscode",
"/logs",
},
},
trash = {
cmd = "gio trash",
},
})
end,
}
-- return {
-- "nvim-neo-tree/neo-tree.nvim",
-- version = "*",
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "nvim-tree/nvim-web-devicons",
-- "MunifTanjim/nui.nvim",
-- },
-- cmd = "Neotree",
-- keys = {
-- { "<Leader>et", ":Neotree position=left toggle<CR>", desc = "Explorer Toggle", silent = true },
-- { "<Leader>E", ":Neotree focus<CR>", desc = "Explorer Focus", silent = true },
-- { "<Leader>ef", ":Neotree float<CR>", desc = "Explorer Float", silent = true },
-- { "<Leader>eb", ":Neotree buffers<CR>", desc = "Explorer Buffers", silent = true },
-- { "<Leader>eg", ":Neotree git_status<CR>", desc = "Explorer Git", silent = true },
-- },
-- opts = {
-- event_handlers = {
-- {
-- event = require("neo-tree.ui.events").NEO_TREE_WINDOW_AFTER_OPEN,
-- handler = function(args)
-- if args and args.winid and vim.api.nvim_win_is_valid(args.winid) then
-- vim.api.nvim_win_set_option(args.winid, "colorcolumn", "")
-- vim.api.nvim_win_set_option(args.winid, "signcolumn", "no")
-- end
-- end,
-- },
-- },
-- popup_border_style = "single",
-- window = {
-- mappings = {
-- ["<Leader>e"] = "close_window",
-- },
-- },
-- default_component_configs = {
-- icon = { enabled = false },
-- git_status = { symbols = {}, align = "none" },
-- name = { trailing_slash = true }
-- },
-- enable_git_status = false,
-- enable_diagnostics = false,
-- filesystem = {
-- follow_current_file = {
-- enabled = true, -- Enable this feature
-- leave_dirs_open = true, -- Leave directories open when following
-- },
-- filtered_items = {
-- visible = true,
-- }
-- },
-- },
-- }

View File

@ -1,69 +1,30 @@
local remap = require("utils.remap")
return { -- Fuzzy Finder (files, lsp, etc)
return {
"nvim-telescope/telescope.nvim",
event = "VimEnter",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
{
"nvim-telescope/telescope-fzf-native.nvim",
-- `build` is used to run some command when the plugin is installed/updated.
-- This is only run then, not every time Neovim starts up.
build = "make",
-- `cond` is a condition used to determine whether this plugin should be
-- installed and loaded.
cond = function()
return vim.fn.executable("make") == 1
end,
},
{ "nvim-telescope/telescope-ui-select.nvim" },
-- Useful for getting pretty icons, but requires a Nerd Font.
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
-- { "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
},
config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- The easiest way to use Telescope, is to start by doing something like:
-- :Telescope help_tags
--
-- After running this command, a window will open up and you're able to
-- type in the prompt window. You'll see a list of `help_tags` options and
-- a corresponding preview of the help.
--
-- Two important keymaps to use while in Telescope are:
-- - Insert mode: <c-/>
-- - Normal mode: ?
--
-- This opens a window that shows you all of the keymaps for the current
-- Telescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require("telescope").setup({
-- You can put your default mappings / updates / etc. in here
-- All the info you're looking for is in `:help telescope.setup()`
--
-- defaults = {
-- mappings = {
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
-- },
-- },
-- pickers = {}
defaults = {
layout_strategy = "vertical",
layout_config = {
-- vertical = { width = 0.5 }
-- horizontal = {
-- width = 0.9,
-- preview_width = 0.5,
-- },
width = { 0.95, max = 100 },
height = 0.95,
preview_cutoff = 1,
preview_height = 0.7,
},
mappings = {
n = {
@ -73,7 +34,6 @@ return { -- Fuzzy Finder (files, lsp, etc)
},
})
-- Enable Telescope extensions if they are installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")

View File

@ -1,34 +1,32 @@
return {
'nvim-treesitter/nvim-treesitter',
build = 'TSUpdate',
main = 'nvim-treesitter.configs',
opts = {
ensure_installed = {
'diff',
'lua',
'html',
'css',
'javascript',
'typescript',
'tsx',
'markdown',
'markdown_inline'
},
auto_install = true,
highlight = {
enable = true,
},
indent = { enable = true }
},
config = function(_, opts)
require('nvim-treesitter.configs').setup(opts)
-- Add MDX filetype detection
vim.filetype.add({
extension = {
mdx = 'markdown.mdx',
},
})
end,
"nvim-treesitter/nvim-treesitter",
build = "TSUpdate",
main = "nvim-treesitter.configs",
opts = {
ensure_installed = {
"diff",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"markdown",
"markdown_inline",
},
auto_install = true,
highlight = {
enable = true,
},
indent = { enable = true },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
-- Add MDX filetype detection
vim.filetype.add({
extension = {
mdx = "markdown.mdx",
},
})
end,
}

View File

@ -0,0 +1,19 @@
local M = {}
function M.get(P)
local colors = {
base = P.white,
surface = P.gray_light,
outline = P.gray_dark,
text = P.black,
muted = P.gray,
accent = P.blue,
accent_light = P.blue_light,
syntax = P.slate_indigo,
none = "NONE",
}
return vim.tbl_extend("force", P, colors)
end
return M

View File

@ -0,0 +1,32 @@
local M = {}
function M.get(C)
return {
Normal = { fg = C.text, bg = C.none },
Directory = { fg = C.accent },
Question = { fg = C.text },
LineNr = { fg = C.muted },
CursorLineNr = { fg = C.accent, bold = true },
CursorLine = { bg = C.surface },
Visual = { bg = C.accent_light },
Search = { fg = C.yellow },
CurSearch = { fg = C.yellow, bg = C.none, bold = true },
IncSearch = { fg = C.yellow, bg = C.none, bold = true },
MatchParen = { fg = C.accent, bg = C.accent_light, bold = true },
EndOfBuffer = { fg = C.base }, -- End-of-buffer marker (~ lines)
WinSeparator = { fg = C.outline },
StatusLine = { fg = C.outline, bg = C.none }, -- Active statusline (where filename)
MsgArea = { fg = C.text, bg = C.none }, -- Command-line / message area
MsgSeparator = { fg = C.text, bg = C.surface }, -- Separator for messages
ModeMsg = { fg = C.text },
TabLine = { fg = C.muted }, -- Unselected tab
TabLineSel = { fg = C.text, bold = true }, -- Selected tab
TabLineFill = { bg = C.none }, -- Empty space in the tabline
}
end
return M

View File

@ -0,0 +1,7 @@
local M = {}
function M.get(C)
return {}
end
return M

View File

@ -0,0 +1,9 @@
local M = {}
function M.get(C)
return {
TelescopeMatching = { fg = C.yellow, bg = C.none, bold = true },
}
end
return M

View File

@ -0,0 +1,20 @@
local M = {}
function M.get(C)
return {
["@constant.macro"] = { fg = C.syntax },
["@function.method"] = { fg = C.syntax },
["@type.qualifier"] = { fg = C.syntax },
["@variable.parameter"] = { fg = C.syntax },
["@variable"] = { fg = C.syntax },
["@type.definition"] = { fg = C.syntax },
["@markup.italic"] = { fg = C.syntax },
["@markup.strong"] = { fg = C.syntax },
["@markup.underline"] = { fg = C.syntax },
["@markup.strikethrough"] = { fg = C.syntax },
["@_jsx_attribute"] = { link = "Constant" },
}
end
return M

View File

@ -0,0 +1,38 @@
local M = {}
function M.get(C)
return {
Comment = { fg = C.muted, italic = true },
String = { fg = C.green },
Boolean = { fg = C.accent, bold = true, italic = true },
Number = { fg = C.accent },
-- syntax color
Constant = { fg = C.syntax },
Function = { fg = C.syntax },
Type = { fg = C.syntax },
Statement = { fg = C.syntax },
Identifier = { fg = C.syntax },
Operator = { fg = C.syntax },
PreProc = { fg = C.syntax },
Special = { fg = C.syntax },
Delimiter = { fg = C.syntax },
Todo = { fg = C.syntax },
Title = { fg = C.syntax },
Underlined = { fg = C.syntax },
-- diffs
Added = { fg = C.green },
Removed = { fg = C.red },
Changed = { fg = C.yellow },
-- diagnostics
DiagnosticInfo = { fg = C.blue },
DiagnosticWarn = { fg = C.yellow },
DiagnosticError = { fg = C.red },
DiagnosticDeprecated = { fg = C.magenta },
DiagnosticUnderlineError = { fg = C.syntax, underline = true },
}
end
return M

View File

@ -0,0 +1,31 @@
local M = {}
function M.get(C)
return {
terminal_color_0 = { fg = C.black },
terminal_color_8 = { fg = C.black },
terminal_color_1 = { fg = C.red },
terminal_color_9 = { fg = C.red },
terminal_color_2 = { fg = C.green },
terminal_color_10 = { fg = C.green },
terminal_color_3 = { fg = C.yellow },
terminal_color_11 = { fg = C.yellow },
terminal_color_4 = { fg = C.blue },
terminal_color_12 = { fg = C.blue },
terminal_color_5 = { fg = C.magenta },
terminal_color_13 = { fg = C.magenta },
terminal_color_6 = { fg = C.cyan },
terminal_color_14 = { fg = C.cyan },
terminal_color_7 = { fg = C.white },
terminal_color_15 = { fg = C.white },
}
end
return M

View File

@ -0,0 +1,14 @@
local M = {
name = "invero",
variant = "light",
mode = "ansi",
exclude_integrations = {},
}
function M.load()
local setup = require("themes." .. M.name .. ".setup")
setup.reset(M)
setup.apply(M)
end
return M

View File

@ -0,0 +1,53 @@
local M = {}
local modes = {
ansi = {
black = 0,
red = 1,
green = 2,
yellow = 3,
blue = 4,
magenta = 5,
cyan = 6,
white = 7,
},
default = {
black = 238,
red = 196,
green = 35,
yellow = 221,
blue = 27,
magenta = 125,
cyan = 30,
white = 255,
},
}
local shared_palette = {
gray_dark = 245,
gray = 247,
gray_light = 253,
orange = 166,
orange_light = 180,
yellow_light = 180,
blue_light = 153,
slate_indigo = 60,
}
---Get color palette
---@param mode '"ansi"'|'"default"'
---@return table
function M.get(mode)
local mode_palette = modes[mode]
if not mode_palette then
vim.notify(
string.format('Invalid palette mode: "%s" (valid: ansi, default)', tostring(mode)),
vim.log.levels.WARN,
{ title = "palette" }
)
mode_palette = modes.default
end
return vim.tbl_extend("force", mode_palette, shared_palette)
end
return M

View File

@ -0,0 +1,72 @@
local M = {}
function M.reset(theme)
vim.opt.background = (theme.variant == "light") and "light" or "dark"
vim.g.colors_name = theme.name
end
local function list_integrations(theme_name)
local path = vim.fn.stdpath("config") .. "/lua/themes/" .. theme_name .. "/groups/integrations/"
local files = {}
for name, type in vim.fs.dir(path) do
if type == "file" then
local mod_name = vim.fn.fnamemodify(name, ":r")
table.insert(files, mod_name)
end
end
return files
end
function M.apply(theme)
local base = "themes." .. theme.name
local P = require(base .. ".palette").get(theme.mode)
local C = require(base .. ".colors").get(P)
local modules = {
require(base .. ".groups.editor"),
require(base .. ".groups.syntax"),
require(base .. ".groups.terminal"),
}
local exclude = theme.exclude_integrations or {}
local function should_load(name)
return not vim.tbl_contains(exclude, name)
end
-- auto-discover integrations
for _, plugin in ipairs(list_integrations(theme.name)) do
if should_load(plugin) then
local ok_mod, mod = pcall(require, base .. ".groups.integrations." .. plugin)
if ok_mod then
table.insert(modules, mod)
end
end
end
-- Apply highlights
for _, mod in ipairs(modules) do
local groups = mod.get(C) or {}
for group, opts in pairs(groups) do
if type(opts) ~= "table" then
print("Non-table opts detected in group:", group, "value:", vim.inspect(opts))
end
local hl = {}
for k, v in pairs(opts) do
if k == "fg" then
hl.ctermfg = v
elseif k == "bg" then
hl.ctermbg = v
else
hl[k] = v -- bold, italic, underline, sp, etc.
end
end
vim.api.nvim_set_hl(0, group, hl)
end
end
end
return M

71
config/linux-dev/tmux Normal file
View File

@ -0,0 +1,71 @@
# Change the prefix from 'C-b' to 'C-Space'
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefix
set-option -g set-clipboard on
set -g default-terminal "xterm-256color"
#set -as terminal-features ",*:RGB"
# set-option -a terminal-features 'xterm-256color:RGB'
set-option -sg escape-time 10
set-option -g repeat-time 0
set-option -g focus-events on
# Set the base index for windows and panes to 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Increase scrollback buffer size
set -g history-limit 10000
# Light theme with transparent background
set -g status-style bg=default,fg='#4c4f69'
set -g status-left '#[fg=blue,bold][#S] '
set -g status-left-length 50
set -g status-right ''
# set -g pane-border-status bottom # or 'bottom' if status is at top
# set -g pane-border-format '─' # This will fill the entire width automatically
# Window status format - light theme with terminal blue
setw -g window-status-format '#[fg=#6c6f85]#I#[fg=#9ca0b0]:#[fg=#4c4f69]#W#[fg=#9ca0b0]#F'
setw -g window-status-current-format '#[fg=blue,bold]#I#[fg=#9ca0b0]:#[fg=blue,bold]#W#[fg=#9ca0b0]#F'
# Pane border - light theme
set -g pane-border-style fg='#ccd0da'
set -g pane-active-border-style fg=blue
# Message text - light theme
set -g message-style bg='#eff1f5',fg=blue
# Copy mode colors - light theme
setw -g mode-style bg='#acb0be',fg='#4c4f69'
# Enable mouse support
setw -g mouse on
# Fix scroll. Use N3 instead of N1 to make it quicker
bind-key -T copy-mode-vi WheelUpPane send -N1 -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
# Update terminal titles
set-option -g set-titles off
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind -T copy-mode-vi v send-keys -X begin-selection
# Pane navigation using vim-like keys
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# Automatically renumber windows when one is closed
set -g renumber-windows on
# Reload tmux config
bind r source-file ~/.tmux.conf \; display "Reloaded!"

View File

@ -1,7 +1,7 @@
# Change the prefix from 'C-b' to 'C-Space'
unbind C-b
set-option -g prefix C-f
bind-key C-f send-prefix
set-option -g prefix C-Space
bind-key C-Space send-prefix
set-option -g set-clipboard on
@ -19,20 +19,24 @@ setw -g pane-base-index 1
# Increase scrollback buffer size
set -g history-limit 10000
# Customize the status bar
set -g status-style bg=default,fg=white
set -g status-left '#[fg=cyan,bold][#S] '
# Customize the status bar for Catppuccin Latte
set -g status-style bg=default,fg='#4c4f69' # Catppuccin Latte text color
set -g status-left '#[fg=#1e66f5,bold][#S] ' # Catppuccin Latte blue for session
set -g status-left-length 50
set -g status-right ''
# Window status format
setw -g window-status-format '#[fg=white,dim]#I#[fg=grey]:#[fg=white]#W#[fg=grey]#F'
setw -g window-status-current-format '#[fg=cyan,bold]#I#[fg=blue]:#[fg=cyan]#W#[fg=grey]#F'
# Optional: Style the window tabs to match
set -g window-status-current-style 'fg=#4c4f69,bold' # Active window - dark text, bold
set -g window-status-style 'fg=#6c6f85' # Inactive windows - lighter text
set -g window-status-separator ' | ' # Clean separator
# Pane border
set -g pane-border-style fg=colour240
set -g pane-active-border-style fg=cyan
# Optional: Style the borders to match (if you use pane borders)
set -g pane-border-style 'fg=#ccd0da' # Light border for inactive panes
set -g pane-active-border-style 'fg=#1e66f5' # Blue border for active pane
set -g status-left-length 20
set -g status-right-length 20
set -g pane-border-format ""
# Message text
set -g message-style bg=default,fg=cyan
@ -45,6 +49,7 @@ bind-key -T copy-mode-vi WheelDownPane send -N1 -X scroll-down
# Update terminal titles
set-option -g set-titles on
set-option -g set-titles-string "#S"
# Use vim keybindings in copy mode
setw -g mode-keys vi

79
config/macos/bin/vm Executable file
View File

@ -0,0 +1,79 @@
#!/usr/bin/env bash
# ~/bin/vm
#
# SSH helper script for connecting to VMs or workstations.
# Usage:
# vm [--no-tmux] <host>
#
# Host patterns:
# personal-orb -> ssh $USER@personal@orb
# personal-utm -> ssh $USER@personal.utm.local
# personal-workstation -> ssh $USER@personal.workstation.lan
#
# Optional:
# --no-tmux -> skips attaching to tmux session
# TMP: Tmux will be disabled (switch to 0 to enable it again)
skip_tmux=1
# Check for --no-tmux flag
if [[ "$1" == "--no-tmux" ]]; then
skip_tmux=1
shift
fi
full="$1"
shift # remove host from args
user="$USER"
host="$full"
# Split user@host if explicitly specified
if [[ "$full" == *@* ]]; then
user="${full%@*}"
host="${full#*@}"
fi
# Map host patterns to SSH target and tmux session
case "$host" in
*-orb)
ssh_host="${host%-orb}@orb"
tmux_session="$host"
;;
*-utm)
ssh_host="${host%-utm}.utm.local"
tmux_session="$host"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
*-workstation)
ssh_host="${host%-workstation}.workstation.lan"
tmux_session="$host"
ssh_identity="$HOME/.ssh/id_ed25519_internal"
;;
*)
echo "Error: unknown host pattern '$host'" >&2
exit 1
;;
esac
# Build SSH command safely using an array
ssh_cmd=(ssh -tt)
# Include identity file if needed
[[ -n "$ssh_identity" ]] && ssh_cmd+=(-i "$ssh_identity" -o IdentitiesOnly=yes)
# Add target user and host
ssh_cmd+=("$user@$ssh_host")
# Add tmux session unless skipped
if [[ $skip_tmux -eq 0 ]]; then
ssh_cmd+=("tmux" "new" "-A" "-s" "$tmux_session")
else
# Pass through any extra args user supplied
ssh_cmd+=("$@")
fi
# Replace current shell with SSH command
# echo "Executing: ${ssh_cmd[*]}" >&2
exec "${ssh_cmd[@]}"

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
file=/tmp/vm-switch.txt
# Ensure the file exists
touch "$file"
echo "Listening on $file ..."
tail -n0 -F "$file" | while read vm; do
[ -n "$vm" ] && echo "Switch requested: $vm" && ~/bin/work "$vm" &
done

3
config/macos/bin/vmlist-sync Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
orbctl list > /tmp/vmlist.txt

10
config/macos/bin/work Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
# Usage: work <vm>
vm="$1"
if [ -z "$vm" ]; then
echo "Usage: work <vm>"
exit 1
fi
exec vm "${vm}-orb"

View File

@ -0,0 +1,43 @@
{
"profiles": [
{
"devices": [
{
"identifiers": { "is_keyboard": true },
"simple_modifications": [
{
"from": { "key_code": "non_us_backslash" },
"to": [{ "key_code": "grave_accent_and_tilde" }]
}
]
},
{
"identifiers": {
"is_keyboard": true,
"product_id": 49164,
"vendor_id": 7276
},
"simple_modifications": [
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "left_option" }]
},
{
"from": { "key_code": "left_option" },
"to": [{ "key_code": "left_command" }]
}
]
}
],
"name": "Default profile",
"selected": true,
"simple_modifications": [
{
"from": { "key_code": "caps_lock" },
"to": [{ "key_code": "left_control" }]
}
],
"virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
}
]
}

View File

@ -0,0 +1,44 @@
{
"global": { "show_in_menu_bar": false },
"profiles": [
{
"devices": [
{
"identifiers": { "is_keyboard": true },
"simple_modifications": [
{
"from": { "key_code": "non_us_backslash" },
"to": [{ "key_code": "grave_accent_and_tilde" }]
}
]
},
{
"identifiers": {
"is_keyboard": true,
"product_id": 49164,
"vendor_id": 7276
},
"simple_modifications": [
{
"from": { "key_code": "left_command" },
"to": [{ "key_code": "left_option" }]
},
{
"from": { "key_code": "left_option" },
"to": [{ "key_code": "left_command" }]
}
]
}
],
"name": "Default profile",
"selected": true,
"simple_modifications": [
{
"from": { "key_code": "caps_lock" },
"to": [{ "key_code": "left_control" }]
}
],
"virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
}
]
}

View File

@ -1,4 +1,5 @@
{
"global": { "show_in_menu_bar": false },
"profiles": [
{
"devices": [
@ -25,6 +26,14 @@
{
"from": { "key_code": "left_option" },
"to": [{ "key_code": "left_command" }]
},
{
"from": { "key_code": "escape" },
"to": [{ "key_code": "grave_accent_and_tilde" }]
},
{
"from": { "key_code": "grave_accent_and_tilde" },
"to": [{ "key_code": "escape" }]
}
]
}

View File

@ -1,49 +1,42 @@
theme = catppuccin-frappe
# Terminal
term = "xterm-256color"
term = xterm-256color
# Fonts
font-family = "JetBrains Mono NL"
font-size = 14
font-family = "Maple Mono NF"
#font-size = 14
font-thicken = true
# Cell width (affects letter spacing)
adjust-cell-width = -1
adjust-cell-height = -1
adjust-font-baseline = -1
# Cursor
cursor-style-blink = false
cursor-style = block
shell-integration-features = no-cursor
# Icon
# macos-icon = custom-style
# macos-icon-frame = plastic
# macos-icon-ghost-color = cba6f7
# macos-icon-screen-color = 181825
#font-thicken-strength = 2
adjust-box-thickness = 2
# Window
#background = #181818
#background = #000000
#window-theme = dark
window-width = 100
window-height = 26
window-padding-x = 4
window-padding-y = 2
window-colorspace = display-p3
window-padding-x = 0
window-padding-y = 0
window-height = 50
window-width = 120
window-step-resize = true
window-padding-balance = false
# window-padding-color = extend
# Icon
macos-icon = custom
# Cursor
cursor-style = block
cursor-style-blink = false
mouse-hide-while-typing = true
shell-integration-features = no-cursor
# Font/Cell quality
window-colorspace = srgb
alpha-blending = linear-corrected
macos-titlebar-style = native
#macos-titlebar-style = transparent
adjust-cell-width = -1
#adjust-cell-height = -2
# Resize by row
#window-step-resize = true
#window-padding-balance = true
# Background
# Theme
background = #eeeeee
foreground = #434343
window-theme = auto
background-opacity = 1
background-blur-radius = 0
background-blur = false

View File

@ -20,6 +20,8 @@ local function nmap(lhs, rhs, opts) map("n", lhs, rhs, opts) end
local function imap(lhs, rhs, opts) map("i", lhs, rhs, opts) end
local function vmap(lhs, rhs, opts) map("v", lhs, rhs, opts) end
local function tmap(lhs, rhs, opts) map("t", lhs, rhs, opts) end
vim.opt.signcolumn = "no"
-- Map Leader
vim.g.mapleader = " "

View File

@ -1,81 +0,0 @@
# Add /bin to path
export PATH="$PATH:$HOME/bin"
# Set locales
export LANGUAGE="en_US:en"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
autoload -Uz compinit && compinit # Autocomplete
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case Insensitive
setopt autocd # cd without it
setopt share_history
# Set terminal title to hostname
echo -n -e "\033]0;SSH: $(hostname)\007"
# Git prompt function
git_prompt_info() {
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)
echo " %F{green}($branch)%f"
fi
}
# Set up the prompt
setopt PROMPT_SUBST # Dyna
PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '
# Disable the log builtin, so we don't conflict with /usr/bin/log
disable log
# Save command history
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
setopt HIST_IGNORE_ALL_DUPS
# Load functions
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
# Bind both common escape sequences
bindkey '^[[A' up-line-or-beginning-search # normal mode
bindkey '^[OA' up-line-or-beginning-search # application mode
bindkey '^[[B' down-line-or-beginning-search # normal mode
bindkey '^[OB' down-line-or-beginning-search # application mode
# Aliases for ls
OS_TYPE=$(uname)
if [[ "$OS_TYPE" == "Linux" ]]; then
alias ls='ls --color=auto --group-directories-first'
elif [[ "$OS_TYPE" == "Darwin" ]]; then
alias ls='ls --color=auto'
fi
alias ll='ls -lF'
alias lla='ll -a'
alias ld='ls -ld */' # List only directories
# Aliases for git
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gcm='git commit -m'
alias gam='git commit -am'
alias gco='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
alias glg='git log --graph --oneline --decorate --all'
alias gm='git merge'
alias grb='git rebase'
alias grs='git reset'
alias grv='git remote -v'
alias tree='tree -I node_modules'

View File

@ -0,0 +1,45 @@
# -----------------------------
# OS-specific aliases for ls
# -----------------------------
OS_TYPE=$(uname)
if [[ "$OS_TYPE" == "Linux" ]]; then
alias ls='ls --color=auto --group-directories-first'
elif [[ "$OS_TYPE" == "Darwin" ]]; then
alias ls='ls --color=auto'
fi
alias ll='ls -lF'
alias lla='ll -a'
alias ld='ls -ld */'
# -----------------------------
# Vim / Neovim
# -----------------------------
if command -v nvim >/dev/null 2>&1; then
alias vim='nvim'
else
alias vim='vim'
fi
# -----------------------------
# Git aliases
# -----------------------------
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gcm='git commit -m'
alias gam='git commit -am'
alias gco='git checkout'
alias gd='git diff'
alias gf='git fetch'
alias gl='git pull'
alias gp='git push'
alias gst='git status'
alias glg='git log --graph --oneline --decorate --all'
alias gm='git merge'
alias grb='git rebase'
alias grs='git reset'
alias grv='git remote -v'
alias tree='tree -I node_modules'

View File

@ -0,0 +1,15 @@
# -----------------------------
# ZLE functions
# -----------------------------
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
bindkey '^[OA' up-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
bindkey '^[OB' down-line-or-beginning-search
bindkey '^U' backward-kill-line

View File

@ -0,0 +1,15 @@
# -----------------------------
# Git prompt function
# -----------------------------
git_prompt_info() {
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
local branch=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)
echo " %F{green}($branch)%f"
fi
}
# -----------------------------
# Set prompt
# -----------------------------
PROMPT='%n@%m%f %F{blue}%~%f$(git_prompt_info) $ '

View File

@ -0,0 +1,48 @@
# -----------------------------
# PATH
# -----------------------------
export PATH="$PATH:$HOME/bin"
# -----------------------------
# Locales
# -----------------------------
export LANGUAGE="en_US:en"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# -----------------------------
# Autocomplete
# -----------------------------
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive
# -----------------------------
# Shell options
# -----------------------------
setopt autocd
setopt share_history
setopt interactivecomments
setopt PROMPT_SUBST # Enable dynamic prompt expansion
# -----------------------------
# Disable conflicting builtins
# -----------------------------
disable log
# -----------------------------
# History
# -----------------------------
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
setopt HIST_IGNORE_ALL_DUPS
# -----------------------------
# Source modular components
# -----------------------------
CONFIG_DIR="$HOME/.config/zsh"
[ -f "$CONFIG_DIR/aliases" ] && source "$CONFIG_DIR/aliases"
[ -f "$CONFIG_DIR/prompt" ] && source "$CONFIG_DIR/prompt"
[ -f "$CONFIG_DIR/keybindings" ] && source "$CONFIG_DIR/keybindings"

View File