From 6260024dbc5f099c000bc54b7731b1a77d48995b Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 24 Jul 2025 12:39:16 +0930 Subject: [PATCH] fix: update things --- .config/hypr/hyprland.conf | 18 +----- .config/nvim/lua/core/remaps.lua | 42 ++++++++----- .config/nvim/lua/plugins/alpha.lua | 1 + .config/nvim/lua/plugins/avante.lua | 55 +++++++++++++++++ .config/nvim/lua/plugins/cloak.lua | 16 ----- .config/nvim/lua/plugins/conform.lua | 81 +++++++++++++++----------- .config/nvim/lua/plugins/dadbod.lua | 17 ++++++ .config/nvim/lua/plugins/gitlab.lua | 22 +++++++ .config/nvim/lua/plugins/laravel.lua | 6 +- .config/nvim/lua/plugins/lspconfig.lua | 8 +-- .config/php-cs-fixer.php | 20 +++++++ .config/zsh/.zshrc | 1 + 12 files changed, 197 insertions(+), 90 deletions(-) create mode 100644 .config/nvim/lua/plugins/avante.lua delete mode 100644 .config/nvim/lua/plugins/cloak.lua create mode 100644 .config/nvim/lua/plugins/gitlab.lua create mode 100644 .config/php-cs-fixer.php diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 98dee67..2a6c1c5 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -22,16 +22,8 @@ $menu = wofi --show drun ################# exec-once = waybar -exec-once = hypridle +# exec-once = hypridle exec-once = hyprpaper -# We want this to run every time the config is refreshed -exec-once = hyprctl plugin load /home/tovi/.config/hypr/hyprWorkspaceLayouts/workspaceLayoutPlugin.so - -plugin { - wslayout { - default_layout=master - } -} ############################# ### ENVIRONMENT VARIABLES ### @@ -83,7 +75,7 @@ general { # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false - layout=workspacelayout + layout=master } # Master layout specific settings @@ -126,12 +118,6 @@ animations { enabled = false } -# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more -dwindle { - pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = true # You probably want this -} - # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_status = master diff --git a/.config/nvim/lua/core/remaps.lua b/.config/nvim/lua/core/remaps.lua index 6e558bf..9c96933 100644 --- a/.config/nvim/lua/core/remaps.lua +++ b/.config/nvim/lua/core/remaps.lua @@ -35,10 +35,22 @@ vim.keymap.set("v", "d", '"_d', { desc = "Delete into black hole registe vim.keymap.set("n", "", "zz", { desc = "Scroll down half page" }) vim.keymap.set("n", "", "zz", { desc = "Scroll up half page" }) --- Keep cursor centered -vim.keymap.set("n", "n", "nzzzv", { desc = "Next search result" }) -vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous search result" }) - +-- -- Keep cursor centered +-- vim.keymap.set("n", "n", function() +-- if vim.bo.filetype == "fugitive" then +-- return "n" +-- else +-- return "nzzzv" +-- end +-- end, { desc = "Next search result" }) +-- vim.keymap.set("n", "N", function() +-- if vim.bo.filetype == "fugitive" then +-- return "N" +-- else +-- return "Nzzzv" +-- end +-- end, { desc = "Previous search result" }) +-- -- Keep cursor centered when jumping through quickfix list vim.keymap.set("n", "N", "cprevzz", { desc = "Previous item in quickfix list" }) vim.keymap.set("n", "n", "cnextzz", { desc = "Next item in quickfix list" }) @@ -65,20 +77,20 @@ vim.keymap.set("n", ".f", function() vim.cmd("edit app/frontend/.env.dev -- Delete a buffer, without closing the window, see https://stackoverflow.com/q/4465095/6064933 vim.keymap.set("n", [[\d]], "bprevious bdelete #", { - silent = true, - desc = "delete current buffer", + silent = true, + desc = "delete current buffer", }) vim.keymap.set("n", [[\D]], function() - local buf_ids = vim.api.nvim_list_bufs() - local cur_buf = vim.api.nvim_win_get_buf(0) - - for _, buf_id in pairs(buf_ids) do - -- do not Delete unlisted buffers, which may lead to unexpected errors - if vim.api.nvim_get_option_value("buflisted", { buf = buf_id }) and buf_id ~= cur_buf then - vim.api.nvim_buf_delete(buf_id, { force = true }) + local buf_ids = vim.api.nvim_list_bufs() + local cur_buf = vim.api.nvim_win_get_buf(0) + + for _, buf_id in pairs(buf_ids) do + -- do not Delete unlisted buffers, which may lead to unexpected errors + if vim.api.nvim_get_option_value("buflisted", { buf = buf_id }) and buf_id ~= cur_buf then + vim.api.nvim_buf_delete(buf_id, { force = true }) + end end - end end, { - desc = "delete other buffers", + desc = "delete other buffers", }) diff --git a/.config/nvim/lua/plugins/alpha.lua b/.config/nvim/lua/plugins/alpha.lua index 340ac1e..31df700 100644 --- a/.config/nvim/lua/plugins/alpha.lua +++ b/.config/nvim/lua/plugins/alpha.lua @@ -4,6 +4,7 @@ return { 'echasnovski/mini.icons', 'MaximilianLloyd/ascii.nvim', }, + enabled = false, config = function () local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") diff --git a/.config/nvim/lua/plugins/avante.lua b/.config/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..d5f08e4 --- /dev/null +++ b/.config/nvim/lua/plugins/avante.lua @@ -0,0 +1,55 @@ +return { + "yetone/avante.nvim", + event = "VeryLazy", + version = false, + keys = { + "A", + "AvanteToggle" + }, + opts = { + behaviour = { + auto_suggestions = false, -- Experimental stage + auto_set_highlight_group = true, + auto_set_keymaps = false, + auto_apply_diff_after_generation = false, + support_paste_from_clipboard = false, + minimize_diff = true, -- Whether to remove unchanged lines when applying a code block + enable_token_counting = true, -- Whether to enable token counting. Default to true. + }, + }, + build = "make", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "echasnovski/mini.pick", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/cloak.lua b/.config/nvim/lua/plugins/cloak.lua deleted file mode 100644 index 07e7c05..0000000 --- a/.config/nvim/lua/plugins/cloak.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "laytan/cloak.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("cloak").setup({ - enabled = true, - patterns = { - { - file_pattern = ".env*", - cloak_pattern = "=.+", - replace = "*", - }, - }, - }) - end, -} diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index eeb2f7a..bd11c76 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -1,40 +1,53 @@ return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local conform = require("conform") + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + config = function() + local conform = require("conform") - conform.setup({ - formatters_by_ft = { - lua = { "stylua" }, - go = { "goimports", "gofmt" }, - javascript = { "prettierd" }, - typescript = { "prettierd" }, - vue = { "prettierd" }, - css = { "prettierd" }, - html = { "prettierd" }, - markdown = { "prettierd" }, - json = { "fixjson" }, - rust = { "rustfmt" }, - shell = { "shfmt", "shellcheck" }, - python = { "isort", "black" }, - php = { "phpcbf" }, + conform.setup({ + formatters_by_ft = { + lua = { "stylua" }, + go = { "goimports", "gofmt" }, + javascript = { "prettierd" }, + typescript = { "prettierd" }, + vue = { "prettierd" }, + css = { "prettierd" }, + html = { "prettierd" }, + markdown = { "prettierd" }, + json = { "fixjson" }, + rust = { "rustfmt" }, + shell = { "shfmt", "shellcheck" }, + python = { "isort", "black" }, + php = { "phpcbf", "php_cs_fixer" }, blade = { "blade-formatter" } - }, - log_level = vim.log.levels.WARN, - notify_on_error = false, - }) + }, + log_level = vim.log.levels.WARN, + notify_on_error = false, + }) - vim.keymap.set({ "n", "v" }, "F", function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 500, - }) - end) + vim.keymap.set({ "n", "v" }, "F", function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 500, + }) + end) - conform.formatters.phpcbf = { - prepend_args = { "--standard=~/.config/phpcs.xml" }, - } - end, + vim.fn.mkdir(vim.fn.expand("~/.cache/php-cs-fixer"), "p") + + conform.formatters.php_cs_fixer = { + prepend_args = { + "--config=" .. vim.fn.expand("~/.config/php-cs-fixer.php"), + "--cache-file=" .. vim.fn.expand("~/.cache/php-cs-fixer/cache"), + }, + env = { + PHP_CS_FIXER_IGNORE_ENV = "1", + }, + } + + conform.formatters.phpcbf = { + prepend_args = { "--standard=~/.config/phpcs.xml" }, + + } + end, } diff --git a/.config/nvim/lua/plugins/dadbod.lua b/.config/nvim/lua/plugins/dadbod.lua index 0166757..9fa90df 100644 --- a/.config/nvim/lua/plugins/dadbod.lua +++ b/.config/nvim/lua/plugins/dadbod.lua @@ -18,5 +18,22 @@ return { vim.g.dbs = { dev = 'mariadb://jack:secret@localhost:33061/jack?ssl=false', } + + vim.api.nvim_create_user_command('DBUITab', function() + vim.cmd('tabnew') + vim.cmd('DBUI') + end, { desc = 'Open DBUI in a new tab' }) + + vim.keymap.set('n', 'db', function () + vim.cmd('tabnew') + vim.cmd('DBUI') + end, { desc = 'Open DBUI in a new tab' }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = {"dbout", "dbui"}, + callback = function() + vim.opt_local.foldenable = false + end, + }) end, } diff --git a/.config/nvim/lua/plugins/gitlab.lua b/.config/nvim/lua/plugins/gitlab.lua new file mode 100644 index 0000000..1a3fc72 --- /dev/null +++ b/.config/nvim/lua/plugins/gitlab.lua @@ -0,0 +1,22 @@ +return { + "harrisoncramer/gitlab.nvim", + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers. + "nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree. + }, + build = function() require("gitlab.server").build(true) end, -- Builds the Go binary + config = function() + require("gitlab").setup() + + vim.api.nvim_create_user_command("GChoose", function() + require("gitlab").choose_merge_request() + end, { desc = "Choose a GitLab merge request" }) + + vim.api.nvim_create_user_command("GReview", function() + require("gitlab").review() + end, { desc = "Start GitLab review" }) + end, +} diff --git a/.config/nvim/lua/plugins/laravel.lua b/.config/nvim/lua/plugins/laravel.lua index b64cf99..712c061 100644 --- a/.config/nvim/lua/plugins/laravel.lua +++ b/.config/nvim/lua/plugins/laravel.lua @@ -7,11 +7,7 @@ return { "kevinhwang91/promise-async", }, cmd = { "Laravel" }, - keys = { - { "la", ":Laravel artisan" }, - { "lr", ":Laravel routes" }, - { "lm", ":Laravel related" }, - }, + keys = {}, event = { "VeryLazy" }, opts = { lsp_server = "intelephense", diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 6fca13c..560db61 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -176,7 +176,7 @@ return { intelephense = { format = { enable = true, - sortUseStatements = false, + sortUseStatements = true, }, }, }, @@ -215,9 +215,9 @@ return { }, }, - dartls = { - cmd = { "/opt/flutter/bin/dart", "language-server", "--protocol=lsp" }, - }, + -- dartls = { + -- cmd = { "/opt/flutter/bin/dart", "language-server", "--protocol=lsp" }, + -- }, rust_analyzer = { diagnostics = { diff --git a/.config/php-cs-fixer.php b/.config/php-cs-fixer.php new file mode 100644 index 0000000..4c01a56 --- /dev/null +++ b/.config/php-cs-fixer.php @@ -0,0 +1,20 @@ +setRules([ + '@PSR12' => true, + 'ordered_imports' => [ + 'sort_algorithm' => 'alpha', + 'imports_order' => ['class', 'function', 'const'], + ], + 'no_unused_imports' => true, + 'global_namespace_import' => [ + 'import_classes' => true, + 'import_constants' => true, + 'import_functions' => true, + ], + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__) + ); diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 0965bd3..9737088 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -91,6 +91,7 @@ function cdf () { # Android dev config export ANDROID_HOME="$HOME/Android/Sdk" +export ANDROID_SDK_ROOT=/home/tovi/Android/Sdk if [[ $(uname) == 'Darwin' ]]; then export ANDROID_HOME="$HOME/Library/Android/sdk" export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"