From 04b4e6d5a1eb9e3621e967b374a50bda640c4f55 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:09:28 +0100 Subject: [PATCH 1/7] chore(git): add delta config --- .gitconfig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 639c2f6..b1198a3 100644 --- a/.gitconfig +++ b/.gitconfig @@ -9,7 +9,7 @@ smudge = git-lfs smudge -- %f [core] autocrlf = input - pager = delta + pager = delta --features git excludesFile = ~/.gitignore [interactive] diffFilter = delta --color-only @@ -33,3 +33,16 @@ count-lines = "! git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #" [gpg "ssh"] allowedSignersFile = ~/.ssh/allowed_signers +[delta] + dark = true + line-numbers = true + hyperlinks = true + hyperlinks-file-link-format = "lazygit-edit://{path}:{line}" + true-color = always +[delta "git"] + pager = less + paging = always +[delta "lazygit"] + features = diff-so-fancy + hunk-header-style = omit + paging = never From 7ca0d283cda27aed3e718c6d5164e1d6ec6bb279 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:10:54 +0100 Subject: [PATCH 2/7] chore(aerospace): add floating picture-in-picture for zen browser --- .config/aerospace/aerospace.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/aerospace/aerospace.toml b/.config/aerospace/aerospace.toml index eff2e30..303645d 100644 --- a/.config/aerospace/aerospace.toml +++ b/.config/aerospace/aerospace.toml @@ -42,6 +42,11 @@ if.app-id = 'org.mozilla.firefox' if.window-title-regex-substring = 'Picture-in-Picture' run = 'layout floating' +[[on-window-detected]] +if.app-id = 'app.zen-browser.zen' +if.window-title-regex-substring = 'Picture-in-Picture' +run = 'layout floating' + [[on-window-detected]] if.app-id = 'app.zen-browser.zen' if.window-title-regex-substring = 'Bitwarden' From 088e928a373d92aca2065e238c941bf0f2d45b15 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:12:03 +0100 Subject: [PATCH 3/7] chore(lazygit): add delta features --- .config/lazygit/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/lazygit/config.yml b/.config/lazygit/config.yml index eb506c1..c877945 100644 --- a/.config/lazygit/config.yml +++ b/.config/lazygit/config.yml @@ -1,7 +1,7 @@ git: paging: colorArg: always - pager: delta --dark --paging=never --syntax-theme base16-256 --diff-so-fancy + pager: delta --features lazygit useConfig: false autoFetch: false gui: From f65f7cb88ecc6bc3242a741550f8cc1661632f75 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:12:16 +0100 Subject: [PATCH 4/7] chore(lazygit): add custom commitizen command --- .config/lazygit/config.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.config/lazygit/config.yml b/.config/lazygit/config.yml index c877945..bdc7e33 100644 --- a/.config/lazygit/config.yml +++ b/.config/lazygit/config.yml @@ -6,3 +6,56 @@ git: autoFetch: false gui: nerdFontsVersion: 3 + +customCommands: + - key: "C" + command: "git commit -m '{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}'" + description: "commit with commitizen" + context: "files" + prompts: + - type: "menu" + title: "Select the type of change you are committing." + key: "Type" + options: + - name: "Feature" + description: "a new feature" + value: "feat" + - name: "Fix" + description: "a bug fix" + value: "fix" + - name: "Documentation" + description: "Documentation only changes" + value: "docs" + - name: "Styles" + description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)" + value: "style" + - name: "Code Refactoring" + description: "A code change that neither fixes a bug nor adds a feature" + value: "refactor" + - name: "Performance Improvements" + description: "A code change that improves performance" + value: "perf" + - name: "Tests" + description: "Adding missing tests or correcting existing tests" + value: "test" + - name: "Builds" + description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)" + value: "build" + - name: "Continuous Integration" + description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)" + value: "ci" + - name: "Chores" + description: "Other changes that don't modify src or test files" + value: "chore" + - name: "Reverts" + description: "Reverts a previous commit" + value: "revert" + - type: "input" + title: "Enter the scope(s) of this change." + key: "Scopes" + - type: "input" + title: "Enter the short description of the change." + key: "Description" + - type: "confirm" + title: "Is the commit message correct?" + body: "{{ .Form.Type }}{{if .Form.Scopes}}({{ .Form.Scopes }}){{end}}: {{ .Form.Description }}" From 78f369cb9880fd85204d80142e7450fd82d1045a Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:12:41 +0100 Subject: [PATCH 5/7] style(nvim): organize the variables.lua file --- .config/nvim/lua/core/variables.lua | 92 +++++++++++++---------------- 1 file changed, 40 insertions(+), 52 deletions(-) diff --git a/.config/nvim/lua/core/variables.lua b/.config/nvim/lua/core/variables.lua index 0d143cd..d779a35 100644 --- a/.config/nvim/lua/core/variables.lua +++ b/.config/nvim/lua/core/variables.lua @@ -1,53 +1,41 @@ ---Leader +-- Set the leader key vim.g.mapleader = " " ---termguicolors -vim.opt.termguicolors = true ---Relative line numbers -vim.wo.number = true -vim.wo.relativenumber = true ---Remove search highlight -vim.opt.hlsearch = false -vim.opt.incsearch = true -vim.opt.smartindent = true --- Make searches case insensitive (except when using uppercase) -vim.opt.smartcase = true ---Change word definition -vim.opt.iskeyword:append("_") ---Remove Wrap -vim.opt.wrap = false ---Not let cursor go bellow 10 chars. -vim.opt.scrolloff = 10 ---4 space indent -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true ---Undo dir -vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -vim.opt.undofile = true ---Backup dir -vim.opt.backup = true -vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" ---Org mode hide links -vim.opt.conceallevel = 2 -vim.opt.concealcursor = 'nc' ---Jupyter notebooks -vim.g.jukit_convert_overwrite_default = 1 -vim.g.jukit_convert_open_default = 0 -vim.g.jukit_shell_cmd = 'ipython3' -vim.g.jukit_terminal = 'nvimterm' -vim.g.jukit_show_prompt = 1 -vim.g.jukit_pdf_viewer = 'zathura' -vim.g.jukit_mappings = 0 ---Format Options -vim.opt.formatoptions:remove("ro") ---Sign gutter always on -vim.opt.signcolumn = "yes" --- sync buffers automatically -vim.opt.autoread = true --- disable swapfile -vim.opt.swapfile = false --- disable statusline -vim.o.laststatus = 1 --- border on floating windows -vim.o.winborder = nil + +-- Appearance +vim.opt.termguicolors = true -- Enable 24-bit colors +vim.opt.number = true -- Show line numbers +vim.opt.relativenumber = true -- Show relative line numbers +vim.opt.wrap = false -- Disable line wrapping +vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode) +vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only +vim.opt.signcolumn = "yes" -- Always show the sign column +vim.o.laststatus = 1 -- Always show the status line (Note: original had '1', consider '2' for always visible) +vim.o.winborder = nil -- Use default border for floating windows + +-- Indentation +vim.opt.tabstop = 4 -- Number of spaces a tab represents +vim.opt.softtabstop = 4 -- Number of spaces a in Insert mode equals +vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent +vim.opt.expandtab = true -- Use spaces instead of tabs +vim.opt.smartindent = true -- Smart auto-indenting + +-- Searching +vim.opt.hlsearch = false -- Disable highlighting of search matches +vim.opt.incsearch = true -- Show partial matches while typing + +-- Behavior and Navigation +vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters +vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling +vim.opt.sidescrolloff = 10 +vim.opt.smoothscroll = true + +-- File Management +vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Directory for undo files +vim.opt.undofile = true -- Save undo history +vim.opt.backup = true -- Create backup files +vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" -- Directory for backup files +vim.opt.autoread = true -- Automatically reload changed files +vim.opt.swapfile = false -- Disable swap files + +-- Formatting +vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions (assuming you don't want auto-wrapping comments) From 2b757077fd8ebbef0456d1599f4e2e4bc73c7e31 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 12:13:55 +0100 Subject: [PATCH 6/7] chore(nvim): cleanup of some old stuff --- .config/nvim/lua/plugins/lsp.lua | 38 ++++++++++++++++++++------------ .config/nvim/lua/plugins/ui.lua | 36 +++++------------------------- 2 files changed, 30 insertions(+), 44 deletions(-) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 80f1dbb..91d031c 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -8,18 +8,6 @@ return { } } }, - { - 'nvim-java/nvim-java', - ft = "java", - config = function() - require('java').setup() - local lspconfig = require("lspconfig") - local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true) - lspconfig["jdtls"].setup({ - capabilities = capabilities, - }) - end - }, { "smjonas/inc-rename.nvim", opts = { @@ -31,6 +19,28 @@ return { event = "VeryLazy", opts = {} }, + { + "ray-x/go.nvim", + dependencies = { + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function(lp, opts) + require("go").setup(opts) + local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + require('go.format').goimports() + end, + group = format_sync_grp, + }) + end, + event = { "CmdlineEnter" }, + ft = { "go", 'gomod' }, + build = ':lua require("go.install").update_all_sync()' + }, { "neovim/nvim-lspconfig", dependencies = { @@ -50,7 +60,7 @@ return { local conform = require("conform") local function jumpWithVirtLineDiags(jumpCount) - pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags") -- prevent autocmd for repeated jumps + pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags") vim.diagnostic.jump { count = jumpCount } @@ -60,7 +70,7 @@ return { virtual_lines = { current_line = true }, } - vim.defer_fn(function() -- deferred to not trigger by jump itself + vim.defer_fn(function() vim.api.nvim_create_autocmd("CursorMoved", { desc = "User(once): Reset diagnostics virtual lines", once = true, diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index e8c82e5..90e92b0 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -42,38 +42,9 @@ return { vim.o.foldcolumn = '0' vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 - vim.o.foldenable = true vim.keymap.set('n', 'zR', require('ufo').openAllFolds) vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) - require('ufo').setup({ - fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate) - local newVirtText = {} - local suffix = (' %d '):format(endLnum - lnum) - local sufWidth = vim.fn.strdisplaywidth(suffix) - local targetWidth = width - sufWidth - local curWidth = 0 - for _, chunk in ipairs(virtText) do - local chunkText = chunk[1] - local chunkWidth = vim.fn.strdisplaywidth(chunkText) - if targetWidth > curWidth + chunkWidth then - table.insert(newVirtText, chunk) - else - chunkText = truncate(chunkText, targetWidth - curWidth) - local hlGroup = chunk[2] - table.insert(newVirtText, { chunkText, hlGroup }) - chunkWidth = vim.fn.strdisplaywidth(chunkText) - -- str width returned from truncate() may less than 2nd argument, need padding - if curWidth + chunkWidth < targetWidth then - suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth) - end - break - end - curWidth = curWidth + chunkWidth - end - table.insert(newVirtText, { suffix, 'MoreMsg' }) - return newVirtText - end - }) + require('ufo').setup() end }, { @@ -90,4 +61,9 @@ return { require 'colorizer'.setup() end }, + { + "echasnovski/mini.diff", + opts = {} + } + } From 529c159526b6616a15168ac39ef2ba38771cecf2 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Jun 2025 14:01:07 +0100 Subject: [PATCH 7/7] feat(fish): add starship prompt --- .config/fish/config.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 85c7e6b..10931af 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -48,3 +48,5 @@ end # Set up fzf set -U FZF_DEFAULT_OPTS "--bind 'bs:backward-delete-char/eof'" fzf --fish | source + +starship init fish | source