From 376656e51c05b908510e01313aacba3509c0fd4c Mon Sep 17 00:00:00 2001 From: Max Richter Date: Tue, 13 Dec 2022 11:30:23 +0100 Subject: [PATCH] feat: update some stuff --- configs/.p10k.zsh | 45 +++++++++++------------ configs/.zshrc | 12 +++++- configs/lazygit/state.yml | 6 ++- configs/nvim/lua/configs/autocomplete.lua | 5 +-- configs/nvim/lua/configs/lsp.lua | 27 +++++++------- configs/nvim/lua/configs/lualine.lua | 26 +++++++++++++ configs/nvim/lua/core/keymappings.lua | 11 +++--- configs/nvim/lua/core/options.lua | 4 +- configs/nvim/lua/core/plugins.lua | 25 +++++++------ configs/nvim/lua/overlays.lua | 14 +++---- configs/nvim/lua/theme/catpuccin.lua | 6 --- 11 files changed, 107 insertions(+), 74 deletions(-) diff --git a/configs/.p10k.zsh b/configs/.p10k.zsh index 47c204b..f0e294d 100644 --- a/configs/.p10k.zsh +++ b/configs/.p10k.zsh @@ -1,7 +1,7 @@ -# Generated by Powerlevel10k configuration wizard on 2021-09-16 at 15:20 CEST. +# Generated by Powerlevel10k configuration wizard on 2022-12-06 at 23:53 CET. # Based on romkatv/powerlevel10k/config/p10k-pure.zsh. -# Wizard options: nerdfont-complete + powerline, small icons, pure, rpromt, 1 line, -# compact, transient_prompt, instant_prompt=verbose. +# Wizard options: nerdfont-complete + powerline, large icons, pure, snazzy, 1 line, +# compact, instant_prompt=quiet. # Type `p10k configure` to generate another config. # # Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). @@ -38,30 +38,29 @@ autoload -Uz is-at-least && is-at-least 5.1 || return # Prompt colors. - local main='242' local grey='242' - local red='1' - local yellow='3' - local blue='4' - local magenta='5' - local cyan='6' - local white='7' + local red='#FF5C57' + local yellow='#F3F99D' + local blue='#57C7FF' + local magenta='#FF6AC1' + local cyan='#9AEDFE' + local white='#F1F1F0' # Left prompt segments. typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( - # context # user@host + context # user@host dir # current directory vcs # git status - # command_execution_time # previous command duration - # virtualenv # python virtual environment + command_execution_time # previous command duration + virtualenv # python virtual environment prompt_char # prompt symbol ) # Right prompt segments. typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( - command_execution_time # previous command duration - virtualenv # python virtual environment - context # user@host + # command_execution_time # previous command duration + # virtualenv # python virtual environment + # context # user@host # time # current time ) @@ -77,15 +76,15 @@ typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false # Magenta prompt symbol if the last command succeeded. - typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$main + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$gray # Red prompt symbol if the last command failed. typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red # Default prompt symbol. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='>' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='▶' # Prompt symbol in command vi mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='>' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮' # Prompt symbol in visual vi mode is the same as in command mode. - typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='>' + typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮' # Prompt symbol in overwrite vi mode is the same as in command mode. typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false @@ -96,7 +95,7 @@ typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Blue current directory. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=$white + typeset -g POWERLEVEL9K_DIR_FOREGROUND=$gray # Context format when root: user@host. The first part white, the rest grey. typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f" @@ -162,7 +161,7 @@ # - always: Trim down prompt when accepting a command line. # - same-dir: Trim down prompt when accepting a command line unless this is the first command # typed after changing current working directory. - typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off # Instant prompt mode. # @@ -174,7 +173,7 @@ # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. - typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose + typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized. # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload diff --git a/configs/.zshrc b/configs/.zshrc index 9467ea3..5a173d8 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -6,6 +6,9 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. +[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh + if [ -d "$HOME/.asdf" ] ; then . "$HOME/.asdf/asdf.sh" fi @@ -106,17 +109,22 @@ if type podman &> /dev/null; then source <(podman completion zsh) fi -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +if type podman-compose &> /dev/null; then + alias pc=podman-compose +fi + # Auto connect to tmux session of ssh if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then # tmux attach-session -t $USER || tmux new-session -s $USER fi + export PNPM_HOME="$HOME/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH" +[ -n "$TMUX" ] && export TERM=screen-256color + # tabtab source for packages # uninstall by removing these lines [[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true diff --git a/configs/lazygit/state.yml b/configs/lazygit/state.yml index 10f24fd..e2f04f8 100644 --- a/configs/lazygit/state.yml +++ b/configs/lazygit/state.yml @@ -1,11 +1,15 @@ lastupdatecheck: 0 recentrepos: +- /home/max/.dotfiles +- /home/max/Projects/ruumio/feat-api +- /home/max/Projects/nx-test +- /home/max/Projects/ruumio/new-api-stack +- /home/max/Projects/ruumio/nx-test - /home/max/Projects/silvester - /home/max/Projects/ruumio/main - /home/max/Projects/ruumio/feat-prejoin-avatar-soon - /home/max/Projects/ruumio/feat-wavy-bg - /home/max/Projects/ruumio/feat-3d-poi -- /home/max/.dotfiles - /home/max/Projects/plantarium - /home/max/Projects/jim-fx.com - /home/max/Projects/ruumio diff --git a/configs/nvim/lua/configs/autocomplete.lua b/configs/nvim/lua/configs/autocomplete.lua index 981e61d..43dd6b1 100644 --- a/configs/nvim/lua/configs/autocomplete.lua +++ b/configs/nvim/lua/configs/autocomplete.lua @@ -8,7 +8,7 @@ local cmp_autopairs = require("nvim-autopairs.completion.cmp") require("nvim-autopairs").setup() require("copilot").setup() require("copilot_cmp").setup({ - clear_after_cursor = true + clear_after_cursor = true, }) cmp.setup({ @@ -58,11 +58,10 @@ cmp.setup({ { name = "copilot" }, { name = "nvim_lua" }, { name = "nvim_lsp" }, - -- { name = "cmp_tabnine", max_item_count = 3 }, { name = "luasnip" }, { name = "emoji" }, { name = "path" }, - { name = "buffer" }, + -- { name = "buffer" }, { name = "calc" }, }, }) diff --git a/configs/nvim/lua/configs/lsp.lua b/configs/nvim/lua/configs/lsp.lua index 0cc63f9..450f5df 100644 --- a/configs/nvim/lua/configs/lsp.lua +++ b/configs/nvim/lua/configs/lsp.lua @@ -74,7 +74,7 @@ lsp.sumneko_lua.setup({ }, }) -local capabilities = require("cmp_nvim_lsp").default_capabilities(); +local capabilities = require("cmp_nvim_lsp").default_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true @@ -101,6 +101,7 @@ lsp.jsonls.setup({ capabilities = capabilities, on_attach = on_attach, settings = { + provideFormatter = false, json = { schemas = { { @@ -151,13 +152,13 @@ lsp.intelephense.setup({ "wp-cli", }, environment = { - includePaths = '/home/max/.composer/vendor/php-stubs/' -- this line forces the composer path for the stubs in case inteliphense don't find it... + includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it... }, files = { - maxSize = 5000000; - }; - }; - } + maxSize = 5000000, + }, + }, + }, }) lsp.cssls.setup({ capabilities = capabilities, @@ -197,10 +198,10 @@ lsp.rust_analyzer.setup({ }, }) -lsp.gopls.setup { +lsp.gopls.setup({ capabilities = capabilities, - on_attach = on_attach -} + on_attach = on_attach, +}) lsp.yamlls.setup({ capabilities = capabilities, @@ -211,10 +212,10 @@ lsp.yamlls.setup({ ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*", ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml", - ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml" - } - } - } + ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml", + }, + }, + }, }) lsp.glslls.setup(require("configs.lsp-glsl")) diff --git a/configs/nvim/lua/configs/lualine.lua b/configs/nvim/lua/configs/lualine.lua index 4df0b1f..fdfe948 100644 --- a/configs/nvim/lua/configs/lualine.lua +++ b/configs/nvim/lua/configs/lualine.lua @@ -139,6 +139,32 @@ ins_left({ }, }) +ins_left({ + "lsp_progress", + -- With spinner + colors = { + percentage = colors.cyan, + title = colors.cyan, + message = colors.cyan, + spinner = colors.cyan, + lsp_client_name = colors.magenta, + use = true, + }, + separators = { + component = " ", + progress = " | ", + -- message = { pre = "(", post = ")" }, + percentage = { pre = "", post = "%% " }, + title = { pre = "", post = ": " }, + lsp_client_name = { pre = "[", post = "]" }, + spinner = { pre = "", post = "" }, + message = { commenced = "In Progress", completed = "Completed" }, + }, + display_components = { "lsp_client_name", "spinner", { "title", "percentage", "message" } }, + timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 }, + spinner_symbols = { "🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 " }, +}) + -- Git Diff local function diff_source() local gitsigns = vim.b.gitsigns_status_dict diff --git a/configs/nvim/lua/core/keymappings.lua b/configs/nvim/lua/core/keymappings.lua index f92e40d..0890671 100644 --- a/configs/nvim/lua/core/keymappings.lua +++ b/configs/nvim/lua/core/keymappings.lua @@ -14,7 +14,7 @@ g.mapleader = " " -- Allows to easily exit terminal mode -- map('t', '', [[]], remap) -map("n", "", ":Telescope find_files", options) +map("n", "", ":Telescope find_files preview={timeout=1000}", options) map("n", "", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }", options) -- map("n", "", ":Telescope command_center", options) map("n", "", "za", remap) @@ -28,15 +28,14 @@ map("n", "gi", "lua vim.lsp.buf.implementation()", options) map("n", "K", "Lspsaga hover_doc", { silent = true }) -- map("n", "o", "LSoutlineToggle", { silent = true }) -map("n", "e", "Lspsaga show_cursor_diagnostics", { silent = true }) -map("n", "rn", "Lspsaga rename", options) +map("n", "e", "lua vim.lsp.buf.hover()", { silent = true }) +map("n", "rn", "lua vim.lsp.buf.rename()", options) map({ "n", "v" }, "c", "Lspsaga code_action", { silent = true }) -map({ "n", "v" }, "gr", "Lspsaga lsp_finder", options) +map({ "n", "v" }, "gr", "Lspsaga lsp_finder", options) map("n", "t", ":TroubleToggle", remap) -map("n", "t", translate, remap) -map("v", "t", translate, remap) +map({ "n", "v" }, "t", translate, remap) -- DAP Functionality map("n", "b", ":lua require('dap').toggle_breakpoint()", options) diff --git a/configs/nvim/lua/core/options.lua b/configs/nvim/lua/core/options.lua index f1dae42..dcb89c8 100644 --- a/configs/nvim/lua/core/options.lua +++ b/configs/nvim/lua/core/options.lua @@ -2,7 +2,7 @@ -- General -- ------------- local set = vim.opt -local g = vim.g; +local g = vim.g set.swapfile = false -- Don't use swapfile set.updatetime = 0 -- Faster completion set.encoding = "utf-8" -- The encoding displayed @@ -73,6 +73,6 @@ vim.diagnostic.config({ ----------------- set.hidden = true -- Required to keep multiple buffers open multiple buffers set.timeoutlen = 500 -- By default timeoutlen is 1000 ms -set.lazyredraw = true -- Disable lazyredraw +set.lazyredraw = false -- Disable lazyredraw set.synmaxcol = 240 -- Max column for syntax highlight set.updatetime = 700 -- ms to wait for trigger an event diff --git a/configs/nvim/lua/core/plugins.lua b/configs/nvim/lua/core/plugins.lua index d019eb3..d49b581 100644 --- a/configs/nvim/lua/core/plugins.lua +++ b/configs/nvim/lua/core/plugins.lua @@ -41,15 +41,22 @@ return packer.startup(function(use) "petertriho/nvim-scrollbar", config = function() require("configs.scrollbar") - end + end, }) use({ "lewis6991/gitsigns.nvim", config = function() - require('gitsigns').setup() - end + require("gitsigns").setup() + end, }) use("akinsho/nvim-toggleterm.lua") + use({ + "akinsho/git-conflict.nvim", + tag = "*", + config = function() + require("git-conflict").setup() + end, + }) use({ "rcarriga/nvim-notify", @@ -102,12 +109,8 @@ return packer.startup(function(use) -- Lsp Setup -- --------------- + use("arkav/lualine-lsp-progress") use("neovim/nvim-lspconfig") - use({ 'j-hui/fidget.nvim', - config = function() - require('fidget').setup() - end - }) use("williamboman/mason.nvim") use("williamboman/mason-lspconfig.nvim") use("jose-elias-alvarez/null-ls.nvim") @@ -137,7 +140,6 @@ return packer.startup(function(use) use({ "hrsh7th/nvim-cmp", requires = { - "rafamadriz/friendly-snippets", "saadparwaiz1/cmp_luasnip", "L3MON4D3/LuaSnip", @@ -205,7 +207,8 @@ return packer.startup(function(use) -------------------- -- IDE Type Stuff -- -------------------- - use({ "ThePrimeagen/git-worktree.nvim", + use({ + "ThePrimeagen/git-worktree.nvim", config = function() require("git-worktree").setup() end, @@ -220,7 +223,7 @@ return packer.startup(function(use) -- Dap Debugger -- Have not yet been able to set this up use({ "mfussenegger/nvim-dap" }) use({ "rcarriga/nvim-dap-ui" }) - use { "mxsdev/nvim-dap-vscode-js", requires = { "mfussenegger/nvim-dap" } } + use({ "mxsdev/nvim-dap-vscode-js", requires = { "mfussenegger/nvim-dap" } }) use("editorconfig/editorconfig-vim") use({ diff --git a/configs/nvim/lua/overlays.lua b/configs/nvim/lua/overlays.lua index 17b3d9c..a44655e 100644 --- a/configs/nvim/lua/overlays.lua +++ b/configs/nvim/lua/overlays.lua @@ -5,11 +5,11 @@ local lazygit = Terminal:new({ direction = "float", float_opts = { winblend = 0, - border = "shadow" + border = "shadow", }, on_close = function() Terminal:close() - end + end, }) function _Lazygit_toggle() @@ -22,7 +22,7 @@ local pnpm = Terminal:new({ cmd = "pnpm dev", dir = "git_dir", size = 5, - direction = "vertical" + direction = "vertical", }) function _Pnpm_toggle() @@ -33,7 +33,7 @@ vim.api.nvim_set_keymap("n", "d", "lua _Pnpm_toggle()", { norem local chtConfig = Terminal:new({ cmd = "cht", - direction = "float" + direction = "float", }) function _ChtConfig_toggle() @@ -42,6 +42,6 @@ end vim.api.nvim_set_keymap("n", "", "lua _ChtConfig_toggle()", { noremap = true, silent = true }) -require("toggleterm").setup { - shade_terminals = true -} +require("toggleterm").setup({ + shade_terminals = true, +}) diff --git a/configs/nvim/lua/theme/catpuccin.lua b/configs/nvim/lua/theme/catpuccin.lua index e5347c5..15c286f 100644 --- a/configs/nvim/lua/theme/catpuccin.lua +++ b/configs/nvim/lua/theme/catpuccin.lua @@ -38,12 +38,6 @@ cat.setup({ }, }) --- require("nightfox").setup({ --- options = { --- transparent = true, --- }, --- }) - vim.cmd("colorscheme catppuccin") require("utils.theme-reloader")