diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 2e1d2a1..13ac09c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -5,11 +5,15 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, + "noice.nvim": { "branch": "main", "commit": "894db25ec726d32047799d4d0a982b701bec453b" }, + "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, "nvim-lspconfig": { "branch": "master", "commit": "67f151e84daddc86cc65f5d935e592f76b9f4496" }, - "nvim-tree.lua": { "branch": "master", "commit": "dea82ae2071a8d6412ca31e8fc48da5accad1a1d" }, - "nvim-treesitter": { "branch": "master", "commit": "8fa7ce35afe88b8294e6ced757aa14ec98414568" }, + "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, + "nvim-tree.lua": { "branch": "master", "commit": "920868dba13466586897a8f40220eca6b2caac41" }, + "nvim-treesitter": { "branch": "master", "commit": "a185f8ebae9006b181e83f6569df68e7ff8aeb80" }, "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, + "nvterm": { "branch": "main", "commit": "5ae78fb332e92447121d2af58a6313189a7799fb" }, "onedark.nvim": { "branch": "master", "commit": "09b71d84bd2524438e48c0aa5b54d855cc72af32" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" } diff --git a/.config/nvim/lua/boot.lua b/.config/nvim/lua/boot.lua index aa60252..a9a39a5 100644 --- a/.config/nvim/lua/boot.lua +++ b/.config/nvim/lua/boot.lua @@ -18,7 +18,7 @@ require("lazy").setup("plugins", { lazy = true, }, change_detection = { - notify = false, + notify = false }, performance = { rtp = { diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 56617eb..657191b 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -5,3 +5,16 @@ on("VimEnter", { require("nvim-tree.api").tree.toggle({ focus = false }) end, }) + +on({ "TermOpen", "TermEnter" }, { + callback = function() + vim.wo.signcolumn = "no" + end, +}) + +on({ "BufNewFile", "BufRead" }, { + pattern = { "*.txt", "*.md" }, + callback = function() + vim.lo.wrap = true + end, +}) diff --git a/.config/nvim/lua/config/keys.lua b/.config/nvim/lua/config/keys.lua index ab26c92..56ef219 100644 --- a/.config/nvim/lua/config/keys.lua +++ b/.config/nvim/lua/config/keys.lua @@ -1,25 +1,29 @@ -local map = vim.keymap.set +local map = function(mode, lhs, rhs, info) + vim.keymap.set(mode, lhs, rhs, { desc = info }) +end --- Normal mode -map("n", "", "enew", { desc = "New File" }) -map("n", "", "NvimTreeToggle", { desc = "Toggle file explorer" }) -map("n", "", "qa", { desc = "Quit all" }) -map("n", "l", "Lazy", { desc = "Lazy" }) -map("n", "f", "Telescope find_files", { desc = "Find files" }) -map("n", "r", "Telescope oldfiles", { desc = "Recent files" }) -map("n", "s", "Telescope symbols", { desc = "Symbols" }) -map("n", "cf", vim.lsp.buf.format, { desc = "Format" }) -map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) -map("n", "gr", vim.lsp.buf.references, { desc = "Go to references" }) +-- Basics +map("n", "", "enew", "New File") +map({ "i", "n", "s", "v" }, "", "w", "Save file") +map("n", "", "qa", "Quit all") +map({ "i", "n" }, "", "noh", "Clear search") --- Visual mode +-- Indenting map("v", "<", "", ">gv") --- Mixed modes -map({ "i", "n" }, "", "noh", { desc = "Clear search" }) -map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) +-- LSP +map("n", "gd", vim.lsp.buf.definition, "Go to definition") +map("n", "gr", vim.lsp.buf.references, "Go to references") +map("n", "cf", vim.lsp.buf.format, "Format") -- Toggle comment -map("n", "/", "lua require('Comment.api').toggle.linewise.current()", { desc = "Toggle comment" }) -map("v", "/", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = "Toggle comment" }) +map("n", "", "lua require('Comment.api').toggle.linewise.current()", "Toggle comment") +map("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", "Toggle comment") + +-- Normal mode +map("n", "", "NvimTreeToggle", "Toggle tree") +map("n", "l", "Lazy", "Lazy") +map("n", "f", "Telescope find_files", "Find files") +map("n", "r", "Telescope oldfiles", "Recent files") +map({ "n", "t" }, "", "lua require('nvterm.terminal').toggle('float')", "Toggle terminal") diff --git a/.config/nvim/lua/config/settings.lua b/.config/nvim/lua/config/settings.lua index 8f8c0bf..ade72f8 100644 --- a/.config/nvim/lua/config/settings.lua +++ b/.config/nvim/lua/config/settings.lua @@ -4,22 +4,34 @@ g.loaded_netrw = 1 g.loaded_netrwPlugin = 1 local opt = vim.opt -opt.autowrite = false -opt.expandtab = false -opt.shiftwidth = 4 -opt.tabstop = 4 -opt.softtabstop = 4 opt.autoindent = true -opt.smartindent = true -opt.spell = false +opt.autowrite = false +opt.clipboard = "unnamedplus" opt.conceallevel = 0 -opt.ignorecase = false -opt.number = true -opt.relativenumber = false opt.cursorline = true opt.cursorlineopt = "both" -opt.termguicolors = true -opt.signcolumn = "yes" +opt.expandtab = false +opt.grepformat = "%f:%l:%c:%m" +opt.grepprg = "rg --vimgrep" +opt.ignorecase = false opt.laststatus = 0 -opt.showmode = false +opt.mouse = "a" +opt.number = true +opt.relativenumber = false opt.ruler = false +opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } +opt.shiftwidth = 4 +opt.showmode = false +opt.signcolumn = "yes" +opt.smartindent = true +opt.softtabstop = 4 +opt.spell = false +opt.splitbelow = true +opt.splitright = true +opt.tabstop = 4 +opt.termguicolors = true +opt.undofile = true +opt.undolevels = 10000 +opt.updatetime = 250 +opt.wildmode = "longest:full,full" +opt.wrap = false diff --git a/.config/nvim/lua/plugins/autocomplete.lua b/.config/nvim/lua/plugins/autocomplete.lua deleted file mode 100644 index d255522..0000000 --- a/.config/nvim/lua/plugins/autocomplete.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, -} diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..2f8038d --- /dev/null +++ b/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,24 @@ +return { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + config = function() + local cmp = require("cmp") + + cmp.setup({ + mapping = { + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ select = true }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "buffer" }, + { name = "path" }, + }, + }) + end, +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua index fdeba7c..27463d8 100644 --- a/.config/nvim/lua/plugins/comment.lua +++ b/.config/nvim/lua/plugins/comment.lua @@ -1,13 +1,11 @@ return { "numToStr/Comment.nvim", event = "VeryLazy", + config = true, opts = { mappings = { basic = false, extra = false, }, }, - config = function(_, opts) - require("Comment").setup(opts) - end, } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index ffafecd..746227e 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,7 +1,5 @@ return { "lewis6991/gitsigns.nvim", event = "BufReadPre", - config = function() - require("gitsigns").setup() - end, + config = true, } diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..b4f5eec --- /dev/null +++ b/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,18 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + opts = { + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + }, + config = true, +} diff --git a/.config/nvim/lua/plugins/telescope-browser.lua b/.config/nvim/lua/plugins/telescope-browser.lua new file mode 100644 index 0000000..82ea57c --- /dev/null +++ b/.config/nvim/lua/plugins/telescope-browser.lua @@ -0,0 +1,13 @@ +return { + "nvim-telescope/telescope-file-browser.nvim", + enabled = false, + event = "VeryLazy", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim" + }, + config = function() + require("telescope").load_extension("file_browser") + vim.keymap.set("n", "fb", "Telescope file_browser", "File browser") + end, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index c331a43..baac8a1 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,6 +1,7 @@ return { "nvim-telescope/telescope.nvim", event = "VeryLazy", + config = true, dependencies = { "nvim-lua/plenary.nvim" }, diff --git a/.config/nvim/lua/plugins/term.lua b/.config/nvim/lua/plugins/term.lua new file mode 100644 index 0000000..d936142 --- /dev/null +++ b/.config/nvim/lua/plugins/term.lua @@ -0,0 +1,5 @@ +return { + "NvChad/nvterm", + event = "VeryLazy", + config = true, +} diff --git a/.config/nvim/lua/plugins/theme.lua b/.config/nvim/lua/plugins/theme.lua index fff9fab..9638edf 100644 --- a/.config/nvim/lua/plugins/theme.lua +++ b/.config/nvim/lua/plugins/theme.lua @@ -1,7 +1,14 @@ return { "navarasu/onedark.nvim", - event = "VeryLazy", - config = function() - require('onedark').load() + lazy = false, + priority = 1000, + opts = { + style = "dark", + transparent = false, + }, + config = function(_, opts) + local theme = require("onedark") + theme.setup(opts) + theme.load() end, } diff --git a/.config/nvim/lua/plugins/tree.lua b/.config/nvim/lua/plugins/tree.lua index 805dbac..a19f781 100644 --- a/.config/nvim/lua/plugins/tree.lua +++ b/.config/nvim/lua/plugins/tree.lua @@ -3,7 +3,6 @@ return { event = "VeryLazy", dependencies = { "nvim-tree/nvim-web-devicons", - "navarasu/onedark.nvim", }, config = function() require("nvim-tree").setup({