From e189b6856a03d77ed5bd90b118a72b8c503e150d Mon Sep 17 00:00:00 2001 From: afranco Date: Sun, 26 May 2024 16:18:00 +0100 Subject: [PATCH] chore(all): change stuff in a lot of things --- .config/nvim/.luarc.json | 6 +- .config/nvim/init.lua | 1 - .config/nvim/lua/plugins/conform.lua | 1 + .config/nvim/lua/plugins/lazy.lua | 125 ++++++++++++++----------- .config/nvim/lua/plugins/lspconfig.lua | 116 ++--------------------- .config/nvim/lua/plugins/mason.lua | 9 +- .config/nvim/lua/plugins/telescope.lua | 15 +-- .config/nvim/lua/winbar.lua | 5 +- .config/skhd/skhdrc | 4 +- .config/zsh/themes/gruvbox_dark.zsh | 35 +++++++ .config/zsh/themes/gruvbox_light.zsh | 35 +++++++ .gitconfig | 2 + .zshrc | 2 + 13 files changed, 171 insertions(+), 185 deletions(-) diff --git a/.config/nvim/.luarc.json b/.config/nvim/.luarc.json index a24c50c..e3fbf0e 100644 --- a/.config/nvim/.luarc.json +++ b/.config/nvim/.luarc.json @@ -1,4 +1,8 @@ { "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "runtime.version": "LuaJIT" + "runtime.version": "LuaJIT", + "diagnostics.globals": [ + "vim", + "numbers" + ] } diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 18ba7c9..0f2785c 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -2,4 +2,3 @@ require("core.variables") require('core.package_manager') require('winbar') require('core.theme') -require('impatient') diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index 25cf33b..af2e4ca 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -1,6 +1,7 @@ require("conform").setup({ formatters_by_ft = { python = { "black" }, + haskell = { "fourmolu" }, javascript = { "prettierd" }, markdown = { "mdformat" }, go = { "gofmt" }, diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua index 6273cfa..0dd214d 100644 --- a/.config/nvim/lua/plugins/lazy.lua +++ b/.config/nvim/lua/plugins/lazy.lua @@ -2,28 +2,27 @@ local lazy = require("lazy") lazy.setup({ - "lewis6991/impatient.nvim", - -------------------------------------------THEMES------------------------------------------ { "catppuccin/nvim", name = "catppuccin", + event = "VeryLazy", lazy = false, priority = 1000, opts = {}, }, - "sainnhe/gruvbox-material", - - -------------------------------------------------------MFP--------------------------------- { - "susliko/tla.nvim", - opts = {}, + "sainnhe/gruvbox-material", + event = "VeryLazy", + priority = 1000, }, + -------------------------------------------------------QOL--------------------------------- { "jbyuki/instant.nvim", + event = "VeryLazy", config = function() vim.g.instant_username = "afonso" end, @@ -31,6 +30,7 @@ lazy.setup({ { "iamcco/markdown-preview.nvim", + event = "VeryLazy", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, ft = { "markdown" }, build = function() vim.fn["mkdp#util#install"]() end, @@ -38,6 +38,7 @@ lazy.setup({ { "ThePrimeagen/harpoon", + event = "VeryLazy", branch = "harpoon2", dependencies = { "nvim-lua/plenary.nvim" }, config = function() @@ -52,8 +53,17 @@ lazy.setup({ end }, + { + "FabijanZulj/blame.nvim", + event = "VeryLazy", + config = function() + require("blame").setup() + end + }, + { "TobinPalmer/pastify.nvim", + event = "VeryLazy", cmd = { "Pastify" }, opts = {}, }, @@ -61,6 +71,7 @@ lazy.setup({ --Python notebooks { "luk400/vim-jukit", + event = "VeryLazy", config = function() require("plugins.jukit") end, @@ -68,7 +79,7 @@ lazy.setup({ }, --Nvim to browser - "subnut/nvim-ghost.nvim", + --"subnut/nvim-ghost.nvim", { "declancm/cinnamon.nvim", @@ -126,17 +137,19 @@ lazy.setup({ }, -- Rename variable pop up - "stevearc/dressing.nvim", + { + "stevearc/dressing.nvim", + event = "VeryLazy", + }, { "windwp/nvim-autopairs", + event = "VeryLazy", config = function() require("plugins.autopairs") end, }, - "nvim-tree/nvim-web-devicons", - { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons", opt = true }, @@ -153,6 +166,7 @@ lazy.setup({ -------------------------------------------------------LSP---------------------------------------------- { "hrsh7th/nvim-cmp", + event = "VeryLazy", dependencies = { "hrsh7th/cmp-nvim-lsp", -- lsp "hrsh7th/cmp-nvim-lua", -- Nvim API completions @@ -205,6 +219,7 @@ lazy.setup({ }, { "mfussenegger/nvim-dap", + event = "VeryLazy", config = function() require("plugins.dap") end, @@ -212,53 +227,52 @@ lazy.setup({ { 'leoluz/nvim-dap-go', + event = "VeryLazy", opts = {} }, - { - "williamboman/mason.nvim", - config = function() - require("plugins.mason") - end, - }, - - "williamboman/mason-lspconfig.nvim", - { "neovim/nvim-lspconfig", + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + { + "williamboman/mason-lspconfig.nvim", + dependencies = { + { + "williamboman/mason.nvim", + config = function() + require("plugins.mason") + end, + }, + }, + config = function() + require("plugins.mason-lspconfig") + end + }, + }, config = function() require("plugins.lspconfig") end, }, + --Better quick fix { 'kevinhwang91/nvim-bqf', + event = "VeryLazy", ft = 'qf' }, - 'junegunn/fzf', { "stevearc/conform.nvim", + event = "VeryLazy", config = function() require("plugins.conform") end, }, - { - 'dense-analysis/ale', - config = function() - vim.g.ale_linters_explicit = 1 - vim.g.ale_echo_msg_error_str = 'E' - vim.g.ale_echo_msg_warning_str = 'W' - vim.g.ale_echo_msg_format = '[%linter%] %s [%severity%]' - --vim.g.ale_linters = { - -- go = { 'golangci-lint' }, - --} - end - }, - { "lervag/vimtex", + event = "VeryLazy", config = function() require("plugins.vimtex") end, @@ -272,12 +286,16 @@ lazy.setup({ -- ft = { "rust" }, -- }, - "barreiroleo/ltex-extra.nvim", + { + "barreiroleo/ltex-extra.nvim", + event = "VeryLazy", + }, ------------------------------------------------------------------------------------------- -- Syntax Highlighting { "nvim-treesitter/nvim-treesitter", + event = { "BufReadPost", "BufNewFile" }, dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' }, @@ -295,34 +313,33 @@ lazy.setup({ end, }, - "runoshun/vim-alloy", - - --does so much { - "nvim-telescope/telescope.nvim", - tag = "0.1.4", - -- or , branch = '0.1.x', - dependencies = { - "nvim-lua/plenary.nvim", - 'nvim-telescope/telescope-ui-select.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } - }, + "ibhagwan/fzf-lua", + event = "VeryLazy", + dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() - require("plugins.telescope") - end, + require('plugins.fzf-lua') + end }, --Discord Rich Presence "andweeb/presence.nvim", --Vim be good - 'ThePrimeagen/vim-be-good', + { + 'ThePrimeagen/vim-be-good', + event = "VeryLazy", + }, + --JQ - 'jrop/jq.nvim', - { - 'BooleanCube/keylab.nvim', - opts = {} - } + 'jrop/jq.nvim', + event = "VeryLazy", + }, + + -- { + -- 'BooleanCube/keylab.nvim', + -- opts = {} + -- } }) diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 33adb2d..0bbe1f9 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -1,10 +1,5 @@ -local mason_lspconfig = require("mason-lspconfig") local lspconfig = require("lspconfig") -mason_lspconfig.setup({ - automatic_installation = false, -}) - -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer vim.api.nvim_create_autocmd("LspAttach", { @@ -14,33 +9,28 @@ vim.api.nvim_create_autocmd("LspAttach", { vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" vim.opt_local.signcolumn = numbers - local telescope = require("telescope.builtin") + local fzflua = require("fzf-lua") local conform = require("conform") local client = vim.lsp.get_client_by_id(ev.data.client_id) client.server_capabilities.semanticTokensProvider = nil - --Enable inlay hints - --vim.lsp.inlay_hint.enable(ev.buf,true) - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = ev.buf } vim.keymap.set("n", "e", vim.diagnostic.open_float, bufopts) vim.keymap.set("n", "q", vim.diagnostic.setloclist, bufopts) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts) - vim.keymap.set("n", "gd", telescope.lsp_definitions, bufopts) - vim.keymap.set("n", "gr", telescope.lsp_references, bufopts) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts) + vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) - vim.keymap.set("n", "gi", telescope.lsp_implementations, bufopts) + vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts) vim.keymap.set("n", "k", vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) - vim.keymap.set("n", "ge", function() vim.diagnostic.goto_next() end, bufopts) - vim.keymap.set("n", "gE", function() vim.diagnostic.goto_prev() end, bufopts) + vim.keymap.set("n", "ge", vim.diagnostic.goto_next, bufopts) + vim.keymap.set("n", "gE", vim.diagnostic.goto_prev, bufopts) vim.keymap.set("n", "fo", function() conform.format({ lsp_fallback = true }) end, bufopts) - vim.keymap.set("n", "n", "!toke check") end, }) @@ -49,101 +39,7 @@ local lsp_defaults = lspconfig.util.default_config local capabilities = vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities()) -mason_lspconfig.setup_handlers({ - -- This is a default handler that will be called for each installed server (also for new servers that are installed during a session) - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - ["gopls"] = function() - lspconfig["gopls"].setup({ - capabilities = capabilities, - settings = { - gopls = { - ["ui.completion.usePlaceholders"] = true, - ["ui.diagnostic.staticcheck"] = true, - ["ui.inlayhint.hints"] = { - assignVariablesTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true - }, - } - } - }) - end, - ["lua_ls"] = function() - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - hint = { enable = true } - }, - }, - }) - end, - ["ltex"] = function() - lspconfig["ltex"].setup({ - capabilities = capabilities, - --Local on attach - on_attach = function(_, _) - -- rest of your on_attach process. - require("ltex_extra").setup() - end, - settings = { - ltex = { - language = "en-US", - }, - }, - }) - end, - ["basedpyright"] = function() - lspconfig["basedpyright"].setup({ - capabilities = capabilities, - settings = { - verboseOutput = true, - autoImportCompletion = true, - basedpyright = { - analysis = { - typeCheckingMode = "all", - autoSearchPaths = true, - useLibraryCodeForTypes = true, - diagnosticMode = "openFilesOnly", - indexing = true, - }, - }, - }, - }) - end, -}) - - lspconfig["hls"].setup({ capabilities = capabilities, filetypes = { 'haskell', 'lhaskell', 'cabal' }, }) - - - - ---vim.g.rustaceanvim = { --- server = { --- capabilities = capabilities, --- }, ---} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index 6f43ffb..bdc6628 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,17 +1,13 @@ -local present, mason = pcall(require, "mason") - +local mason = require("mason") vim.api.nvim_create_augroup("_mason", { clear = true }) - local options = { PATH = "skip", - ui = { icons = { package_pending = " ", package_installed = "󰄳 ", package_uninstalled = " ", }, - keymaps = { toggle_server_expand = "", install_server = "i", @@ -23,9 +19,6 @@ local options = { cancel_installation = "", }, }, - max_concurrent_installers = 10, } - - mason.setup(options) diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 375ad2f..a3dcf85 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -4,6 +4,7 @@ local actions = require("telescope.actions") telescope.setup { defaults = { layout_strategy = "horizontal", + path_display = { "filename_first" }, mappings = { i = { [""] = actions.close, @@ -32,10 +33,10 @@ telescope.setup { } telescope.load_extension('fzf') telescope.load_extension("ui-select") - -local builtin = require('telescope.builtin') -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'fb', builtin.buffers, {}) -vim.keymap.set('n', 'fs', builtin.treesitter, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) +--local builtin = require('telescope.builtin') +--vim.keymap.set('n', 'ff', builtin.find_files, {}) +--vim.keymap.set('n', 'fe', builtin.diagnostics, {}) +--vim.keymap.set('n', 'fg', builtin.live_grep, {}) +--vim.keymap.set('n', 'fb', builtin.buffers, {}) +--vim.keymap.set('n', 'fs', builtin.treesitter, {}) +--vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/.config/nvim/lua/winbar.lua b/.config/nvim/lua/winbar.lua index 9130fcc..b0e540f 100644 --- a/.config/nvim/lua/winbar.lua +++ b/.config/nvim/lua/winbar.lua @@ -60,9 +60,10 @@ function M.render() ' ', prefix, table.concat( - vim.iter.map(function(segment) + vim.iter(vim.split(path, '/')) + :map(function(segment) return string.format('%%#Winbar#%s', segment) - end, vim.split(path, '/')), + end):totable(), separator ), } diff --git a/.config/skhd/skhdrc b/.config/skhd/skhdrc index dd2e532..964d1f1 100644 --- a/.config/skhd/skhdrc +++ b/.config/skhd/skhdrc @@ -8,8 +8,8 @@ cmd - return : yabai -m window --swap west cmd - u : yabai --load-sa && yabai --restart # Assuming you have scripting additions installed # Window Management -cmd - h : yabai -m window --resize right:-20:0 -cmd - l : yabai -m window --resize left:20:0 +#cmd - h : yabai -m window --resize right:-20:0 +#cmd - l : yabai -m window --resize left:20:0 # Focus workspaces 1 through 6 diff --git a/.config/zsh/themes/gruvbox_dark.zsh b/.config/zsh/themes/gruvbox_dark.zsh index 52a3092..549e41c 100644 --- a/.config/zsh/themes/gruvbox_dark.zsh +++ b/.config/zsh/themes/gruvbox_dark.zsh @@ -106,3 +106,38 @@ pure_prompt_colors() { for color in $(pure_prompt_colors); do zstyle ":prompt:pure:$color" color "$color" done + +# FZF +# # Scheme name: Gruvbox dark, hard +# Scheme system: base16 +# Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) +# Template author: Tinted Theming (https://github.com/tinted-theming) + +_gen_fzf_default_opts() { + +local color00='#1d2021' +local color01='#3c3836' +local color02='#504945' +local color03='#665c54' +local color04='#bdae93' +local color05='#d5c4a1' +local color06='#ebdbb2' +local color07='#fbf1c7' +local color08='#fb4934' +local color09='#fe8019' +local color0A='#fabd2f' +local color0B='#b8bb26' +local color0C='#8ec07c' +local color0D='#83a598' +local color0E='#d3869b' +local color0F='#d65d0e' + +export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS"\ +" --color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D"\ +" --color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C"\ +" --color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D" + +} + +_gen_fzf_default_opts + diff --git a/.config/zsh/themes/gruvbox_light.zsh b/.config/zsh/themes/gruvbox_light.zsh index 1c2507e..36f6c7e 100644 --- a/.config/zsh/themes/gruvbox_light.zsh +++ b/.config/zsh/themes/gruvbox_light.zsh @@ -102,3 +102,38 @@ pure_prompt_colors() { for color in $(pure_prompt_colors); do zstyle ":prompt:pure:$color" color "$color" done + + +#FZF +# Scheme name: Gruvbox light, soft +# Scheme system: base16 +# Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) +# Template author: Tinted Theming (https://github.com/tinted-theming) + +_gen_fzf_default_opts() { + +local color00='#f2e5bc' +local color01='#ebdbb2' +local color02='#d5c4a1' +local color03='#bdae93' +local color04='#665c54' +local color05='#504945' +local color06='#3c3836' +local color07='#282828' +local color08='#9d0006' +local color09='#af3a03' +local color0A='#b57614' +local color0B='#79740e' +local color0C='#427b58' +local color0D='#076678' +local color0E='#8f3f71' +local color0F='#d65d0e' + +export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS"\ +" --color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D"\ +" --color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C"\ +" --color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D" + +} + +_gen_fzf_default_opts diff --git a/.gitconfig b/.gitconfig index 3b609a1..98c2a1c 100644 --- a/.gitconfig +++ b/.gitconfig @@ -32,3 +32,5 @@ rebase = false [init] defaultBranch = main +[alias] + 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 }' #" diff --git a/.zshrc b/.zshrc index bc6466b..09db794 100644 --- a/.zshrc +++ b/.zshrc @@ -9,6 +9,8 @@ export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.ghcup/bin:$PATH" export PATH="$HOME/.miniforge3/bin:$PATH" export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH" +export PATH="/opt/homebrew/opt/texlive/bin:$PATH" +export PATH="$HOME/.cabal/bin:$PATH" export GOPATH=$HOME/.go export PATH=$PATH:$GOPATH/bin