diff --git a/init.lua b/init.lua index c636b75..749913d 100644 --- a/init.lua +++ b/init.lua @@ -11,6 +11,8 @@ vim.keymap.set({ "n", "v" }, "", "") vim.keymap.set({ "n", "v" }, "", "") vim.keymap.set({ "n", "v" }, "", "") +vim.keymap.set({ "n", "i" }, "", ":w") + local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system { diff --git a/lazy-lock.json b/lazy-lock.json index 4ee38b0..c50ffbd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,14 +2,20 @@ "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, "base46": { "branch": "v2.5", "commit": "adb64a6ae70f8c61c5ab8892f07d29dafd4d47ad" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, "gitsigns.nvim": { "branch": "main", "commit": "d96ef3bbff0bdbc3916a220f5c74a04c4db033f2" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "ca9eaccc154578064366d99de7b02f8231c383eb" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" }, diff --git a/lua/configs/luasnip.lua b/lua/configs/luasnip.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/lua/configs/luasnip.lua @@ -0,0 +1 @@ +return {} diff --git a/lua/configs/treesitter.lua b/lua/configs/treesitter.lua index d8851e6..e3f936c 100644 --- a/lua/configs/treesitter.lua +++ b/lua/configs/treesitter.lua @@ -17,9 +17,9 @@ return { "astro", "bash", }, - highlight = { - enable = true, - use_languagetree = true, - }, + -- highlight = { + -- enable = true, + -- use_languagetree = true, + -- }, indent = { { enable = true } }, } diff --git a/lua/nvconfig.lua b/lua/nvconfig.lua index c0c18cc..1b213d1 100644 --- a/lua/nvconfig.lua +++ b/lua/nvconfig.lua @@ -28,7 +28,7 @@ M.ui = { -- round and block will work for minimal theme only separator_style = "default", order = nil, - modules = nil, + modules = { "git" }, }, tabufline = { @@ -52,11 +52,11 @@ M.ui = { buttons = { { " Find File", "Spc f f", "Telescope find_files" }, - { "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" }, - { "󰈭 Find Word", "Spc f w", "Telescope live_grep" }, - { " Bookmarks", "Spc m a", "Telescope marks" }, + { "󰈚 Recent Files", "Spc f r", "Telescope oldfiles" }, + { "󰈭 Find Word", "Spc p g", "Telescope live_grep" }, + -- { " Bookmarks", "Spc m a", "Telescope marks" }, { " Themes", "Spc t h", "Telescope themes" }, - { " Mappings", "Spc c h", "NvCheatsheet" }, + -- { " Mappings", "Spc c h", "NvCheatsheet" }, }, }, @@ -64,18 +64,18 @@ M.ui = { lsp = { signature = true }, - term = { - hl = "Normal:term,WinSeparator:WinSeparator", - sizes = { sp = 0.3, vsp = 0.2 }, - float = { - relative = "editor", - row = 0.3, - col = 0.25, - width = 0.5, - height = 0.4, - border = "single", - }, - }, + -- term = { + -- hl = "Normal:term,WinSeparator:WinSeparator", + -- sizes = { sp = 0.3, vsp = 0.2 }, + -- float = { + -- relative = "editor", + -- row = 0.3, + -- col = 0.25, + -- width = 0.5, + -- height = 0.4, + -- border = "single", + -- }, + -- }, } M.base46 = { diff --git a/lua/plugins/lsp-zero.lua b/lua/plugins/lsp-zero.lua index bd63319..3348834 100644 --- a/lua/plugins/lsp-zero.lua +++ b/lua/plugins/lsp-zero.lua @@ -46,6 +46,43 @@ return { }, { "neovim/nvim-lspconfig" }, { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/nvim-cmp" }, - { "L3MON4D3/LuaSnip" }, + { + "hrsh7th/nvim-cmp", + dependencies = { + { + -- snippet plugin + "L3MON4D3/LuaSnip", + dependencies = "rafamadriz/friendly-snippets", + opts = { history = true, updateevents = "TextChanged,TextChangedI" }, + config = function(_, opts) + require("luasnip").config.set_config(opts) + require "configs.luasnip" + end, + }, + + -- autopairing of (){}[] etc + { + "windwp/nvim-autopairs", + opts = { + fast_wrap = {}, + disable_filetype = { "TelescopePrompt", "vim" }, + }, + config = function(_, opts) + require("nvim-autopairs").setup(opts) + + -- setup cmp for autopairs + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- cmp sources plugins + { + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + }, + }, + }, } diff --git a/lua/remaps.lua b/lua/remaps.lua index 6b81ab8..27716ed 100644 --- a/lua/remaps.lua +++ b/lua/remaps.lua @@ -13,6 +13,7 @@ map("i", "jk", "") -- telescope keybinds local builtin = require "telescope.builtin" map("n", "ff", builtin.find_files, { desc = "[f]ind [f]ile" }) +map("n", "fr", "Telescope oldfiles", { desc = "[f]ind [r]ecent file" }) map("n", "pg", builtin.live_grep, { desc = "[p]roject [g]rep" }) map("n", "fb", builtin.buffers, { desc = "[f]ind [b]uffer" }) map("n", "fh", builtin.help_tags, { desc = "[f]ind [h]elp" })