diff --git a/configs/nvim/ftplugin/qf.lua b/configs/nvim/ftplugin/qf.lua index 569541f..8840b92 100644 --- a/configs/nvim/ftplugin/qf.lua +++ b/configs/nvim/ftplugin/qf.lua @@ -1,5 +1,5 @@ -- Automatically close the goto definition buffer after leaving -local buffer_id = vim.api.nvim_win_get_buf(0) +-- local buffer_id = vim.api.nvim_win_get_buf(0) -- vim.api.nvim_create_autocmd({ "bufwinleave", "bufleave" }, { -- pattern = "*", -- once = true, diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 14524b1..3200980 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -1,12 +1,14 @@ vim.opt.termguicolors = true require("max.core.bootstrap") + require("max.core.plugins") -require("max.core.options") require("max.core.autocommands") require("max.core.keymappings") require("max.theme.catpuccin") require("max.overlays") + +require("max.core.options") diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index 899e62a..eee8e21 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -1,11 +1,11 @@ { - "ChatGPT.nvim": { "branch": "main", "commit": "6c7e326add8fbb8c6662d92dd6bd9e1eb15f7c5a" }, - "Comment.nvim": { "branch": "master", "commit": "ab00bcf5aa979c53f2f40dc2655c03e24f4ef50f" }, + "ChatGPT.nvim": { "branch": "main", "commit": "c33babb015005cda6042f908ac587e4bc498d041" }, + "Comment.nvim": { "branch": "master", "commit": "e89df176e8b38e931b7e71a470f923a317976d86" }, "FixCursorHold.nvim": { "branch": "master", "commit": "70a9516a64668cbfe59f31b66d0a21678c5e9b12" }, - "LuaSnip": { "branch": "master", "commit": "5570fd797eae0790affb54ea669a150cad76db5d" }, + "LuaSnip": { "branch": "master", "commit": "5d57303efde86fcb0959c52b1a6d40f923940f34" }, "alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" }, - "autolist.nvim": { "branch": "main", "commit": "22e69de24e83230955d673d34c1bdebeed3f17ba" }, - "boole.nvim": { "branch": "main", "commit": "d059fd7da634aaaabddbb280709f92effd9f2dba" }, + "autolist.nvim": { "branch": "main", "commit": "71b89ac9f7dd9739f4b477f59301d807d5f3a347" }, + "boole.nvim": { "branch": "main", "commit": "23a799a60a0f56640a24d9fc20cf35ed958549ee" }, "catppuccin": { "branch": "main", "commit": "3020af75aae098a77737d91ee37c7147c8450d99" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, @@ -16,51 +16,53 @@ "editorconfig-vim": { "branch": "master", "commit": "30ddc057f71287c3ac2beca876e7ae6d5abe26a0" }, "friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" }, "fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" }, - "fzf": { "branch": "master", "commit": "ee5cdb9713715883ac6d2cd87bc8a091ff7c8361" }, + "fzf": { "branch": "master", "commit": "e0f0984da7ecb0132a1744220d1d96c32583c0b8" }, "git-conflict.nvim": { "branch": "main", "commit": "cbefa7075b67903ca27f6eefdc9c1bf0c4881017" }, - "gitsigns.nvim": { "branch": "main", "commit": "d4f8c01280413919349f5df7daccd0c172143d7c" }, - "lazy.nvim": { "branch": "main", "commit": "d3b0d3e851b5609a2630e0307e18dc852efd0bd0" }, + "gitsigns.nvim": { "branch": "main", "commit": "114362a85e51918ab2965181ffa31932c181f32f" }, + "lazy.nvim": { "branch": "main", "commit": "e6ee0fa6103e9514e85a96fc16902ad7f777b53f" }, "leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" }, "litee-calltree.nvim": { "branch": "main", "commit": "e2dffec35740032258fee3a3c7f30123226f2271" }, "litee-symboltree.nvim": { "branch": "main", "commit": "488a660afcfd54644e6b755256907d3c7d8cf8d0" }, "litee.nvim": { "branch": "main", "commit": "bf366a1414fd0f9401631ac8884f2f9fa4bf18d2" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, - "lsp-zero.nvim": { "branch": "main", "commit": "32d1a5182e97f3b56d27426635624c3e728bd5f3" }, + "lsp-zero.nvim": { "branch": "main", "commit": "b3d60f170a23ba52cfd56fd6f8ce70a38e853330" }, "lsp_lines.nvim": { "branch": "main", "commit": "ec98b45c8280e5ef8c84028d4f38aa447276c002" }, "lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" }, "lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "aa25b4153d2f2636c3b3a8c8360349d2b29e7ae3" }, - "mason.nvim": { "branch": "main", "commit": "38f0d1e467d1d3c22724c467efab8a4671a3b7bb" }, - "neotest": { "branch": "master", "commit": "414b43f99da0a827c3ce897161fc67c3bb6a5d83" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3751eb5c56c67b51e68a1f4a0da28ae74ab771c1" }, + "mason.nvim": { "branch": "main", "commit": "a4ebe1f14ba31242cd09f9e0709d5b1f9d2bcecb" }, + "neotest": { "branch": "master", "commit": "fee5ce9bdc3dff4706a29b012e75025ab376becb" }, "neotest-jest": { "branch": "main", "commit": "8b8926480865e56053681d0c56e3be0a3b5e716c" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, - "no-neck-pain.nvim": { "branch": "main", "commit": "8c3c951ab64972821d8338365bce946bc66f4ba5" }, + "no-neck-pain.nvim": { "branch": "main", "commit": "6df43aec515aa68d266172934f849d01a2a4b8fd" }, "nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" }, - "nvim-cmp": { "branch": "main", "commit": "c49ad26e894e137e401b1d294948c46327877eaf" }, - "nvim-dap": { "branch": "master", "commit": "1077a86c83f75a6eec36c91f91d6b728e2b02130" }, + "nvim-cmp": { "branch": "main", "commit": "11a95792a5be0f5a40bab5fc5b670e5b1399a939" }, + "nvim-dap": { "branch": "master", "commit": "700a3c7d6fbe5b07bee74e9952b456120d355c47" }, "nvim-dap-ui": { "branch": "master", "commit": "f2206de65ea39093e3f13992507fc985c17aa763" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "e7c05495934a658c8aa10afd995dacd796f76091" }, "nvim-lastplace": { "branch": "main", "commit": "ecced899435c6bcdd81becb5efc6d5751d0dc4c8" }, - "nvim-lspconfig": { "branch": "master", "commit": "e69978a39e4d3262b09ce6a316beff384f443e3b" }, + "nvim-lspconfig": { "branch": "master", "commit": "7b98aadc6e85db4fc3af6c1ec22c4774d965506e" }, "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, "nvim-scrollbar": { "branch": "main", "commit": "6e704cdeb7114385b4b19f9dc4b8f0c442019edc" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "b02a1674bd0010d7982b056fd3df4f717ff8a57a" }, - "nvim-tree.lua": { "branch": "master", "commit": "bac962caf472a4404ed3ce1ba2fcaf32f8002951" }, - "nvim-treesitter": { "branch": "master", "commit": "b1569394614804aaad4e994731161f253ff61bcc" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" }, - "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, + "nvim-tree.lua": { "branch": "master", "commit": "677d54afee1dfa7a30eb9e16ab7d9d1affc6484b" }, + "nvim-treesitter": { "branch": "master", "commit": "5fb315df12a3091f241b0326aed0ec70381adbd8" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "a8c86f48c1030acee22b9e071e3c531de77bf253" }, + "nvim-ufo": { "branch": "main", "commit": "71a1bb367f3e6df402546a69ca4e64b567901c73" }, + "nvim-web-devicons": { "branch": "master", "commit": "6c38926351372ea87034dec26182b62c835ff3bc" }, "persisted.nvim": { "branch": "main", "commit": "558fc4b9f48e16008782240521cb72455d93b835" }, - "plenary.nvim": { "branch": "master", "commit": "bb444796dc5746d969f0718913a31c8075741e36" }, + "plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "promise-async": { "branch": "main", "commit": "842dca33e6b1af7bedcefc72cffbc807d54dbfca" }, "sniprun": { "branch": "master", "commit": "79806dad094770a1563ac0227c9692f7592df744" }, - "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, + "telescope.nvim": { "branch": "master", "commit": "04af51dbfb17c2afa0b8d82b0e842e0638201ca9" }, "translate.nvim": { "branch": "main", "commit": "7b2fd50c21ecfe536d572d62dcd3fa83acad3743" }, "trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" }, "undotree": { "branch": "master", "commit": "1a23ea84bd02c34f50d8e10a8b4bfc89597ffe4e" }, "vim-dadbod": { "branch": "master", "commit": "a09e40664e9cd30cd2b3f8866b796598302070f6" }, - "vim-dadbod-ui": { "branch": "master", "commit": "ecf07480687a13fe1bd3899270a6c9c99de51f4b" }, + "vim-dadbod-ui": { "branch": "master", "commit": "f4ead480930a37dd2b0cf917a8c387ed36c2d86a" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "which-key.nvim": { "branch": "main", "commit": "b7e0b1f16c20bc1ea0515851bc5740d1c1f18444" } + "which-key.nvim": { "branch": "main", "commit": "85f69b07afce4ea77c58ae9a3aeb4e6c918b4d34" } } \ No newline at end of file diff --git a/configs/nvim/lua/max/core/keymappings.lua b/configs/nvim/lua/max/core/keymappings.lua index 7cf5b8d..ccc61f5 100644 --- a/configs/nvim/lua/max/core/keymappings.lua +++ b/configs/nvim/lua/max/core/keymappings.lua @@ -11,6 +11,7 @@ vim.g.mapleader = " " map("n", "", ":Telescope find_files preview={timeout=1000}", opts) map("n", "", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }", opts) map("n", "", "za", opts) +map("n", "o", ":Telescope buffers", opts) map("v", ">", ">gv", opts) map("v", "<", "a", ":Alpha", opts); -- LSP Functionality map("n", "n", ":lua vim.diagnostic.goto_next()", opts) diff --git a/configs/nvim/lua/max/core/options.lua b/configs/nvim/lua/max/core/options.lua index 6dfb7d5..20f1cf0 100644 --- a/configs/nvim/lua/max/core/options.lua +++ b/configs/nvim/lua/max/core/options.lua @@ -25,14 +25,11 @@ vim.cmd([[set complete+=kspell]]) -- auto complete with spellcheck vim.cmd([[set completeopt=menuone,noselect]]) -- auto complete menu (It's pretty great) vim.cmd([[set nocompatible]]) -- Disable compatibility to old-time vi set.mouse = "a" -- Enable mouse support -set.foldmethod = "expr" -set.foldexpr = "nvim_treesitter#foldexpr()" -- use treesitter for folding -vim.wo.foldlevel = 99 -- feel free to decrease the value -vim.wo.foldenable = true +-- Configure Folds vim.cmd([[set wildmode=list:longest,full]]) -- Command-line completion mode -vim.cmd([[let loaded_netrw = 1]]) -- Command-line completion mode -vim.cmd([[let loaded_netrwPlugin = 1]]) -- Command-line completion mode +g.loaded_netrw = 1; +g.loaded_netrwPlugin = 1; --------------- -- Neovim UI -- @@ -64,9 +61,9 @@ vim.cmd([[set nowrap]]) -- Display long lines as just one line vim.cmd([[set noshowmode]]) -- We don't need to see things like -- INSERT -- anymore vim.cmd([[syntax enable]]) -- Enables syntax highlighing vim.cmd([[set t_Co=256]]) -- Support 256 colors -vim.cmd "set whichwrap+=<,>,[,],h,l" -- Breaks Space-Time Continuum +vim.cmd "set whichwrap+=<,>,[,],h,l" -- Breaks Space-Time Continuum vim.diagnostic.config({ - virtual_text = true, + virtual_text = true, }) ----------------- diff --git a/configs/nvim/lua/max/core/plugins.lua b/configs/nvim/lua/max/core/plugins.lua index 5651a80..8beb163 100644 --- a/configs/nvim/lua/max/core/plugins.lua +++ b/configs/nvim/lua/max/core/plugins.lua @@ -73,9 +73,26 @@ local plugins = { end, event = "VimEnter", }, + { + "kevinhwang91/nvim-ufo", + event = "BufReadPost", + dependencies = 'kevinhwang91/promise-async', + config = function() + require('ufo').setup({ + provider_selector = function() + return { 'treesitter', 'indent' } + end + }) + vim.o.foldcolumn = '1' + vim.o.foldlevel = 99 + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] + end, + }, { "kyazdani42/nvim-tree.lua", - event = "VimEnter", + event = "VeryLazy", -- lazy = false, dependencies = { "kyazdani42/nvim-web-devicons" }, config = function() @@ -85,6 +102,7 @@ local plugins = { "nvim-lua/popup.nvim", { "goolord/alpha-nvim", + lazy = false, config = function() require("max.configs.dashboard") end, @@ -140,7 +158,7 @@ local plugins = { "rafamadriz/friendly-snippets", { "lukas-reineke/lsp-format.nvim", config = true }, }, - lazy = false, + event = "InsertEnter", config = function() local lsp = require("lsp-zero") lsp.preset("recommended") @@ -160,11 +178,6 @@ local plugins = { require("trouble").setup({}) end, }, - { - url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim", - event = "BufReadPre", - config = true - }, ------------------- -- Autocomplete -- -------------------