mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- Testing setup through neotest plugin - Spellcheck enabled on markdown and text files - Diagnosis summary through trouble plugin - Code completion keybindings improved - Auto-formatting through conform plugin - Reactjs context aware commenting through nvim-ts-context-commentstring - Auto HTML tag completion through nvim-ts-autotag - CSS color highlight through nvim-highlight-colors - Lualine: breadcrumbs, git status, single line - Auto restore neovim sessions - Better keyboard maps Shell - Aliases now load from .bashrc or .zshrc - Bash & zsh shortcuts to easy open and create projects - zoxide instead of cd when installed - bootstrap.sh shellhardened
104 lines
3.2 KiB
Lua
104 lines
3.2 KiB
Lua
return {
|
|
|
|
-- TODO: Figureout how to add custom snippets
|
|
|
|
{
|
|
-- Autocompletion
|
|
"hrsh7th/nvim-cmp",
|
|
dependencies = {
|
|
-- Snippet Engine & its associated nvim-cmp source
|
|
"L3MON4D3/LuaSnip",
|
|
"saadparwaiz1/cmp_luasnip",
|
|
|
|
-- Adds LSP completion capabilities
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
"hrsh7th/cmp-path",
|
|
"hrsh7th/cmp-buffer",
|
|
|
|
-- Adds a number of user-friendly snippets
|
|
"rafamadriz/friendly-snippets",
|
|
},
|
|
config = function()
|
|
-- [[ Configure nvim-cmp ]]
|
|
-- See `:help cmp`
|
|
-- vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
|
local cmp = require("cmp")
|
|
local defaults = require("cmp.config.default")()
|
|
local luasnip = require("luasnip")
|
|
require("luasnip.loaders.from_vscode").lazy_load()
|
|
luasnip.config.setup({})
|
|
|
|
cmp.setup({
|
|
snippet = {
|
|
expand = function(args)
|
|
luasnip.lsp_expand(args.body)
|
|
end,
|
|
},
|
|
completion = {
|
|
completeopt = "menu,menuone,noinsert",
|
|
},
|
|
mapping = cmp.mapping.preset.insert({
|
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
|
|
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
|
|
|
["<C-Space>"] = cmp.mapping.complete({}),
|
|
["<C-x>"] = cmp.mapping.abort(),
|
|
|
|
-- Enter to perform the completion
|
|
["<CR>"] = cmp.mapping.confirm({
|
|
select = true,
|
|
}),
|
|
["<S-CR>"] = cmp.mapping.confirm({
|
|
behavior = cmp.ConfirmBehavior.Replace,
|
|
select = true,
|
|
}),
|
|
}),
|
|
sources = {
|
|
{ name = "nvim_lsp" },
|
|
{ name = "luasnip" },
|
|
{ name = "path" },
|
|
{ { name = "buffer" } },
|
|
},
|
|
-- experimental = {
|
|
-- ghost_text = {
|
|
-- hl_group = "CmpGhostText",
|
|
-- },
|
|
-- },
|
|
sorting = defaults.sorting,
|
|
})
|
|
end,
|
|
},
|
|
|
|
{
|
|
"L4MON4D3/LuaSnip",
|
|
keys = {
|
|
{
|
|
"<tab>",
|
|
function()
|
|
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
|
end,
|
|
expr = true,
|
|
silent = true,
|
|
mode = "i",
|
|
},
|
|
{
|
|
"<tab>",
|
|
function()
|
|
require("luasnip").jump(1)
|
|
end,
|
|
mode = "s",
|
|
},
|
|
{
|
|
"<s-tab>",
|
|
function()
|
|
require("luasnip").jump(-1)
|
|
end,
|
|
mode = { "i", "s" },
|
|
},
|
|
},
|
|
},
|
|
}
|