From 332c883a48c8371f3ea66f1dc7151843f56d086f Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Wed, 9 Jul 2025 23:58:22 +0200 Subject: [PATCH] Bring over commits accidentally only on local_machine branch to main --- confutils/get-battery.sh | 2 +- ghostty/config | 1 - nix/home/linux.nix | 2 ++ nvim/lua/close_handler.lua | 2 +- nvim/lua/colors.lua | 16 ++++++++++++++++ nvim/lua/keymaps.lua | 10 ++++++++++ nvim/lua/plugs/leap.lua | 4 +--- nvim/lua/plugs/lualine.lua | 19 ++++++++++++++++--- nvim/lua/plugs/noice.lua | 9 +++++++++ nvim/lua/vim_opt.lua | 4 ++-- zsh/.zshrc | 1 + 11 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 nvim/lua/colors.lua diff --git a/confutils/get-battery.sh b/confutils/get-battery.sh index 9723474..3f201ff 100755 --- a/confutils/get-battery.sh +++ b/confutils/get-battery.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ############################# # Icons for Linux Battery diff --git a/ghostty/config b/ghostty/config index 5df95da..9ed6743 100644 --- a/ghostty/config +++ b/ghostty/config @@ -63,4 +63,3 @@ keybind = alt+left=unbind keybind = alt+right=unbind keybind = ctrl+shift+left=unbind keybind = ctrl+shift+right=unbind - diff --git a/nix/home/linux.nix b/nix/home/linux.nix index 48cb820..d7a7b5d 100644 --- a/nix/home/linux.nix +++ b/nix/home/linux.nix @@ -54,6 +54,8 @@ in bitwarden-cli sway-audio-idle-inhibit qutebrowser + ffmpeg + imv ]; file = utils.mk_symlinks { inherit config dotfiles; }; diff --git a/nvim/lua/close_handler.lua b/nvim/lua/close_handler.lua index a32d3dd..93041d1 100644 --- a/nvim/lua/close_handler.lua +++ b/nvim/lua/close_handler.lua @@ -8,7 +8,7 @@ local handle_count = 1 function M.setup() utils.set_keymap_list({ { - "q", + "q", function() for _, cb in ipairs(callbacks) do if cb ~= nil then diff --git a/nvim/lua/colors.lua b/nvim/lua/colors.lua new file mode 100644 index 0000000..4f91a12 --- /dev/null +++ b/nvim/lua/colors.lua @@ -0,0 +1,16 @@ +local has_generated = false +local colors = require("ayu.colors") +colors.generate(true) + +local M = {} + +function M.get() + if not has_generated then + colors.generate(true) + has_generated = true + end + + return colors +end + +return M diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua index 50a6d08..87b75f0 100644 --- a/nvim/lua/keymaps.lua +++ b/nvim/lua/keymaps.lua @@ -66,6 +66,16 @@ utils.foreach({ vim.cmd.normal({ cmd }) end end }, + { "", ":$tabnew %", { silent = true }, }, + { "1", ":1tabn", { silent = true }, }, + { "2", ":2tabn", { silent = true }, }, + { "3", ":3tabn", { silent = true }, }, + { "4", ":4tabn", { silent = true }, }, + { "5", ":5tabn", { silent = true }, }, + { "6", ":6tabn", { silent = true }, }, + { "7", ":7tabn", { silent = true }, }, + { "8", ":8tabn", { silent = true }, }, + { "9", ":9tabn", { silent = true }, }, } }, { diff --git a/nvim/lua/plugs/leap.lua b/nvim/lua/plugs/leap.lua index 40ec93b..5c1b8d2 100644 --- a/nvim/lua/plugs/leap.lua +++ b/nvim/lua/plugs/leap.lua @@ -1,7 +1,5 @@ local saved_hlsearch = false local saved_highlights = {} -local colors = require("ayu.colors") -colors.generate(true) local function leap_across_windows() require("leap").leap({ @@ -25,7 +23,7 @@ end local function save_and_set_invisible_inlay_hints_hl() saved_highlights = vim.api.nvim_get_hl(0, { name = "LspInlayHint" }) - vim.api.nvim_set_hl(0, "LspInlayHint", { fg = colors.bg, bg = "none" }) + vim.api.nvim_set_hl(0, "LspInlayHint", { fg = require("colors").get().bg, bg = "none" }) end local function restore_inlay_hints_hl() diff --git a/nvim/lua/plugs/lualine.lua b/nvim/lua/plugs/lualine.lua index eec34b5..9469d04 100644 --- a/nvim/lua/plugs/lualine.lua +++ b/nvim/lua/plugs/lualine.lua @@ -1,11 +1,24 @@ local function resize_mode() if require("window_management").is_in_resizing_mode() then - return "▲ Resizing ▼" + return "▲ Resizing ▼ " else - return "" + return " " end end +local tabs = { + "tabs", + use_mode_colors = true, + tabs_color = { + active = "lualine_b_command", + }, + show_modified_status = false, + component_separators = { + left = "", + right = "" + }, +} + return { "nvim-lualine/lualine.nvim", dependencies = { @@ -38,7 +51,7 @@ return { }, resize_mode, }, - lualine_c = { "buffers" }, + lualine_c = { tabs }, lualine_x = { "encoding", "fileformat", "filetype" }, lualine_y = { "progress" }, lualine_z = { "location" } diff --git a/nvim/lua/plugs/noice.lua b/nvim/lua/plugs/noice.lua index 4fef8b3..d8e0426 100644 --- a/nvim/lua/plugs/noice.lua +++ b/nvim/lua/plugs/noice.lua @@ -11,6 +11,15 @@ return { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, }, + signature = { + auto_open = true, + opts = { + position = { + row = 2, + col = 0, + }, + }, + }, }, presets = { bottom_search = true, -- use a classic bottom cmdline for search diff --git a/nvim/lua/vim_opt.lua b/nvim/lua/vim_opt.lua index bc3a794..c15537e 100644 --- a/nvim/lua/vim_opt.lua +++ b/nvim/lua/vim_opt.lua @@ -1,6 +1,6 @@ local opt = vim.opt --- Disable tabs, will use telescope and harpoon instead +-- Disable tabs opt.showtabline = 0 -- Make Vim use the system clipboard @@ -71,7 +71,7 @@ opt.scrolloff = 4 opt.list = false -- Sessions -opt.sessionoptions = { "buffers", "curdir", "winsize", "winpos", "skiprtp" } +opt.sessionoptions = { "buffers", "curdir", "winsize", "winpos", "tabpages", "skiprtp" } -- Builtin LSP completion tweaks -- See comment in lspsetup autocmd for LspAttach diff --git a/zsh/.zshrc b/zsh/.zshrc index 3c53a39..9988d7d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -145,6 +145,7 @@ alias gap="git add --patch" alias gi="git init" alias gcl="git clone" alias gd="git diff --output-indicator-new=' ' --output-indicator-old=' '" +alias gds="git diff --staged --output-indicator-new=' ' --output-indicator-old=' '" alias gl="git log --all --graph --pretty=format:'%C(magenta)%h %C(white) %an %ar%C(auto) %D%n%s%n'" alias gm="git merge"