From 6b431704debf3c8635209f739cb9e75cb56ec77b Mon Sep 17 00:00:00 2001 From: Max Richter Date: Mon, 21 Aug 2023 14:43:53 +0200 Subject: [PATCH] feat: some shit --- configs/.p10k.zsh | 16 +++--- configs/.zshrc | 23 ++++---- configs/nvim/lazy-lock.json | 54 +++++++++---------- configs/nvim/lua/max/core/autocommands.lua | 12 ----- configs/nvim/lua/max/core/options.lua | 14 ++--- configs/nvim/lua/max/plugins/lsp.lua | 8 +-- configs/nvim/lua/max/plugins/lspsage.lua | 1 + configs/nvim/lua/max/plugins/statuscolumn.lua | 2 +- configs/nvim/lua/max/plugins/treesitter.lua | 22 +++++++- 9 files changed, 78 insertions(+), 74 deletions(-) diff --git a/configs/.p10k.zsh b/configs/.p10k.zsh index c8c37b3..6748aec 100644 --- a/configs/.p10k.zsh +++ b/configs/.p10k.zsh @@ -1,7 +1,7 @@ -# Generated by Powerlevel10k configuration wizard on 2022-12-06 at 23:53 CET. +# Generated by Powerlevel10k configuration wizard on 2023-08-21 at 10:53 CEST. # Based on romkatv/powerlevel10k/config/p10k-pure.zsh. # Wizard options: nerdfont-complete + powerline, large icons, pure, snazzy, 1 line, -# compact, instant_prompt=quiet. +# compact, transient_prompt, instant_prompt=verbose. # Type `p10k configure` to generate another config. # # Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). @@ -35,7 +35,7 @@ unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR' # Zsh >= 5.1 is required. - autoload -Uz is-at-least && is-at-least 5.1 || return + [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return # Prompt colors. local grey='242' @@ -76,11 +76,11 @@ 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=$gray + typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$grey # 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='❮' # Prompt symbol in visual vi mode is the same as in command mode. @@ -95,7 +95,7 @@ typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER= # Blue current directory. - typeset -g POWERLEVEL9K_DIR_FOREGROUND=$gray + typeset -g POWERLEVEL9K_DIR_FOREGROUND=$white # 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" @@ -161,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=off + typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always # Instant prompt mode. # @@ -173,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=quiet + typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose # 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 a8c4f20..e00a709 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -6,19 +6,15 @@ 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 - -# THis should fix up arrow autocompletion with the zsh-vi-mode plugin +# This should fix up arrow autocompletion with the zsh-vi-mode plugin function zvm_before_init() { zvm_bindkey viins '^[[A' history-beginning-search-backward zvm_bindkey viins '^[[B' history-beginning-search-forward zvm_bindkey vicmd '^[[A' history-beginning-search-backward zvm_bindkey vicmd '^[[B' history-beginning-search-forward + export ZVM_VI_EDITOR=nvim + export ZVM_INIT_MODE=sourcing } if [ -f "$HOME/.config/zsh/antigen.zsh" ] ; then @@ -28,7 +24,7 @@ if [ -f "$HOME/.config/zsh/antigen.zsh" ] ; then antigen bundle docker antigen bundle sudo antigen bundle asdf - antigen bundle jeffreytse/zsh-vi-mode + # antigen bundle jeffreytse/zsh-vi-mode antigen theme romkatv/powerlevel10k antigen bundle zsh-users/zsh-autosuggestions antigen bundle zsh-users/zsh-syntax-highlighting @@ -36,7 +32,14 @@ if [ -f "$HOME/.config/zsh/antigen.zsh" ] ; then fi # Enable vim mode in zsh -bindkey -v +# bindkey -v + +# 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 if [[ -z "$XDG_RUNTIME_DIR" ]]; then export XDG_RUNTIME_DIR=/run/user/$UID @@ -147,4 +150,4 @@ export PNPM_HOME="/home/max/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH" # pnpm end -zvm_after_init_commands+=("bindkey '^[[A' up-line-or-search" "bindkey '^[[B' down-line-or-search") + zvm_after_init_commands+=("bindkey '^[[A' up-line-or-search" "bindkey '^[[B' down-line-or-search") diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index aea565a..b723810 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -1,67 +1,67 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "e81cbe6004051c390721d8570a4a0541ceb0df10" }, - "alpha-nvim": { "branch": "main", "commit": "e4fc5e29b731bdf55d204c5c6a11dc3be70f3b65" }, + "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, + "alpha-nvim": { "branch": "main", "commit": "7a6b9487dba044a43fde534bf5036f0fda5b6b23" }, "arduino-helper.nvim": { "branch": "master", "commit": "5ec57de680a94f8e948e2e0c6328939b9b63a598" }, "autolist.nvim": { "branch": "main", "commit": "5f70a5f99e96c8fe3069de042abd2a8ed2deb855" }, "barbar.nvim": { "branch": "master", "commit": "8cca17ea0ced3ba564e5da972a25600edafe7d7b" }, "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, - "catppuccin": { "branch": "main", "commit": "057c34f849cf21059487d849e2f3b3efcd4ee0eb" }, + "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, - "copilot.lua": { "branch": "master", "commit": "e48bd7020a98be217d85c006a298656294fd6210" }, + "copilot-cmp": { "branch": "master", "commit": "d631b3afbf26bb17d6cf2b3cd8f3d79e7d5eeca1" }, + "copilot.lua": { "branch": "master", "commit": "b3798d85322b1aaa56cad9d651d2d1aaec6298e9" }, "flit.nvim": { "branch": "main", "commit": "498b3a4864e697f1ed1145e518c4c78c776c55d8" }, - "friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" }, + "friendly-snippets": { "branch": "main", "commit": "377d45475b49e37460a902d6d569d2093d4037d0" }, "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, - "gitsigns.nvim": { "branch": "main", "commit": "5d73da785a3c05fd63ac31769079db05169a6ec7" }, + "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lspsaga.nvim": { "branch": "main", "commit": "d42fe8162356f3b55c24044f94e1880a4c317a95" }, + "lspsaga.nvim": { "branch": "main", "commit": "93a2ae4c03d1f1c138f5a38f1cbc3808479b434e" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, - "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, - "mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" }, - "mini.nvim": { "branch": "main", "commit": "aac602e097b99a06bc84e43356f080eb6256dd21" }, - "neo-tree.nvim": { "branch": "main", "commit": "93fcf0a3056c60829c0a210fe35523cda7ef0369" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7e8208a4d936f93303cc229af865a2cd226c807f" }, + "mason.nvim": { "branch": "main", "commit": "a51c2d063c5377ee9e58c5f9cda7c7436787be72" }, + "mini.nvim": { "branch": "main", "commit": "ab94192dd36b35c6752aac7154c7130922c27af7" }, + "neo-tree.nvim": { "branch": "main", "commit": "cac2e1bfa1ecd5bd0ce7ae29e12efb3ba5a7347d" }, "neoai.nvim": { "branch": "main", "commit": "248c2001d0b24e58049eeb6884a79860923cfe13" }, "neotest": { "branch": "master", "commit": "bec7be0f13ee19c85561943fc5f7b8daa4f4d465" }, - "neotest-jest": { "branch": "main", "commit": "e60280f53ef9f84fd827aecae1e2f732ba4326b1" }, + "neotest-jest": { "branch": "main", "commit": "66de78407b3650bf390c195a997b85d3be8cde06" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, "noice.nvim": { "branch": "main", "commit": "894db25ec726d32047799d4d0a982b701bec453b" }, "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, - "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, - "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, + "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, + "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-dap": { "branch": "master", "commit": "2f28ea843bcdb378b171a66ddcd568516e431d55" }, + "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, - "nvim-lspconfig": { "branch": "master", "commit": "b6091272422bb0fbd729f7f5d17a56d37499c54f" }, + "nvim-lspconfig": { "branch": "master", "commit": "67f151e84daddc86cc65f5d935e592f76b9f4496" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-recorder": { "branch": "main", "commit": "a33c6d4715bc4740906330adc81a8cbedc7a202f" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, - "nvim-toggleterm.lua": { "branch": "main", "commit": "00c13dccc78c09fa5da4c5edda990a363e75035e" }, - "nvim-treesitter": { "branch": "master", "commit": "e8648569d82c7bb46dc511cda9dbec687774461f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "12cba0a1967b4f3f31903484dec72a6100dcf515" }, + "nvim-treesitter": { "branch": "master", "commit": "8fa7ce35afe88b8294e6ced757aa14ec98414568" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "56272167a6dead91c47c02dbdbfe1ae5643c59f5" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, - "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, - "oil.nvim": { "branch": "master", "commit": "eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a" }, - "persisted.nvim": { "branch": "main", "commit": "c1c4bbff8a4e9b9f66812b2daa9d3338916e8da2" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "9bff161dfece6ecf3459e6e46ca42e49f9ed939f" }, + "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, + "oil.nvim": { "branch": "master", "commit": "8f7807946a67b5f1a515946f82251e33651bae29" }, + "persisted.nvim": { "branch": "main", "commit": "315cd1a8a501ca8e0c1d55f0c245b9cc0e1ffa01" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "rest.nvim": { "branch": "main", "commit": "22673c848768ff25517154a5aebfebc0c77d0b4f" }, "sniprun": { "branch": "master", "commit": "1c4bc063522946676dd178d01d6fc130d3e41da5" }, "statuscol.nvim": { "branch": "main", "commit": "9f1ff2dcf614544c5022e876d83b4894c1944e87" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, - "telescope.nvim": { "branch": "master", "commit": "b6fccfb0f7589a87587875206786daccba62acc3" }, + "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, - "translate.nvim": { "branch": "main", "commit": "35b71090a398eaca4d7cd2478f6a09d0fa3130bd" }, + "translate.nvim": { "branch": "main", "commit": "63592d00a29a967c2011a67cc31268d1dec75af9" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vim-dadbod": { "branch": "master", "commit": "7d80bbd11c407a09e0f7b869c38f3dec3902805f" }, diff --git a/configs/nvim/lua/max/core/autocommands.lua b/configs/nvim/lua/max/core/autocommands.lua index 0b97c81..4a54741 100644 --- a/configs/nvim/lua/max/core/autocommands.lua +++ b/configs/nvim/lua/max/core/autocommands.lua @@ -72,18 +72,6 @@ autocmd({ "BufWinEnter" }, { group = save_fold, }) -autocmd({ "BufWinEnter", "BufAdd" }, { - desc = 'hide statuscolumn in neotree', - group = vim.api.nvim_create_augroup('hide_nvimtree_stc', { clear = true }), - callback = function(opts) - if vim.bo[opts.buf].filetype == 'NvimTree' or vim.bo[opts.buf].filetype == "neo-tree" then - vim.opt.statuscolumn = '' - else - -- vim.opt.statuscolumn = [[%!v:lua.Status.column()]] - end - end, -}) - vim.cmd([[ augroup filetypedetect au BufNewFile,BufRead *.frag setl ft=glsl diff --git a/configs/nvim/lua/max/core/options.lua b/configs/nvim/lua/max/core/options.lua index 6dbd129..2bcce40 100644 --- a/configs/nvim/lua/max/core/options.lua +++ b/configs/nvim/lua/max/core/options.lua @@ -52,17 +52,9 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode opt.winminwidth = 5 -- Minimum window width opt.wrap = false -- Disable line wrap -if vim.fn.has("nvim-0.9.0") == 1 then - opt.splitkeep = "screen" - opt.shortmess:append { C = true } -end - -function _G.CustomFoldText() - return vim.fn.getline(vim.v.foldstart) .. ' …' -end - -opt.fillchars = "fold: " -opt.foldtext = 'v:lua.CustomFoldText()' +opt.foldenable = false; +opt.foldmethod = "expr" +opt.foldexpr = "nvim_treesitter#foldexpr()" -- Fix markdown indentation settings vim.g.markdown_recommended_style = 0 diff --git a/configs/nvim/lua/max/plugins/lsp.lua b/configs/nvim/lua/max/plugins/lsp.lua index f6dde43..39befac 100644 --- a/configs/nvim/lua/max/plugins/lsp.lua +++ b/configs/nvim/lua/max/plugins/lsp.lua @@ -61,10 +61,10 @@ return { end local capabilities = require("cmp_nvim_lsp").default_capabilities() - capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, - } + -- capabilities.textDocument.foldingRange = { + -- dynamicRegistration = false, + -- lineFoldingOnly = true, + -- } capabilities.textDocument.completion.completionItem.snippetSupport = true local custom_lsp = {} diff --git a/configs/nvim/lua/max/plugins/lspsage.lua b/configs/nvim/lua/max/plugins/lspsage.lua index dceebe2..ab20f20 100644 --- a/configs/nvim/lua/max/plugins/lspsage.lua +++ b/configs/nvim/lua/max/plugins/lspsage.lua @@ -1,6 +1,7 @@ return { "glepnir/lspsaga.nvim", event = "BufRead", + enable = false, opts = { lightbulb = { enable = false, diff --git a/configs/nvim/lua/max/plugins/statuscolumn.lua b/configs/nvim/lua/max/plugins/statuscolumn.lua index eef5384..442b4ed 100644 --- a/configs/nvim/lua/max/plugins/statuscolumn.lua +++ b/configs/nvim/lua/max/plugins/statuscolumn.lua @@ -7,7 +7,7 @@ return { --configuration goes here, for example: relculright = false, segments = { - { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, + -- { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, { sign = { name = { "Diagnostic" }, maxwidth = 2, auto = true }, click = "v:lua.ScSa" diff --git a/configs/nvim/lua/max/plugins/treesitter.lua b/configs/nvim/lua/max/plugins/treesitter.lua index d6dc483..67bfaf4 100644 --- a/configs/nvim/lua/max/plugins/treesitter.lua +++ b/configs/nvim/lua/max/plugins/treesitter.lua @@ -1,6 +1,7 @@ return { "nvim-treesitter/nvim-treesitter", event = "VeryLazy", + enable = false, dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "JoosepAlviste/nvim-ts-context-commentstring", @@ -11,12 +12,25 @@ return { context_commentstring = { enable = true }, + ignore_install = {}, + sync_install = false, + auto_install = true, + modules = {}, autotag = { enable = true, }, indent = { enable = true, }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + scope_incremental = '', + node_incremental = '', + node_decremental = '', + }, + }, ensure_installed = { "bash", "yaml", @@ -33,7 +47,10 @@ return { "yaml", "prisma", }, - highlight = { enable = true }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, textobjects = { select = { enable = true, @@ -70,6 +87,9 @@ return { }, }, }) + vim.opt.foldenable = false; + vim.opt.foldmethod = "expr"; + vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' end, build = ":TSUpdate", }