-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from fabmorais/upd-plugins
Update plugins and use vscode snippets
- Loading branch information
Showing
5 changed files
with
138 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}), | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters