Skip to content

Commit

Permalink
Merge pull request #18 from fabmorais/upd-plugins
Browse files Browse the repository at this point in the history
Update plugins and use vscode snippets
  • Loading branch information
fabmorais authored Jun 14, 2024
2 parents 4a3ffe4 + 5d215aa commit c1b8d0e
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 121 deletions.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
99 changes: 51 additions & 48 deletions lua/lsp-config/nvim-cmp.lua
Original file line number Diff line number Diff line change
@@ -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({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<Tab>"] = 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" }),
["<S-Tab>"] = 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({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<Tab>"] = 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" }),
["<S-Tab>"] = 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,
}),
},
})
5 changes: 5 additions & 0 deletions lua/mappings/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ map("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
map("n", "<C-d>", "<C-d>zz", { noremap = true, silent = false })
map("n", "<C-u>", "<C-u>zz", { noremap = true, silent = false })

-- Create custom keybindings for terminal navigation
-- Use <C-j> to move to the split below and <C-k> to move to the split above from terminal
map("t", "<C-j>", "<C-\\><C-n><C-w>j", { noremap = true, silent = true })
map("t", "<C-k>", "<C-\\><C-n><C-w>k", { noremap = true, silent = true })

-- map(
-- "n",
-- "<C-u>",
Expand Down
148 changes: 76 additions & 72 deletions lua/packer-config/init.lua
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 5 additions & 0 deletions lua/treesitter-config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require("nvim-treesitter.configs").setup({
"html",
"rust",
"toml",
"terraform",
},

sync_install = false,
Expand All @@ -22,6 +23,10 @@ require("nvim-treesitter.configs").setup({
additional_vim_regex_highlighting = false,
},

indent = {
enable = true,
},

rainbow = {
enable = true,
extended_mode = true,
Expand Down

0 comments on commit c1b8d0e

Please sign in to comment.