diff --git a/init.lua b/init.lua index afbd564..3c71dc1 100644 --- a/init.lua +++ b/init.lua @@ -21,7 +21,7 @@ require("autopairs-config") require("diffview-config") require("notify-config") require("tint-config") -require("chatgpt-config") +-- require("chatgpt-config") require("debugger-config") require("debugger-config.rust") require("debugger-config.python") diff --git a/lua/lsp-config/nvim-cmp.lua b/lua/lsp-config/nvim-cmp.lua index 667dc29..13e0200 100644 --- a/lua/lsp-config/nvim-cmp.lua +++ b/lua/lsp-config/nvim-cmp.lua @@ -1,55 +1,58 @@ local luasnip = require("luasnip") local lspkind = require("lspkind") + -- nvim-cmp setup local cmp = require("cmp") +require("luasnip.loaders.from_vscode").lazy_load() + cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }), - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, - formatting = { - format = lspkind.cmp_format({ - with_text = true, - mode = "symbol", -- show only symbol annotations - maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, + formatting = { + format = lspkind.cmp_format({ + with_text = true, + mode = "symbol", -- show only symbol annotations + maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - -- The function below will be called before any actual modifications from lspkind - -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) - before = function(entry, vim_item) - return vim_item - end, - }), - }, + -- The function below will be called before any actual modifications from lspkind + -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) + before = function(entry, vim_item) + return vim_item + end, + }), + }, }) diff --git a/lua/mappings/init.lua b/lua/mappings/init.lua index c55f645..8351d14 100644 --- a/lua/mappings/init.lua +++ b/lua/mappings/init.lua @@ -15,6 +15,11 @@ map("i", "", 'copilot#Accept("")', { silent = true, expr = true }) map("n", "", "zz", { noremap = true, silent = false }) map("n", "", "zz", { noremap = true, silent = false }) +-- Create custom keybindings for terminal navigation +-- Use to move to the split below and to move to the split above from terminal +map("t", "", "j", { noremap = true, silent = true }) +map("t", "", "k", { noremap = true, silent = true }) + -- map( -- "n", -- "", diff --git a/lua/packer-config/init.lua b/lua/packer-config/init.lua index 7cd07a8..6041035 100644 --- a/lua/packer-config/init.lua +++ b/lua/packer-config/init.lua @@ -1,77 +1,81 @@ return require("packer").startup(function(use) - use("wbthomason/packer.nvim") - use("kyazdani42/nvim-web-devicons") - use("kyazdani42/nvim-tree.lua") - use("mofiqul/dracula.nvim") - use("rcarriga/nvim-notify") - use("nvim-lualine/lualine.nvim") - use("romgrk/barbar.nvim") - use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", requires = "p00f/nvim-ts-rainbow" }) - use("nvim-treesitter/nvim-treesitter-refactor") - use({ - "nvim-telescope/telescope.nvim", - requires = { { "nvim-lua/plenary.nvim" } }, - }) - use("folke/which-key.nvim") - use("akinsho/toggleterm.nvim") - use({ - "lewis6991/gitsigns.nvim", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - require("gitsigns").setup({ current_line_blame = true }) - end, - }) - use("levouh/tint.nvim") - use("terrortylor/nvim-comment") - use("norcalli/nvim-colorizer.lua") - use({ - "glepnir/dashboard-nvim", - config = function() - require("dashboard-config") - end, - event = "VimEnter", - dependencies = { { "nvim-tree/nvim-web-devicons" } }, - }) - use("lukas-reineke/indent-blankline.nvim") - use("windwp/nvim-autopairs") - use({ "sindrets/diffview.nvim", requires = "nvim-lua/plenary.nvim" }) + use("wbthomason/packer.nvim") + use("kyazdani42/nvim-web-devicons") + use("kyazdani42/nvim-tree.lua") + use("mofiqul/dracula.nvim") + use("rcarriga/nvim-notify") + use("nvim-lualine/lualine.nvim") + use("romgrk/barbar.nvim") + use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", requires = "p00f/nvim-ts-rainbow" }) + use("nvim-treesitter/nvim-treesitter-refactor") + use({ + "nvim-telescope/telescope.nvim", + requires = { { "nvim-lua/plenary.nvim" } }, + }) + use("folke/which-key.nvim") + use("akinsho/toggleterm.nvim") + use({ + "lewis6991/gitsigns.nvim", + requires = { "nvim-lua/plenary.nvim" }, + config = function() + require("gitsigns").setup({ current_line_blame = true }) + end, + }) + use("levouh/tint.nvim") + use("terrortylor/nvim-comment") + use("norcalli/nvim-colorizer.lua") + use({ + "glepnir/dashboard-nvim", + config = function() + require("dashboard-config") + end, + event = "VimEnter", + dependencies = { { "nvim-tree/nvim-web-devicons" } }, + }) + use("lukas-reineke/indent-blankline.nvim") + use("windwp/nvim-autopairs") + use({ "sindrets/diffview.nvim", requires = "nvim-lua/plenary.nvim" }) - --> debugging - use("mfussenegger/nvim-dap") - use("rcarriga/nvim-dap-ui") - use("theHamsta/nvim-dap-virtual-text") - use({ "nvim-neotest/nvim-nio" }) + --> debugging + use("mfussenegger/nvim-dap") + use("rcarriga/nvim-dap-ui") + use("theHamsta/nvim-dap-virtual-text") + use({ "nvim-neotest/nvim-nio" }) - --> AI - use({ - "jackMort/ChatGPT.nvim", - config = function() - require("chatgpt").setup() - end, - requires = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", - "nvim-telescope/telescope.nvim", - }, - }) + --> AI + use({ + "jackMort/ChatGPT.nvim", + config = function() + require("chatgpt").setup() + end, + requires = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "folke/trouble.nvim", + "nvim-telescope/telescope.nvim", + }, + }) - --> lsp - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig.nvim") - use("neovim/nvim-lspconfig") --> Collection of configurations for built-in LSP client - use("jose-elias-alvarez/null-ls.nvim") --> inject lsp diagnistocs, formattings, code actions, and more ... - use("onsails/lspkind-nvim") --> vscode-like pictograms for neovim lsp completion items - use("hrsh7th/nvim-cmp") --> Autocompletion plugin - use("hrsh7th/cmp-nvim-lsp") --> LSP source for nvim-cmp - use("saadparwaiz1/cmp_luasnip") --> Snippets source for nvim-cmp - use("L3MON4D3/LuaSnip") --> Snippets plugin - use("simrat39/rust-tools.nvim") - use({ - "nvimdev/lspsaga.nvim", - after = "nvim-lspconfig", - config = function() - require("lspsaga").setup({}) - end, - }) + --> lsp + use("williamboman/mason.nvim") + use("williamboman/mason-lspconfig.nvim") + use("neovim/nvim-lspconfig") --> Collection of configurations for built-in LSP client + use("jose-elias-alvarez/null-ls.nvim") --> inject lsp diagnistocs, formattings, code actions, and more ... + use("onsails/lspkind-nvim") --> vscode-like pictograms for neovim lsp completion items + + --> Completions + use("hrsh7th/nvim-cmp") --> Autocompletion plugin + use("hrsh7th/cmp-nvim-lsp") --> LSP source for nvim-cmp + use("L3MON4D3/LuaSnip") --> Snippets plugin + use("rafamadriz/friendly-snippets") + use("saadparwaiz1/cmp_luasnip") --> Snippets source for nvim-cmp + + use("simrat39/rust-tools.nvim") + use({ + "nvimdev/lspsaga.nvim", + after = "nvim-lspconfig", + config = function() + require("lspsaga").setup({}) + end, + }) end) diff --git a/lua/treesitter-config/init.lua b/lua/treesitter-config/init.lua index f9d7e31..9d1a9c6 100644 --- a/lua/treesitter-config/init.lua +++ b/lua/treesitter-config/init.lua @@ -13,6 +13,7 @@ require("nvim-treesitter.configs").setup({ "html", "rust", "toml", + "terraform", }, sync_install = false, @@ -22,6 +23,10 @@ require("nvim-treesitter.configs").setup({ additional_vim_regex_highlighting = false, }, + indent = { + enable = true, + }, + rainbow = { enable = true, extended_mode = true,