From 0bfbc0a2011b6f2ae4a5400bf7c842a6acef3f3c Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:32:32 +0000 Subject: [PATCH 1/6] [karabiner] added ghostty to karabiner tmux key --- .config/karabiner/karabiner.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json index ccf0474..b38f53b 100644 --- a/.config/karabiner/karabiner.json +++ b/.config/karabiner/karabiner.json @@ -13,6 +13,7 @@ "bundle_identifiers": [ "^io\\.alacritty$", "^org\\.alacritty$", + "com.mitchellh.ghostty", "net.kovidgoyal.kitty", "com.github.wez.wezterm" ], From c4ab75c313e5df55123eb099f0b7aa0fc3a58151 Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:32:53 +0000 Subject: [PATCH 2/6] [nvim] some stuff including clipboard stuff --- .config/nvim/lazy-lock.json | 24 ++++++----- .config/nvim/lua/core/keymaps.lua | 10 +++++ .config/nvim/lua/plugins/cmp.lua | 62 ++++++++++++++++++---------- .config/nvim/lua/plugins/editing.lua | 1 - .config/nvim/lua/plugins/ui.lua | 18 ++++++++ 5 files changed, 81 insertions(+), 34 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2913395..e63c1f5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,6 +2,7 @@ "LuaSnip": { "branch": "master", "commit": "659c4479529a05cc9b05ef762639a09d366cc690" }, "blame.nvim": { "branch": "main", "commit": "39bb4cda9e658d053a43919b10ca52c0a4d738e1" }, "cellular-automaton.nvim": { "branch": "main", "commit": "11aea08aa084f9d523b0142c2cd9441b8ede09ed" }, + "cinnamon.nvim": { "branch": "master", "commit": "ecd211e46a1d4fb0efffbdb2c2bbd59785605870" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, @@ -9,36 +10,37 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "8c354323201d04530727d8bdcc4669791ee082ef" }, - "dressing.nvim": { "branch": "master", "commit": "43b8f74e0b1e3f41e51f640f8efa3bcd401cea0d" }, - "flutter-tools.nvim": { "branch": "main", "commit": "7e6d8611d8606efca64cb8cf1ca07550b7087d1c" }, + "conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" }, + "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, + "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, + "flutter-tools.nvim": { "branch": "main", "commit": "fb976f0e83296d011be95701085ff4711a89de94" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, - "fzf-lua": { "branch": "main", "commit": "9503aff787bfb278ab7b067a426187f97babc209" }, + "fzf-lua": { "branch": "main", "commit": "2a7eb32871a131e24021dd1756865e475fe7e274" }, "gruvbox-material": { "branch": "master", "commit": "b16dcd787db5ba9302b54ebeac186784c2aed29a" }, - "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, + "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lspkind.nvim": { "branch": "master", "commit": "a700f1436d4a938b1a1a93c9962dc796afbaef4d" }, "ltex-extra.nvim": { "branch": "master", "commit": "24acd044ce7a26b3cdb537cbd094de37c3e1ac45" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "cab00668464d2914d0752b86168b4a431cc93eb2" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" }, - "noice.nvim": { "branch": "main", "commit": "2087bbf8cd64482b47fb5f33b5e0eabf329ab14b" }, + "noice.nvim": { "branch": "main", "commit": "6e0c8dcc61282782ac7fa4b9b4b0c910fd3f83d9" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, "nvim-cmp": { "branch": "perf", "commit": "6c3d595f3223c1ae7392d4fde1626355439af6c1" }, - "nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" }, + "nvim-dap": { "branch": "master", "commit": "29d1f8814fa4fcc194ec574de998a42a22ebbe4a" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, - "nvim-lspconfig": { "branch": "master", "commit": "d2d153a179ed59aa7134d7ebdf4d7dcb156efa22" }, + "nvim-lspconfig": { "branch": "master", "commit": "87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "7646c1c12a3121562aa87fd79aace48c728ac096" }, + "nvim-treesitter": { "branch": "master", "commit": "13c7caf8a602488b37cdefe8543c4cfdd5947d9d" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" }, "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, - "oil.nvim": { "branch": "master", "commit": "8735d185b37457bd899cd4e47a4517b899407949" }, + "oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "refactoring.nvim": { "branch": "master", "commit": "53ed6854e0bba64d467c58e87084dcf8b1c22d36" }, "rustaceanvim": { "branch": "master", "commit": "8ece53be36515cb9e76f3d03511643636469502d" }, diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index a2e4af7..3ef2e92 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -9,3 +9,13 @@ vim.keymap.set("n", "", "bp") vim.keymap.set("n", "", "bn") --jk as escape vim.keymap.set("i", "jk","") +-- Copy to system clipboard +vim.keymap.set({ 'n', 'x' }, 'gy', '"+y', { desc = 'Copy to system clipboard' }) +-- Paste from system clipboard in normal mode +vim.keymap.set('n', 'gp', '"+p', { desc = 'Paste from system clipboard' }) +-- Paste from system clipboard in visual mode without overwriting the clipboard +vim.keymap.set('x', 'gp', '"+P', { desc = 'Paste from system clipboard' }) +--Center screen after some motions +vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) +vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) +vim.keymap.set("n", "G", "Gzz", {desc = "Center cursor after moving down half-page"}) diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 2e85eaf..7f96934 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -21,8 +21,9 @@ return { local luasnip = require("luasnip") require("luasnip/loaders/from_vscode").lazy_load() - local lspkind = require("lspkind") + vim.opt.pumheight = 15 + local lspkind = require("lspkind") cmp.setup({ snippet = { expand = function(args) @@ -58,22 +59,33 @@ return { end), }, formatting = { - fields = { "kind", "abbr", "menu" }, - format = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - ellipsis_char = "...", - show_labelDetails = true, - - before = function(entry, vim_item) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - nvim_lua = "[NVIM LSP]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }), + fields = { "kind", "abbr" }, + format = function(entry, vim_item) + local formatted_entry = lspkind.cmp_format({ + mode = "symbol", + maxwidth = { + menu = 0 + }, + show_labelDetails = false + })(entry, vim_item) + formatted_entry.kind = (formatted_entry.kind or "") .. " " + -- local item = entry:get_completion_item() + -- if item.detail then + -- local detail = item.detail + -- if string.find(detail, "->") ~= nil then + -- local return_arrow = vim.split(detail, "->", { trimempty = true }) + -- detail = vim.trim(return_arrow[2] or "") + -- end + -- if string.len(detail) <= 10 then + -- print("<=10 " .. detail) + -- formatted_entry.menu = detail + -- else + -- print(">10 " .. detail) + -- formatted_entry.menu = nil + -- end + -- end + return formatted_entry + end }, preselect = cmp.PreselectMode.None, sorting = { @@ -82,9 +94,6 @@ return { cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, - cmp.config.compare.kind, - cmp.config.compare.recently_used, - cmp.config.compare.locality, --Make entries that start with underline appear after function(entry1, entry2) @@ -98,12 +107,17 @@ return { return true end end, + + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, }, }, sources = cmp.config.sources({ { name = "nvim_lua" }, { name = "nvim_lsp" }, - { name = "luasnip" }, + --{ name = "luasnip" }, { name = "path" }, }, { { name = "buffer", keyword_length = 5 }, @@ -117,7 +131,11 @@ return { border = "rounded", winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None", }, - } + }, + experimental = { + native_menu = false, + ghost_text = false, + }, }) local cmp_autopairs = require("nvim-autopairs.completion.cmp") diff --git a/.config/nvim/lua/plugins/editing.lua b/.config/nvim/lua/plugins/editing.lua index 21fa183..9436788 100644 --- a/.config/nvim/lua/plugins/editing.lua +++ b/.config/nvim/lua/plugins/editing.lua @@ -22,7 +22,6 @@ return { }) end, }, - { "epwalsh/obsidian.nvim", version = "v3.9.0", diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index d7b6034..bd98dc4 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -1,4 +1,5 @@ return { + { "vimpostor/vim-tpipeline", config = function() @@ -73,6 +74,23 @@ return { -- } -- } -- }, + { + "karb94/neoscroll.nvim", + config = function() + local neoscroll = require('neoscroll') + neoscroll.setup({ + hide_cursor = false, + }) + local keymap = { + [""] = function() neoscroll.ctrl_u({ duration = 150 }) end, + [""] = function() neoscroll.ctrl_d({ duration = 150 }) end, + } + local modes = { 'n', 'v', 'x' } + for key, func in pairs(keymap) do + vim.keymap.set(modes, key, func) + end + end + }, { "folke/zen-mode.nvim", event = "VeryLazy", From c8ba56a524a461912aa0fefc9aa47a7e3261521e Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:33:21 +0000 Subject: [PATCH 3/6] [zsh] ls on cd and zshenv fix --- .config/zsh/.zshenv | 3 +++ .config/zsh/functions.zsh | 11 +++++++++++ .zshenv | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index 654463f..4366349 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -32,6 +32,9 @@ export PATH="$HOME/.ghcup/bin:$PATH" export PATH="$HOME/.miniforge3/bin:$PATH" export PATH="$HOME/.cabal/bin:$PATH" +export GOPATH="$HOME/go" +export GOBIN="$GOPATH/bin" + #Android stuff export ANDROID_HOME=~/android/sdk export ANDROID_TOOLS_PATHS=$ANDROID_HOME/cmdline-tools/latest/bin: diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh index 2374f31..a6b7735 100644 --- a/.config/zsh/functions.zsh +++ b/.config/zsh/functions.zsh @@ -45,3 +45,14 @@ function qmk_flash_left(){ } alias nvim_update='nvim --headless "+Lazy! sync" +qa' + +alias ..="cd .." + +function cd() +{ + builtin cd "$@" && ls; +} + + + + diff --git a/.zshenv b/.zshenv index 2f5e933..59c76e6 100644 --- a/.zshenv +++ b/.zshenv @@ -1,2 +1,3 @@ -export XDG_CONFIG_HOME="$HOME/.config" -export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +export XDG_CONFIG_HOME="$HOME"/.config +export ZDOTDIR="$XDG_CONFIG_HOME"/zsh +source "$ZDOTDIR"/.zshenv From 1276307cc367cfba3955a2f77d9f5cf557272f84 Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:33:37 +0000 Subject: [PATCH 4/6] [tmux] lazygit plugin for tmux --- .config/tmux/tmux_binds.conf | 6 +++--- .config/tmux/tmux_plugins.conf | 14 ++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.config/tmux/tmux_binds.conf b/.config/tmux/tmux_binds.conf index f2ffeb4..c5574b8 100644 --- a/.config/tmux/tmux_binds.conf +++ b/.config/tmux/tmux_binds.conf @@ -27,6 +27,6 @@ bind-key 'o' if-shell "$is_vim" 'send-keys F8' 'select-pane -R' unbind s bind-key 's' display-popup -E -w 90% -h 90% "~/.local/bin/tms" -#Lazygit -unbind g -bind-key 'g' display-popup -d '#{pane_current_path}' -E -w 95% -h 95% "lazygit" +#Lazygit (now taken care of by plugins) +# unbind g +# bind-key 'g' display-popup -d '#{pane_current_path}' -E -w 95% -h 95% "lazygit" diff --git a/.config/tmux/tmux_plugins.conf b/.config/tmux/tmux_plugins.conf index 83f2c08..266b34d 100644 --- a/.config/tmux/tmux_plugins.conf +++ b/.config/tmux/tmux_plugins.conf @@ -3,20 +3,14 @@ # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' -#set -g @plugin 'catppuccin/tmux' -set -g @plugin 'tmux-plugins/tmux-resurrect' -set -g @plugin 'tmux-plugins/tmux-continuum' -set -g @plugin 'sainnhe/tmux-fzf' set -g @plugin 'niqodea/tmux-matryoshka' -#set -g @plugin 'tomhey/tmux-remote-sessions' +set -g @plugin 'AngryMorrocoy/tmux-neolazygit' +set -g @plugin 'laktak/extrakto' +set -g @plugin 'Morantron/tmux-fingers' # Plugin settings -#set -g @catppuccin_flavour 'latte' -#set -g @catppuccin_window_tabs_enabled on set -g @resurrect-strategy-nvim 'session' set -g @resurrect-capture-pane-contents 'on' -#set -g @continuum-restore 'on' set -g @continuum-save-interval '5' -#set -g @continuum-boot 'on' -#set -g @continuum-boot-options 'alacritty' +set -g @open-lazygit 'g' From f3fb9e2de9b2ef616f8d40a865b2433c00607b34 Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:34:07 +0000 Subject: [PATCH 5/6] [scripts] remove trailing / on tms --- .local/bin/tms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/tms b/.local/bin/tms index 40731ab..182cdc2 100755 --- a/.local/bin/tms +++ b/.local/bin/tms @@ -6,7 +6,7 @@ else uni_projects=$(find ~/projects/University -mindepth 3 -maxdepth 3 -type d) personal_projects=$(find ~/projects/Personal -mindepth 1 -maxdepth 1 -type d) work_projects=$(find ~/projects/Work -mindepth 1 -maxdepth 1 -type d) - vaults=$(find ~/vaults/ -mindepth 2 -maxdepth 2 -type d) + vaults=$(find ~/vaults -mindepth 2 -maxdepth 2 -type d) gits=$(find ~/gits -mindepth 1 -maxdepth 1 -type d) dotfiles=$(find ~/.config -mindepth 1 -maxdepth 1 -type d) #Merge the two lists From ccd26af3269f6a931a68cb01a748be962cd4387e Mon Sep 17 00:00:00 2001 From: afonso Date: Thu, 28 Nov 2024 18:34:29 +0000 Subject: [PATCH 6/6] [ghostty] initial config --- .config/ghostty/config | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .config/ghostty/config diff --git a/.config/ghostty/config b/.config/ghostty/config new file mode 100644 index 0000000..6e32c08 --- /dev/null +++ b/.config/ghostty/config @@ -0,0 +1,9 @@ +# Font +font-family = JetBrainsMono Nerd Font Mono +font-size = 16 + +# Theme +theme = GruvboxDarkHard +background = 1d2021 +window-theme = ghostty +window-decoration = false