From ee89c96741cdb21390796fc645d3148a58b54a82 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Tue, 17 Jan 2023 00:20:41 +0100 Subject: [PATCH] feat(nvim): configure new statuscolumn --- configs/.zshrc | 5 +++ configs/nvim/ftplugin/nvimtree.vim | 1 + configs/nvim/lazy-lock.json | 44 +++++++++++----------- configs/nvim/lua/max/core/autocommands.lua | 20 +++++++--- configs/nvim/lua/max/core/keymappings.lua | 12 +++--- configs/nvim/lua/max/core/plugins.lua | 29 ++++++++------ 6 files changed, 66 insertions(+), 45 deletions(-) create mode 100644 configs/nvim/ftplugin/nvimtree.vim diff --git a/configs/.zshrc b/configs/.zshrc index 083f750..19d9e90 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -129,3 +129,8 @@ export PATH="$PNPM_HOME:$PATH" # tabtab source for packages # uninstall by removing these lines [[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true + +# pnpm +export PNPM_HOME="/home/max/.local/share/pnpm" +export PATH="$PNPM_HOME:$PATH" +# pnpm end \ No newline at end of file diff --git a/configs/nvim/ftplugin/nvimtree.vim b/configs/nvim/ftplugin/nvimtree.vim new file mode 100644 index 0000000..e67125e --- /dev/null +++ b/configs/nvim/ftplugin/nvimtree.vim @@ -0,0 +1 @@ +setlocal statuscolumn="" diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index e4d70f5..d55d58e 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -2,12 +2,11 @@ "ChatGPT.nvim": { "branch": "main", "commit": "c33babb015005cda6042f908ac587e4bc498d041" }, "Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" }, "FixCursorHold.nvim": { "branch": "master", "commit": "70a9516a64668cbfe59f31b66d0a21678c5e9b12" }, - "LuaSnip": { "branch": "master", "commit": "5d57303efde86fcb0959c52b1a6d40f923940f34" }, + "LuaSnip": { "branch": "master", "commit": "45670282dc861b51c4e028e6930c75371fe0b88f" }, "alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" }, "autolist.nvim": { "branch": "main", "commit": "f8b4c11b79b0fef77a64b03810839a1abbbc67d5" }, - "boole.nvim": { "branch": "main", "commit": "23a799a60a0f56640a24d9fc20cf35ed958549ee" }, - "bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" }, - "catppuccin": { "branch": "main", "commit": "ecfa842c38b937596c81fa8df2123de69b980081" }, + "boole.nvim": { "branch": "main", "commit": "f4f9996f91159e54b8f1893b20e2e599c91bc1bd" }, + "catppuccin": { "branch": "main", "commit": "ee756bf71c444303d9ea378dc4996e59edb1aa2b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, @@ -17,52 +16,53 @@ "copilot-cmp": { "branch": "master", "commit": "b732a58ac8b7287b981cd9f0d9c0f61e5e9d5760" }, "copilot.lua": { "branch": "master", "commit": "5b911f2d8ecccc684c13fdb8af4145cca19dc3cf" }, "dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" }, - "editorconfig-vim": { "branch": "master", "commit": "30ddc057f71287c3ac2beca876e7ae6d5abe26a0" }, + "editorconfig-vim": { "branch": "master", "commit": "1953c0f2541446e8a56ba4e2f4477e91e78f6d13" }, "flit.nvim": { "branch": "main", "commit": "be110f9814a45788d10537fd59b3c76d956bb7ad" }, - "friendly-snippets": { "branch": "main", "commit": "45698b3d193fff404c3c9c30d25dc138a729d64b" }, + "friendly-snippets": { "branch": "main", "commit": "7ab483b355613ef4f74189c7789278d765724d12" }, "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, - "fzf": { "branch": "master", "commit": "1c83b3969185393f0427463a39ef1523c273c16c" }, + "fzf": { "branch": "master", "commit": "20230117636c9dfa3ed6f6428c5bc4c51b02f60a" }, "git-conflict.nvim": { "branch": "main", "commit": "cbefa7075b67903ca27f6eefdc9c1bf0c4881017" }, "gitsigns.nvim": { "branch": "main", "commit": "addd6e174a85fc1c4007ab0b65d77e6555b417bf" }, - "lazy.nvim": { "branch": "main", "commit": "666ed7bf73eb5895253c1155bd29270b066cbdac" }, + "lazy.nvim": { "branch": "main", "commit": "c05d61d208afaccb2a6765c0a6eb2d4e506a8c18" }, "leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, - "lspsaga.nvim": { "branch": "main", "commit": "0817d11977a686d47a105c2634c05bc9a1f0537a" }, + "lspsaga.nvim": { "branch": "main", "commit": "963ede052055c371d1968252c040fe19f2ad16ad" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "43c7f402cb9822b61b5dc05bf0b385928df256a6" }, - "mason.nvim": { "branch": "main", "commit": "5ab101aa11849c2424d5b87726105daae8cb49e8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "610f5919fe633ac872239a0ab786572059f0d91d" }, + "mason.nvim": { "branch": "main", "commit": "e50e1940de5a4d840326c8ddee68ed7440555f4f" }, "neotest": { "branch": "master", "commit": "fee5ce9bdc3dff4706a29b012e75025ab376becb" }, "neotest-jest": { "branch": "main", "commit": "8b8926480865e56053681d0c56e3be0a3b5e716c" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, - "no-neck-pain.nvim": { "branch": "main", "commit": "6e7e2ec15b67ae61e93cc7c8e1cafbec7596cb0f" }, - "nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" }, - "null-ls.nvim": { "branch": "main", "commit": "915558963709ea17c5aa246ca1c9786bfee6ddb4" }, + "no-neck-pain.nvim": { "branch": "main", "commit": "5830248d1196080df91cc8f3e3f2ecb181f0a12d" }, + "nui.nvim": { "branch": "main", "commit": "b99e6cb13dc51768abc1c4c8585045a0c0459ef1" }, + "null-ls.nvim": { "branch": "main", "commit": "c02509dc9a5f71ccbfa48fc7d2614686b538f80e" }, "nvim-autopairs": { "branch": "master", "commit": "f00eb3b766c370cb34fdabc29c760338ba9e4c6c" }, "nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" }, - "nvim-dap": { "branch": "master", "commit": "b8201fd104287e9c24f898f1f7f5202896eea203" }, + "nvim-dap": { "branch": "master", "commit": "5a1479c5d633daa0db06988ed44663f07f10f5dd" }, "nvim-dap-ui": { "branch": "master", "commit": "b80227ea56a48177786904f6322abc8b2dc0bc36" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "e7c05495934a658c8aa10afd995dacd796f76091" }, - "nvim-lspconfig": { "branch": "master", "commit": "ed88435764d8b00442e66d39ec3d9c360e560783" }, - "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, + "nvim-lspconfig": { "branch": "master", "commit": "8ebe6894dddaeb1459e1397c865f54fa5ecaac80" }, + "nvim-notify": { "branch": "master", "commit": "72e77098a145d7b805353a0d94a367739f81214f" }, "nvim-scrollbar": { "branch": "main", "commit": "6a2065fbcd032075a06d2ab54508b69842bc4496" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "a54e6c471ce1cd8ef8357e34598a28a955297131" }, - "nvim-tree.lua": { "branch": "master", "commit": "3ce0a8e770f70a135ef969e0a640bd8d05baf42c" }, - "nvim-treesitter": { "branch": "master", "commit": "51d220e0bd8922caabcb3e5de936fc599a1bd210" }, + "nvim-tree.lua": { "branch": "master", "commit": "1b13a49f913b58a5f1792ea81c13947a7988db8e" }, + "nvim-treesitter": { "branch": "master", "commit": "8666451879adc60e9ca66d35b84a6375e9128668" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "a8c86f48c1030acee22b9e071e3c531de77bf253" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, "nvim-ufo": { "branch": "main", "commit": "e3528c9b7ca20e9e0d69d588037f484257f0d652" }, "nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" }, - "persisted.nvim": { "branch": "main", "commit": "558fc4b9f48e16008782240521cb72455d93b835" }, + "persisted.nvim": { "branch": "main", "commit": "325cda4fb406601929fbc2084816dc5e49d5e5aa" }, "plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "promise-async": { "branch": "main", "commit": "842dca33e6b1af7bedcefc72cffbc807d54dbfca" }, "sniprun": { "branch": "master", "commit": "79806dad094770a1563ac0227c9692f7592df744" }, "symbols-outline.nvim": { "branch": "master", "commit": "6a3ed24c5631da7a5d418bced57c16b32af7747c" }, - "telescope.nvim": { "branch": "master", "commit": "1ba7278cf08da8048e7f589ef6b65a39fd3e4dbf" }, + "telescope.nvim": { "branch": "master", "commit": "2f32775405f6706348b71d0bb8a15a22852a61e4" }, "translate.nvim": { "branch": "main", "commit": "7b2fd50c21ecfe536d572d62dcd3fa83acad3743" }, "trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" }, + "ts-node-action": { "branch": "master", "commit": "94df3af2bb49c462c9502d7b2355cb4f7a95e612" }, "undotree": { "branch": "master", "commit": "1a23ea84bd02c34f50d8e10a8b4bfc89597ffe4e" }, "vim-dadbod": { "branch": "master", "commit": "a09e40664e9cd30cd2b3f8866b796598302070f6" }, "vim-dadbod-ui": { "branch": "master", "commit": "f4ead480930a37dd2b0cf917a8c387ed36c2d86a" }, diff --git a/configs/nvim/lua/max/core/autocommands.lua b/configs/nvim/lua/max/core/autocommands.lua index 64b00b2..a5283d6 100644 --- a/configs/nvim/lua/max/core/autocommands.lua +++ b/configs/nvim/lua/max/core/autocommands.lua @@ -33,6 +33,20 @@ autocmd("BufWinEnter", { group = save_fold, }) +autocmd({ "BufWinEnter","BufAdd" }, { + desc = 'hide statuscolumn in nvimtree', + group = vim.api.nvim_create_augroup('hide_nvimtree_stc', { clear = true }), + callback = function(opts) + if vim.bo[opts.buf].filetype == 'NvimTree' then + vim.o.statuscolumn = '' + else + vim.o.statuscolumn = '%=%r%s%#FoldColumn#%{foldlevel(v:lnum) > foldlevel(v:lnum - 1) ? (foldclosed(v:lnum) == -1 ? "" : "") : " " } %*' + end + end, +}) + +vim.cmd [[au BufWinEnter NvimTree setlocal statuscolumn=""]] + vim.cmd([[ augroup filetypedetect au BufNewFile,BufRead *.frag setl ft=glsl @@ -41,12 +55,6 @@ augroup filetypedetect augroup END ]]) --- autocmd({ "BufReadPost" }, { --- pattern = "*", --- group = config_group, --- command = "filetype detect", --- }) - autocmd("BufReadPost", { callback = function() local mark = vim.api.nvim_buf_get_mark(0, '"') diff --git a/configs/nvim/lua/max/core/keymappings.lua b/configs/nvim/lua/max/core/keymappings.lua index 6ff1b64..45676ff 100644 --- a/configs/nvim/lua/max/core/keymappings.lua +++ b/configs/nvim/lua/max/core/keymappings.lua @@ -2,8 +2,6 @@ local map = vim.keymap.set local opts = { noremap = true, silent = true } -local saga = require("lspsaga") -saga.init_lsp_saga() -- Set Leader key vim.g.mapleader = " " @@ -28,11 +26,13 @@ map("n", "a", ":Alpha", opts); map("n", "n", ":lua vim.diagnostic.goto_next()", opts) map("n", "p", ":lua vim.diagnostic.goto_prev()", opts) map("n", "e", ":lua vim.diagnostic.open_float()", opts) -map("n", "gD", "lua vim.lsp.buf.declaration()", opts) -map("n", "gd", "lua vim.lsp.buf.definition()", opts) -map("n", "gi", "lua vim.lsp.buf.implementation()", opts) +map("n", "gD", ":lua vim.lsp.buf.declaration()", opts) +map("n", "gd", ":lua vim.lsp.buf.definition()", opts) +map("n", "gi", ":lua vim.lsp.buf.implementation()", opts) +map("n", "K", ":lua vim.lsp.buf.hover()", opts) -map("n", "K", "Lspsaga hover_doc", { silent = true }) +map("n", "ii", ":Lspsaga incomming_calls", opts) +map("n", "io", ":Lspsaga outgoing_calls", opts) map("n", "rn", "lua vim.lsp.buf.rename()", opts) map({ "n", "v" }, "c", "Lspsaga code_action", { silent = true }) map({ "n", "v" }, "gr", "Lspsaga lsp_finder", opts) diff --git a/configs/nvim/lua/max/core/plugins.lua b/configs/nvim/lua/max/core/plugins.lua index 8780040..a078801 100644 --- a/configs/nvim/lua/max/core/plugins.lua +++ b/configs/nvim/lua/max/core/plugins.lua @@ -22,11 +22,10 @@ local plugins = { -------------------- -- Layout Plugins -- -------------------- - { 'akinsho/bufferline.nvim', lazy = false, config = true }, { "shortcuts/no-neck-pain.nvim", cmd = "NoNeckPain", config = true }, { "stevearc/dressing.nvim", - lazy = false, + event = "VeryLazy", config = true }, { @@ -41,7 +40,7 @@ local plugins = { cmd = "SymbolsOutline", config = true, }, - { "mbbill/undotree", lazy = false }, + { "mbbill/undotree", event = "VeryLazy" }, { "petertriho/nvim-scrollbar", config = function() @@ -80,9 +79,6 @@ local plugins = { vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 vim.o.foldenable = true - -- vim.o.statuscolumn = "%=%l%s%C" - vim.o.statuscolumn = '%=%l%s%{foldlevel(v:lnum) > foldlevel(v:lnum - 1) ? (foldclosed(v:lnum) == -1 ? "" : "") : " " }' - -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] end, }, { @@ -131,13 +127,18 @@ local plugins = { -- Lsp Setup -- --------------- { - "glepnir/lspsaga.nvim", + 'glepnir/lspsaga.nvim', event = 'BufRead', config = function() - require('lspsaga').setup({}) + require('lspsaga').setup({ + symbol_in_winbar = { + enable = false, + }, + }) end }, - { "neovim/nvim-lspconfig", + { + "neovim/nvim-lspconfig", dependencies = { "arkav/lualine-lsp-progress", "williamboman/mason.nvim", @@ -149,7 +150,8 @@ local plugins = { event = "InsertEnter", config = function() require("max.configs.lsp") - end }, + end + }, { "folke/trouble.nvim", cmd = "TroubleToggle", @@ -201,7 +203,7 @@ local plugins = { ------------------------- { "nvim-treesitter/nvim-treesitter", - event = "BufReadPost", + event = "VeryLazy", dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "JoosepAlviste/nvim-ts-context-commentstring" @@ -211,6 +213,11 @@ local plugins = { end, run = ":TSUpdate", }, + { + 'ckolkey/ts-node-action', + dependencies = { 'nvim-treesitter' }, + opts = {}, + }, -------------------- -- IDE Type Stuff -- --------------------