diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..90f4fd7 --- /dev/null +++ b/TODO.md @@ -0,0 +1,3 @@ +alacritty,borders,ghostty,htop,karabiner,linearmouse,nvim,sol,wezterm + +- fix nvim in terminal nvim exit sequences diff --git a/config/linux-dev/nvim/lsp/json_ls.lua b/config/linux-dev/nvim/lsp/json_ls.lua deleted file mode 100644 index 799435f..0000000 --- a/config/linux-dev/nvim/lsp/json_ls.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - cmd = { "vscode-json-language-server", "--stdio" }, - filetypes = { "json", "jsonc" }, - init_options = { - provideFormatter = true, - }, - root_markers = { ".git" }, -} diff --git a/config/shared/ghostty/Ghostty.icns b/config/macos/ghostty/Ghostty.icns similarity index 100% rename from config/shared/ghostty/Ghostty.icns rename to config/macos/ghostty/Ghostty.icns diff --git a/config/shared/ghostty/config b/config/macos/ghostty/config similarity index 100% rename from config/shared/ghostty/config rename to config/macos/ghostty/config diff --git a/config/shared/ghostty/themes/Invero Day b/config/macos/ghostty/themes/Invero Day similarity index 100% rename from config/shared/ghostty/themes/Invero Day rename to config/macos/ghostty/themes/Invero Day diff --git a/config/shared/wezterm/wezterm.lua b/config/macos/wezterm/wezterm.lua similarity index 100% rename from config/shared/wezterm/wezterm.lua rename to config/macos/wezterm/wezterm.lua diff --git a/config/shared/window-tagger/contents/code/main.js b/config/macos/window-tagger/contents/code/main.js similarity index 100% rename from config/shared/window-tagger/contents/code/main.js rename to config/macos/window-tagger/contents/code/main.js diff --git a/config/shared/window-tagger/metadata.json b/config/macos/window-tagger/metadata.json similarity index 100% rename from config/shared/window-tagger/metadata.json rename to config/macos/window-tagger/metadata.json diff --git a/config/shared/window-tagger/path.txt b/config/macos/window-tagger/path.txt similarity index 100% rename from config/shared/window-tagger/path.txt rename to config/macos/window-tagger/path.txt diff --git a/config/shared/alacritty b/config/shared/alacritty deleted file mode 100644 index 3cdd656..0000000 --- a/config/shared/alacritty +++ /dev/null @@ -1,40 +0,0 @@ -live_config_reload = true - -[env] -TERM = "xterm-256color" - -[font] -normal = { family = "SF Mono", style = "Regular" } -size = 12 -offset = { x = 0, y = 0 } - -[window] -decorations_theme_variant = "Dark" -padding = { x = 4, y = 0 } -dynamic_padding = false -resize_increments = true - -[keyboard] -bindings = [ - # Create new window - { action = "SpawnNewInstance", key = "N", mods = "Command" }, - # Jump back one word - { key = "Left", mods = "Alt", chars = "\u001bb" }, - # Jump forward one word - { key = "Right", mods = "Alt", chars = "\u001bf" }, - # Move to start of line - { key = "Left", mods = "Command", chars = "\u0001" }, - # Move to end of line - { key = "Right", mods = "Command", chars = "\u0005" }, - - # Delete backwards - { key = "Back", mods = "Alt", chars = "\u001B\u007F" }, # word - { key = "Back", mods = "Command", chars = "\u0015" }, # line - - # Delete forwards - { key = "Delete", mods = "Alt", chars = "\u001Bd" }, # word - { key = "Delete", mods = "Command", chars = "\u000B" } # line -] - -[scrolling] -multiplier = 1 diff --git a/config/shared/foot/foot.ini b/config/shared/foot/foot.ini deleted file mode 100644 index ea3bc9b..0000000 --- a/config/shared/foot/foot.ini +++ /dev/null @@ -1,16 +0,0 @@ -font=monospace:size=10 -pad=4x0 -[key-bindings] -# scrollback-up-page=Shift+Page_Up Shift+KP_Page_Up -# scrollback-up-half-page=none -# scrollback-up-line=none -# scrollback-down-page=Shift+Page_Down Shift+KP_Page_Down -# scrollback-down-half-page=none -# scrollback-down-line=none -# scrollback-home=none -# scrollback-end=none -clipboard-copy=Control+c XF86Copy -clipboard-paste=Control+v XF86Paste - -[text-bindings] -\x03=Mod4+c diff --git a/config/shared/nvim b/config/shared/nvim deleted file mode 100644 index ecae856..0000000 --- a/config/shared/nvim +++ /dev/null @@ -1,161 +0,0 @@ --- Helper function for key mappings -local function map(mode, lhs, rhs, opts) - local options = { silent = true, noremap = true } - - if opts then - options = vim.tbl_extend("force", options, opts) - end - - if type(mode) == "table" then - for _, m in ipairs(mode) do - vim.keymap.set(m, lhs, rhs, options) - end - else - vim.keymap.set(mode, lhs, rhs, options) - end -end - --- Mode-specific mapping functions -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 = " " -vim.g.maplocalleader = " " - --- Use Nerd Font -vim.g.have_nerd_font = true - --- Add vertical line --- vim.opt.colorcolumn = "100" - --- 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" }) - --- Scroll lines/columns -vim.opt.mousescroll = "hor:1,ver:1" - --- Set indentation preferences -vim.opt.expandtab = true -- Convert tabs to spaces -vim.opt.shiftwidth = 2 -- Number of spaces for auto-indent -vim.opt.tabstop = 2 -- Number of spaces a tab counts for -vim.opt.softtabstop = 2 -- Number of spaces a tab counts for when editing -vim.opt.autoindent = true -- Copy indent from current line when starting new line -vim.opt.smartindent = true -- Do smart autoindenting when starting a new line - --- Disable line wrapping -vim.opt.wrap = false - --- Enable break indent -vim.opt.breakindent = true - --- Make line numbers default -vim.opt.number = true -vim.opt.relativenumber = true - --- Enable mouse mode, can be useful for resizing splits for example -vim.opt.mouse = "a" - --- Full path on status line -vim.opt.statusline = "%F%m%r%h%w%=%l,%c %P" - --- Sync clipboard between OS and Neovim -vim.schedule(function() - vim.opt.clipboard = "unnamedplus" -end) - --- Save undo history -vim.opt.undofile = true - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = true - --- Sets how neovim will display certain whitespace characters in the editor. -vim.opt.list = true -vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } - --- Preview substitutions live, as you type -vim.opt.inccommand = "split" - --- Show which line your cursor is on -vim.opt.cursorline = true - --- 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, -}) - --- Keymaps - -nmap("q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) - -imap("jk", "", { desc = "Exit insert mode with jk" }) -nmap("", "nohlsearch", { desc = "Clear highlights" }) - --- Prevent "x" from overriding the register -nmap("x", '"_x') - --- Window Navigation -nmap("", "h", { desc = "Move focus to the left window" }) -nmap("", "l", { desc = "Move focus to the right window" }) -nmap("", "j", { desc = "Move focus to the lower window" }) -nmap("", "k", { desc = "Move focus to the upper window" }) - --- Tab management -nmap("tn", ":tabnew", { desc = "[T]ab [N]ew" }) -nmap("tc", ":tabclose", { desc = "[T]ab [C]lose" }) -nmap("to", ":tabonly", { desc = "[T]ab [O]nly" }) -nmap("tl", ":tabnext", { desc = "[T]ab Next" }) -nmap("th", ":tabprevious", { desc = "[T]ab Previous" }) -nmap("tm.", ":tabmove +1", { desc = "[T]ab [M]ove Right" }) -nmap("tm,", ":tabmove -1", { desc = "[T]ab [M]ove Left" }) -for i = 1, 9 do - nmap(string.format("%d", i), string.format("%dgt", i), { desc = string.format("[T]ab %d", i) }) -end - --- Buffer Management -nmap("bl", ":ls", { desc = "[B]uffer [L]ist" }) -nmap("bd", ":bdelete", { desc = "[B]uffer [D]elete" }) -nmap("]b", ":bnext", { desc = "[B]uffer [N]ext" }) -nmap("[b", ":bprevious", { desc = "[B]uffer [P]revious" }) -nmap("bb", ":b", { desc = "[B]uffer Select" }) -nmap("bo", ":bufdo bd|1bd", { desc = "[B]uffer Delete Others" }) - --- Terminal -nmap("tet", function() - vim.cmd("terminal") - vim.cmd("startinsert") -end, { desc = "[T]erminal" }) -nmap("ter", function() - local buf_dir = vim.fn.expand("%:p:h") - vim.cmd("edit term://" .. buf_dir .. "//zsh") - vim.cmd("startinsert") -end, { desc = "[T]erminal [R]elative" }) -tmap("", "", { desc = "Terminal Normal Mode" }) -tmap("jk", "", { desc = "Terminal Normal Mode" }) -tmap("", "", { desc = "Terminal Window Command" }) diff --git a/config/linux-dev/nvim/.luacheckrc b/config/shared/nvim/.luacheckrc similarity index 100% rename from config/linux-dev/nvim/.luacheckrc rename to config/shared/nvim/.luacheckrc diff --git a/config/linux-dev/nvim/.luarc.json b/config/shared/nvim/.luarc.json similarity index 100% rename from config/linux-dev/nvim/.luarc.json rename to config/shared/nvim/.luarc.json diff --git a/config/linux-dev/nvim/.stylua.toml b/config/shared/nvim/.stylua.toml similarity index 100% rename from config/linux-dev/nvim/.stylua.toml rename to config/shared/nvim/.stylua.toml diff --git a/config/linux-dev/nvim/docs/commands.md b/config/shared/nvim/docs/commands.md similarity index 100% rename from config/linux-dev/nvim/docs/commands.md rename to config/shared/nvim/docs/commands.md diff --git a/config/linux-dev/nvim/docs/docs.md b/config/shared/nvim/docs/docs.md similarity index 100% rename from config/linux-dev/nvim/docs/docs.md rename to config/shared/nvim/docs/docs.md diff --git a/config/linux-dev/nvim/docs/keymaps.md b/config/shared/nvim/docs/keymaps.md similarity index 100% rename from config/linux-dev/nvim/docs/keymaps.md rename to config/shared/nvim/docs/keymaps.md diff --git a/config/linux-dev/nvim/docs/neovim-actions.md b/config/shared/nvim/docs/neovim-actions.md similarity index 100% rename from config/linux-dev/nvim/docs/neovim-actions.md rename to config/shared/nvim/docs/neovim-actions.md diff --git a/config/linux-dev/nvim/init.lua b/config/shared/nvim/init.lua similarity index 100% rename from config/linux-dev/nvim/init.lua rename to config/shared/nvim/init.lua diff --git a/config/linux-dev/nvim/lazy-lock.json b/config/shared/nvim/lazy-lock.json similarity index 100% rename from config/linux-dev/nvim/lazy-lock.json rename to config/shared/nvim/lazy-lock.json diff --git a/config/shared/nvim/lsp/json_ls.lua b/config/shared/nvim/lsp/json_ls.lua new file mode 100644 index 0000000..13479b2 --- /dev/null +++ b/config/shared/nvim/lsp/json_ls.lua @@ -0,0 +1,6 @@ +return { + cmd = { 'vscode-json-language-server', '--stdio' }, + filetypes = { 'json', 'jsonc' }, + init_options = { provideFormatter = true }, + root_markers = { '.git' }, +} diff --git a/config/linux-dev/nvim/lsp/lua_ls.lua b/config/shared/nvim/lsp/lua_ls.lua similarity index 100% rename from config/linux-dev/nvim/lsp/lua_ls.lua rename to config/shared/nvim/lsp/lua_ls.lua diff --git a/config/linux-dev/nvim/lua/config/autocmds.lua b/config/shared/nvim/lua/config/autocmds.lua similarity index 100% rename from config/linux-dev/nvim/lua/config/autocmds.lua rename to config/shared/nvim/lua/config/autocmds.lua diff --git a/config/linux-dev/nvim/lua/config/clipboard.lua b/config/shared/nvim/lua/config/clipboard.lua similarity index 100% rename from config/linux-dev/nvim/lua/config/clipboard.lua rename to config/shared/nvim/lua/config/clipboard.lua diff --git a/config/linux-dev/nvim/lua/config/keymaps.lua b/config/shared/nvim/lua/config/keymaps.lua similarity index 100% rename from config/linux-dev/nvim/lua/config/keymaps.lua rename to config/shared/nvim/lua/config/keymaps.lua diff --git a/config/linux-dev/nvim/lua/config/options.lua b/config/shared/nvim/lua/config/options.lua similarity index 100% rename from config/linux-dev/nvim/lua/config/options.lua rename to config/shared/nvim/lua/config/options.lua diff --git a/config/linux-dev/nvim/lua/config/terminal.lua b/config/shared/nvim/lua/config/terminal.lua similarity index 100% rename from config/linux-dev/nvim/lua/config/terminal.lua rename to config/shared/nvim/lua/config/terminal.lua diff --git a/config/linux-dev/nvim/lua/custom/navigation.lua b/config/shared/nvim/lua/custom/navigation.lua similarity index 100% rename from config/linux-dev/nvim/lua/custom/navigation.lua rename to config/shared/nvim/lua/custom/navigation.lua diff --git a/config/linux-dev/nvim/lua/plugins/colorscheme.lua b/config/shared/nvim/lua/plugins/colorscheme.lua similarity index 100% rename from config/linux-dev/nvim/lua/plugins/colorscheme.lua rename to config/shared/nvim/lua/plugins/colorscheme.lua diff --git a/config/linux-dev/nvim/lua/plugins/filetree.lua b/config/shared/nvim/lua/plugins/filetree.lua similarity index 100% rename from config/linux-dev/nvim/lua/plugins/filetree.lua rename to config/shared/nvim/lua/plugins/filetree.lua diff --git a/config/linux-dev/nvim/lua/plugins/syntax.lua b/config/shared/nvim/lua/plugins/syntax.lua similarity index 100% rename from config/linux-dev/nvim/lua/plugins/syntax.lua rename to config/shared/nvim/lua/plugins/syntax.lua diff --git a/config/linux-vm/tmux b/config/shared/tmux similarity index 100% rename from config/linux-vm/tmux rename to config/shared/tmux diff --git a/manage.py b/manage.py index 1e9551f..37026de 100755 --- a/manage.py +++ b/manage.py @@ -10,7 +10,7 @@ import shutil DOTFILES_DIR = Path(__file__).parent SETUPS_DIR = DOTFILES_DIR / "setups" CONFIG_DIR = DOTFILES_DIR / "config" -CONFIG_PATH = DOTFILES_DIR / "config.json" +CONFIG_PATH = DOTFILES_DIR / "manifest.json" def load_config(): if not CONFIG_PATH.exists(): diff --git a/manifest.json b/manifest.json index e3f57a3..7f8ba29 100644 --- a/manifest.json +++ b/manifest.json @@ -1,23 +1,22 @@ { "template": { - "htop": { - "link": { - "from": "shared/htop", - "to": "~/.config/htop" - } - }, "bin": { "link": { "from": "shared/bin", "to": "~/bin" } }, - "nvim": { + "htop": { "link": { - "from": "shared/nvim", - "to": "~/.config/nvim/init.lua" - }, - "post-link": "(grep -q 'alias vim=nvim' ~/.zshrc || echo 'alias vim=nvim' >> ~/.zshrc) || true" + "from": "shared/htop", + "to": "~/.config/htop" + } + }, + "git": { + "link": { + "from": "shared/git", + "to": "~/.gitconfig" + } }, "zsh": { "link": { @@ -31,51 +30,25 @@ "to": "~/.tmux.conf" } }, - "git": { + "nvim": { "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" + "from": "shared/nvim", + "to": "~/.config/nvim" } } }, "environments": { "macos": [ + "git", "zsh", + "tmux", + "nvim", + "bin", { "package": "bin", "link": { "from": "macos/bin", - "to": "~/bin" - } - }, - "tmux", - "nvim", - "git", - "ghostty", - "alacritty", - { - "package": "karabiner", - "link": { - "from": "macos/karabiner", - "to": "~/.config/karabiner" + "to": "~/.local/bin" } }, { @@ -88,9 +61,46 @@ { "package": "rectangle", "link-comment": "Needs manual import from config/macos/linearmouse" + }, + { + "package": "wezterm", + "link": { + "from": "macos/wezterm", + "to": "~/.config/wezterm" + } + }, + { + "package": "alacritty", + "link": { + "from": "macos/alacritty", + "to": "~/.config/alacritty" + } + }, + { + "package": "ghostty", + "link": { + "from": "macos/ghostty", + "to": "~/.config/ghostty" + } } ], "linux-vm": [ + "bin", + { + "package": "bin", + "link": { + "from": "linux-vm/bin", + "to": "~/.local/bin" + } + }, + { + "package": "htop", + "install": "sudo apt install -y htop" + }, + { + "package": "git", + "install": "sudo apt install -y git" + }, { "package": "zsh", "install": "sudo apt install -y zsh", @@ -98,48 +108,42 @@ }, { "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'" - }, + "post-install": "echo 'Neovim needs setup'" + } + ], + "container": [ + "bin", { - "package": "git", - "install": "sudo apt install -y git" + "package": "bin", + "link": { + "from": "container/bin", + "to": "~/.local/bin" + } }, { "package": "htop", "install": "sudo apt install -y htop" }, - "bin" - ], - "linux-dev": [ + { + "package": "git", + "install": "sudo apt install -y git" + }, { "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' +qa" - }, - { - "package": "git", - "install": "sudo apt install -y git" - }, - { - "package": "htop", - "install": "sudo apt install -y htop" + "post-install": "echo 'Neovim needs setup'" } ] }