From b4b679a7e584c8cda717559ba595edb42ff5606d Mon Sep 17 00:00:00 2001 From: Alessandro Date: Fri, 11 Oct 2024 12:04:59 +0200 Subject: [PATCH] Update and clean config --- nvim/lazy-lock.json | 18 +++++++++--------- nvim/lua/chadrc.lua | 8 ++++---- nvim/lua/configs/conform.lua | 8 -------- nvim/lua/mappings.lua | 10 +++------- nvim/lua/plugins/image.lua | 12 ++++++++++++ nvim/lua/plugins/init.lua | 17 ++--------------- 6 files changed, 30 insertions(+), 43 deletions(-) create mode 100644 nvim/lua/plugins/image.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 23cf40f..316e638 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,6 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, - "NvChad": { "branch": "v2.5", "commit": "a69f893e49ee36d4c74431044b40f08042c396a2" }, + "NvChad": { "branch": "v2.5", "commit": "f6025f0788880989484733c90deff07dff01ef02" }, "auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" }, "base46": { "branch": "v2.5", "commit": "177af7c0e492f6332bf78675a47b8983b1a32291" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -17,23 +17,23 @@ "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "menu": { "branch": "main", "commit": "b5115af73efe97f31214c433cf0ec05eb987e228" }, - "minty": { "branch": "main", "commit": "8809b2c7c2edbeb3fa9c3b05bd2e89934d54f526" }, + "menu": { "branch": "main", "commit": "349930b98590f10784e66340963aad2b4bf862c7" }, + "minty": { "branch": "main", "commit": "7c2a6452922313e10ff46aea49a4bb5e50e1ac68" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-lsp-endhints": { "branch": "main", "commit": "391ef40521b631a8a2fb7aef78db6967ead6b39d" }, - "nvim-lspconfig": { "branch": "master", "commit": "d3f169f436e1b44538bfe7e13b4721eec48dbc59" }, - "nvim-tree.lua": { "branch": "master", "commit": "50e919426a4a2053f78b2f8ab001c8ad8eb47ef6" }, - "nvim-treesitter": { "branch": "master", "commit": "9d2acd49976e2a9da72949008df03436f781fd23" }, + "nvim-lspconfig": { "branch": "master", "commit": "c38af37e4ee71d70b7d60267d96b0a83e5d346f5" }, + "nvim-tree.lua": { "branch": "master", "commit": "5ad87620ec9d1190d15c88171a3f0122bc16b0fe" }, + "nvim-treesitter": { "branch": "master", "commit": "19079207ba4a8c7ed956f40a111a22b1a2dfa6e8" }, "nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" }, - "nvim-web-devicons": { "branch": "master", "commit": "56f17def81478e406e3a8ec4aa727558e79786f3" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "d227e6c9879bb50af35cd733461198666981d482" }, "rustaceanvim": { "branch": "master", "commit": "29f42cc149f915d771c550b6dfe7c788d856cf04" }, - "telescope.nvim": { "branch": "master", "commit": "dc6fc321a5ba076697cca89c9d7ea43153276d81" }, - "ui": { "branch": "v3.0", "commit": "2be2b1983b5cda5b360faeff67ffe409fa668996" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, + "ui": { "branch": "v3.0", "commit": "99dae0e715fc67d8a38f27b2fc7b8bd47c23e817" }, "volt": { "branch": "main", "commit": "43f72b49037c191eb3cfe26ba7a5574b4bfce226" }, "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } } diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua index 0f6e731..79ffda7 100644 --- a/nvim/lua/chadrc.lua +++ b/nvim/lua/chadrc.lua @@ -105,10 +105,10 @@ M.nvdash = { load_on_startup = true, buttons = { { txt = "  Projects", keys = "Spc f p", cmd = "Telescope projects" }, - { txt = "  Find File", keys = "Spc f f", cmd = "Telescope find_files" }, - { txt = " 󰈚 Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" }, - { txt = " 󰈭 Find Word", keys = "Spc f w", cmd = "Telescope live_grep" }, - { txt = "  Bookmarks", keys = "Spc m a", cmd = "Telescope marks" }, + { txt = "  Find File", keys = "Spc f f", cmd = "Telescope find_files" }, + { txt = " 󰈚 Recent Files", keys = "Spc f o", cmd = "Telescope oldfiles" }, + { txt = " 󰈭 Find Word", keys = "Spc f w", cmd = "Telescope live_grep" }, + { txt = "  Bookmarks", keys = "Spc m a", cmd = "Telescope marks" }, { txt = "─", hl = "NvDashLazy", no_gap = true, rep = true }, { diff --git a/nvim/lua/configs/conform.lua b/nvim/lua/configs/conform.lua index 35ba6cf..fee1369 100644 --- a/nvim/lua/configs/conform.lua +++ b/nvim/lua/configs/conform.lua @@ -1,15 +1,7 @@ local options = { formatters_by_ft = { lua = { "stylua" }, - -- css = { "prettier" }, - -- html = { "prettier" }, }, - - -- format_on_save = { - -- -- These options will be passed to conform.format() - -- timeout_ms = 500, - -- lsp_fallback = true, - -- }, } return options diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 6de8838..97de13a 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -22,10 +22,7 @@ map("n", "t", "", { desc = "Terminal" }) map("n", "q", "confirm q", { desc = "quit" }) map("n", "h", "noh", { desc = "No Highlight" }) map("n", ";", "Nvdash", { desc = "Dashboard" }) -map("n", "c", function() - require("nvchad.tabufline").close_buffer() -end, { desc = "buffer close" }) - +map("n", "c", " lua require('nvchad.tabufline').close_buffer()", { desc = "buffer close" }) map("n", "rd", " lua require('rainbow-delimiters').toggle() ", { desc = "Toggle rainbow delimiters" }) -- Lsp @@ -41,9 +38,7 @@ map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) map("n", "gr", vim.lsp.buf.references, { desc = "Show references" }) map("n", "ld", vim.diagnostic.setloclist, { desc = "LSP Diagnostic loclist" }) -map("n", "lr", function() - require "nvchad.lsp.renamer"() -end, { desc = "NvRenamer" }) +map("n", "lr", " lua require 'nvchad.lsp.renamer' ()", { desc = "NvRenamer" }) -- Git map("n", "gm", "Telescope git_commits", { desc = "telescope git commits" }) @@ -71,6 +66,7 @@ end, { desc = "Terminal Toggle Vertical term" }) map("n", "fm", "Telescope marks", { desc = "telescope find marks" }) map("n", "fh", "Telescope terms", { desc = "telescope pick hidden term" }) map("n", "fp", "Telescope projects", { desc = "Show projects" }) + -- Cmp local cmp = require "cmp" diff --git a/nvim/lua/plugins/image.lua b/nvim/lua/plugins/image.lua new file mode 100644 index 0000000..f55924d --- /dev/null +++ b/nvim/lua/plugins/image.lua @@ -0,0 +1,12 @@ +return { + "3rd/image.nvim", + config = function() + require("image").setup { + backend = "ueberzug", + } + package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?/init.lua" + package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?.lua" + end, + ft = { "markdown" }, + event = { "BufRead *.png", "BufRead *.jpg", "BufRead *.jpeg", "BufRead *.gif", "BufRead *.wepb", "BufRead *.avif" }, +} diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 3e0b5a1..a8b7a69 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -5,13 +5,12 @@ return { }, { "neovim/nvim-lspconfig", - opts = - require "configs.lspconfig" + opts = require "configs.lspconfig" }, { "Pocco81/auto-save.nvim", opts = {}, - event = { "BufEnter" }, + event = { "InsertEnter" }, }, { "nvim-treesitter/nvim-treesitter", @@ -27,16 +26,4 @@ return { { "hrsh7th/nvim-cmp", }, - { - "3rd/image.nvim", - config = function() - require("image").setup { - backend = "ueberzug", - } - package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?/init.lua" - package.path = package.path .. ";" .. vim.fn.expand "$HOME" .. "/.luarocks/share/lua/5.1/?.lua" - end, - ft = { "markdown" }, - event = { "BufRead *.png", "BufRead *.jpg", "BufRead *.jpeg", "BufRead *.gif", "BufRead *.wepb", "BufRead *.avif" }, - }, }