From aa9dd5f2d89e94f862ddd71c3d73454a0b1c6ce8 Mon Sep 17 00:00:00 2001 From: Dario48true Date: Thu, 4 Jul 2024 07:59:21 +0200 Subject: [PATCH] bulk commit --- .gitignore | 1 - lazy-lock.json | 35 ++++++++++++++++++++++ lua/Dario48/options.lua | 6 ---- lua/Dario48/plugins/VimBeGood.lua | 4 +-- lua/Dario48/plugins/alpha.lua | 28 ++++++++++------- lua/Dario48/plugins/bufferline.lua | 15 ++++++---- lua/Dario48/plugins/csvlens.lua | 8 +++++ lua/Dario48/plugins/lazydev.lua | 24 +++++++++++++++ lua/Dario48/plugins/lsp-zero.lua | 9 ++++-- lua/Dario48/plugins/luarocks.lua | 5 ++++ lua/Dario48/plugins/neorg.lua | 21 +++++++++++++ lua/Dario48/plugins/nvim-dap.lua | 48 ++++++++++++++++++++++++++++++ lua/Dario48/plugins/nvim-tree.lua | 10 ++++--- lua/Dario48/plugins/telescope.lua | 14 ++++----- lua/Dario48/plugins/treesitter.lua | 34 ++++++++++++--------- 15 files changed, 207 insertions(+), 55 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/Dario48/plugins/csvlens.lua create mode 100644 lua/Dario48/plugins/lazydev.lua create mode 100644 lua/Dario48/plugins/luarocks.lua create mode 100644 lua/Dario48/plugins/neorg.lua create mode 100644 lua/Dario48/plugins/nvim-dap.lua diff --git a/.gitignore b/.gitignore index a6c57f5..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +0,0 @@ -*.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..e012cd7 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,35 @@ +{ + "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "csvlens.nvim": { "branch": "main", "commit": "987375e2cf6399850f7f801b53b89c981ed652fa" }, + "fd": { "branch": "master", "commit": "f8270a6a447648a087c968552aa80325277a5588" }, + "feline.nvim": { "branch": "main", "commit": "8bc28b94a16304aad2f53b8c3653b14803748c28" }, + "gitsigns.nvim": { "branch": "main", "commit": "47c8e3e571376b24de62408fd0c9d12f0a9fc0a3" }, + "lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" }, + "lazydev.nvim": { "branch": "main", "commit": "6184ebbbc8045d70077659b7d30c705a588dc62f" }, + "lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" }, + "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, + "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "neorg": { "branch": "main", "commit": "99b32492b836b64a5ff4544d4c466496f0aec9bd" }, + "nightfox.nvim": { "branch": "main", "commit": "df75a6a94910ae47854341d6b5a6fd483192c0eb" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, + "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, + "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, + "nvim-lspconfig": { "branch": "master", "commit": "bd7c76375a511994c9ca8d69441f134dc10ae3bd" }, + "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, + "nvim-tetris": { "branch": "master", "commit": "d17c99fb527ada98ffb0212ffc87ccda6fd4f7d9" }, + "nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" }, + "nvim-treesitter": { "branch": "master", "commit": "c29989f5d735a30b6d2350b54d5cd50be811f8b2" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, + "telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" }, + "toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" }, + "tree-sitter-hyprlang": { "branch": "master", "commit": "c9012d6dcaaa939f17c21e1fdb17b013d139e6b9" }, + "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } +} \ No newline at end of file diff --git a/lua/Dario48/options.lua b/lua/Dario48/options.lua index 90167f1..b698b4a 100644 --- a/lua/Dario48/options.lua +++ b/lua/Dario48/options.lua @@ -25,11 +25,5 @@ vim.opt.incsearch = true vim.opt.scrolloff = 6 -vim.cmd([[command! QuickFix lua vim.lsp.buf.code_action()]]) - -vim.keymap.set("n", "qf", ":QuickFix", {silent=true}) - -vim.keymap.set("n", "cb", ":!cargo build", {silent=true}) - vim.keymap.set("v", "yo", ":yank +", {silent=true}) vim.keymap.set("v", "ya", ":yank *", {silent=true}) diff --git a/lua/Dario48/plugins/VimBeGood.lua b/lua/Dario48/plugins/VimBeGood.lua index a4ce377..3be9b3a 100644 --- a/lua/Dario48/plugins/VimBeGood.lua +++ b/lua/Dario48/plugins/VimBeGood.lua @@ -1,6 +1,4 @@ return { 'ThePrimeagen/vim-be-good', - config = function() - vim.keymap.set("n", "vbg", ":VimBeGood ") - end + keys ={{"vbg", ":VimBeGood ", desc = "VimBeGood"}} } diff --git a/lua/Dario48/plugins/alpha.lua b/lua/Dario48/plugins/alpha.lua index e7cbf5c..50afbb3 100644 --- a/lua/Dario48/plugins/alpha.lua +++ b/lua/Dario48/plugins/alpha.lua @@ -7,21 +7,29 @@ return { -- Set header dashboard.section.header.val = { [[ /\\\\\ /\\\ /\\\\\\\\\\\\\\\ /\\\\\ /\\\ /\\\ /\\\\\\\\\\\ /\\\\ /\\\\ ]], - [[ \/\\\\\\ \/\\\ \/\\\/////////// /\\\///\\\ \/\\\ \/\\\ \/////\\\/// \/\\\\\\ /\\\\\\ ]], - [[ \/\\\/\\\ \/\\\ \/\\\ /\\\/ \///\\\ \//\\\ /\\\ \/\\\ \/\\\//\\\ /\\\//\\\ ]], - [[ \/\\\//\\\ \/\\\ \/\\\\\\\\\\\ /\\\ \//\\\ \//\\\ /\\\ \/\\\ \/\\\\///\\\/\\\/ \/\\\ ]], - [[ \/\\\\//\\\\/\\\ \/\\\/////// \/\\\ \/\\\ \//\\\ /\\\ \/\\\ \/\\\ \///\\\/ \/\\\ ]], - [[ \/\\\ \//\\\/\\\ \/\\\ \//\\\ /\\\ \//\\\/\\\ \/\\\ \/\\\ \/// \/\\\ ]], - [[ \/\\\ \//\\\\\\ \/\\\ \///\\\ /\\\ \//\\\\\ \/\\\ \/\\\ \/\\\ ]], - [[ \/\\\ \//\\\\\ \/\\\\\\\\\\\\\\\ \///\\\\\/ \//\\\ /\\\\\\\\\\\ \/\\\ \/\\\ ]], + [[ \ \\\\\\ \ \\\ \ \\\/////////// /\\\///\\\ \ \\\ \ \\\ \/////\\\/// \ \\\\\\ /\\\\\\ ]], + [[ \ \\\/\\\ \ \\\ \ \\\ /\\\/ \///\\\ \//\\\ /\\\ \ \\\ \ \\\//\\\ /\\\//\\\ ]], + [[ \ \\\//\\\ \ \\\ \ \\\\\\\\\\\ /\\\ \//\\\ \//\\\ /\\\ \ \\\ \ \\\\///\\\/\\\/ \ \\\ ]], + [[ \ \\\\//\\\\ \\\ \ \\\/////// \ \\\ \ \\\ \//\\\ /\\\ \ \\\ \ \\\ \///\\\/ \ \\\ ]], + [[ \ \\\ \//\\\ \\\ \ \\\ \//\\\ /\\\ \//\\\/\\\ \ \\\ \ \\\ \/// \ \\\ ]], + [[ \ \\\ \//\\\\\\ \ \\\ \///\\\ /\\\ \//\\\\\ \ \\\ \ \\\ \ \\\ ]], + [[ \ \\\ \//\\\\\ \ \\\\\\\\\\\\\\\ \///\\\\\/ \//\\\ /\\\\\\\\\\\ \ \\\ \ \\\ ]], [[ \/// \///// \/////////////// \///// \/// \/////////// \/// \/// ]], } dashboard.section.header.opts.hl = { - {'top_of_mlm', 1, 100}, + {'top_of_mlm', 1, 118}, + {'top_of_mlm', 121, 238}, + {'top_middle_of_mlm', 241, 358}, + {'top_middle_of_mlm', 361, 478}, + {'middle_of_mlm', 481, 598}, + {'bottom_middle_of_mlm', 601, 718}, + {'bottom_middle_of_mlm', 721, 838}, + {'bottom_of_mlm', 841, 958}, + {'bottom_of_mlm', 961, 1078}, } -- Set menu ---[[ dashboard.section.buttons.val= { + dashboard.section.buttons= { type = "group", val = { { type = "text", val = "Quick links", opts = { hl = "SpecialComment", position = "center" } }, @@ -31,7 +39,7 @@ return { dashboard.button("q", "󰩈 Quit", "qa"), }, position = "center", - }]]-- + } -- Send config to alpha alpha.setup(dashboard.opts) diff --git a/lua/Dario48/plugins/bufferline.lua b/lua/Dario48/plugins/bufferline.lua index f5ab53d..0df1d37 100644 --- a/lua/Dario48/plugins/bufferline.lua +++ b/lua/Dario48/plugins/bufferline.lua @@ -1,11 +1,14 @@ return { - 'akinsho/bufferline.nvim', - version = "*", + 'akinsho/bufferline.nvim', + event = {'BufReadPre', 'BufNewFile'}, + version = "*", dependencies = 'nvim-tree/nvim-web-devicons', config = function() require("bufferline").setup() - vim.keymap.set("n", "bb", ":bNext ") - vim.keymap.set("n", "bk", ":bdelete ") - vim.keymap.set("n", "bl", ":blast ") - end + end, + keys = { + {"bb", "bNext ", desc = "next buffer"}, + {"bd", "bdelete ", desc = "delete buffer"}, + {"bl", "blast ", desc = "last buffer"}, + } } diff --git a/lua/Dario48/plugins/csvlens.lua b/lua/Dario48/plugins/csvlens.lua new file mode 100644 index 0000000..a05cc6b --- /dev/null +++ b/lua/Dario48/plugins/csvlens.lua @@ -0,0 +1,8 @@ +return { + "theKnightsOfRohan/csvlens.nvim", + dependencies = { + "akinsho/toggleterm.nvim" + }, + config = true, + opts = { --[[ Place your opts here ]] } +} diff --git a/lua/Dario48/plugins/lazydev.lua b/lua/Dario48/plugins/lazydev.lua new file mode 100644 index 0000000..1c95911 --- /dev/null +++ b/lua/Dario48/plugins/lazydev.lua @@ -0,0 +1,24 @@ +return { + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "luvit-meta/library", words = { "vim%.uv" } }, + }, + }, + }, + { "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings + { -- optional completion source for require statements and module annotations + "hrsh7th/nvim-cmp", + opts = function(_, opts) + opts.sources = opts.sources or {} + table.insert(opts.sources, { + name = "lazydev", + group_index = 0, -- set group index to 0 to skip loading LuaLS completions + }) + end, + }, +} diff --git a/lua/Dario48/plugins/lsp-zero.lua b/lua/Dario48/plugins/lsp-zero.lua index ed6f379..5e586b7 100644 --- a/lua/Dario48/plugins/lsp-zero.lua +++ b/lua/Dario48/plugins/lsp-zero.lua @@ -15,8 +15,10 @@ return { lazy = false, config = function () require("mason").setup() - vim.keymap.set("n", "m", ":Mason ") - end + end, + keys = { + {"m", ":Mason ", desc = "open mason"} + } }, -- Autocompletion @@ -87,6 +89,7 @@ return { end, } }) - end + end, + keys = {{"qf", function() vim.lsp.buf.code_action() end, silent=true, desc="quickfix"}} } } diff --git a/lua/Dario48/plugins/luarocks.lua b/lua/Dario48/plugins/luarocks.lua new file mode 100644 index 0000000..c8dfe6c --- /dev/null +++ b/lua/Dario48/plugins/luarocks.lua @@ -0,0 +1,5 @@ +return { + "vhyrro/luarocks.nvim", + priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config. + config = true, +} diff --git a/lua/Dario48/plugins/neorg.lua b/lua/Dario48/plugins/neorg.lua new file mode 100644 index 0000000..9443a98 --- /dev/null +++ b/lua/Dario48/plugins/neorg.lua @@ -0,0 +1,21 @@ +return { + "nvim-neorg/neorg", + dependencies = { "luarocks.nvim" }, + lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default + config = true, + opts = { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + school = "~/Documents/school", + notes = "~/Documents/notes", + }, + default_workspace = "notes", + }, + } + } + } +} diff --git a/lua/Dario48/plugins/nvim-dap.lua b/lua/Dario48/plugins/nvim-dap.lua new file mode 100644 index 0000000..862965b --- /dev/null +++ b/lua/Dario48/plugins/nvim-dap.lua @@ -0,0 +1,48 @@ +return { + { + "mfussenegger/nvim-dap", + keys = { + {"dt", function() require'dap'.toggle_breakpoint() end, {silent = true}, desc = "toggle breakpoint"}, + {"dc", function() require'dap'.continue() end, {silent = true}, desc = "debug continue"}, + {"dso", function() require'dap'.step_over() end, {silent = true}, desc = "debug step over"}, + {"dsi", function() require'dap'.step_into() end, {silent = true}, desc = "debug step into"} + }, + init = function() + local dap = require'dap' + dap.adapters.lldb = { + type = 'executable', + command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path + name = 'lldb' + } + dap.configurations.cpp = { + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {function() + return vim.fn.input('Runtime args: ', vim.fn.getcwd()) + end, + }, + }, + } + dap.configurations.c = dap.configurations.cpp + dap.configurations.zig = dap.configurations.cpp + dap.configurations.rust = dap.configurations.cpp + end + }, + { + "rcarriga/nvim-dap-ui", + dependencies = {"mfussenegger/nvim-dap", "nvim-neotest/nvim-nio"}, + config = function() + require("dapui").setup() + end, + keys = { + {"du", "lua require\"dapui\".toggle()", desc = "open dapui"} + }, + } +} diff --git a/lua/Dario48/plugins/nvim-tree.lua b/lua/Dario48/plugins/nvim-tree.lua index d01dcdc..482fb1e 100644 --- a/lua/Dario48/plugins/nvim-tree.lua +++ b/lua/Dario48/plugins/nvim-tree.lua @@ -1,6 +1,7 @@ return { "nvim-tree/nvim-tree.lua", dependencies = {'nvim-tree/nvim-web-devicons'}, + lazy = false, config = function() -- disable netrw at the very start of your init.lua vim.g.loaded_netrw = 1 @@ -40,8 +41,9 @@ return { }, }, } - vim.cmd([[command! NvimTreeFocus NvimTreeClose | NvimTreeOpen]]) - vim.keymap.set("n", "ee", ":NvimTreeToggle ", { silent = true }) - vim.keymap.set("n", "ef", ":NvimTreeFocus ", { silent = true } ) - end + end, + keys = { + {"ee", ":NvimTreeToggle ", { silent = true }}, + {"ef", ":NvimTreeOpen ", { silent = true }}, + } } diff --git a/lua/Dario48/plugins/telescope.lua b/lua/Dario48/plugins/telescope.lua index edb1c33..e635c20 100644 --- a/lua/Dario48/plugins/telescope.lua +++ b/lua/Dario48/plugins/telescope.lua @@ -1,12 +1,10 @@ return { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim', "sharkdp/fd", "nvim-tree/nvim-web-devicons" }, - config = function() - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'ff', builtin.find_files, {}) - vim.keymap.set('n', 'fg', builtin.git_files, {}) - vim.keymap.set('n', 'fs', function() - builtin.grep_string({search = vim.fn.input("What to grep? ")}) - end) - end + keys = { + {'ff', "Telescope find_files", desc = "find files"}, + {'fs', function() + require('telescope.builtin').grep_string({search = vim.fn.input("What to grep? ")}) + end, "grep something"} + } } diff --git a/lua/Dario48/plugins/treesitter.lua b/lua/Dario48/plugins/treesitter.lua index 8f68c5a..c359bd7 100644 --- a/lua/Dario48/plugins/treesitter.lua +++ b/lua/Dario48/plugins/treesitter.lua @@ -1,17 +1,23 @@ return { - "nvim-treesitter/nvim-treesitter", - build = function() - require("nvim-treesitter.install").update({ with_sync = true })() - end, - config = function () - local configs = require("nvim-treesitter.configs") + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true })() + end, + config = function () + local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, - sync_install = false, - auto_install = true, - highlight = { enable = true, additional_vim_regex_highlighting = false }, - indent = { enable = true }, - }) - end + configs.setup({ + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + sync_install = false, + auto_install = true, + highlight = { enable = true, additional_vim_regex_highlighting = false }, + indent = { enable = true }, + }) + end + }, + { + "luckasRanarison/tree-sitter-hyprlang", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + } }