feat: move coding-related plugins to coding.lua
This is the first commit of my v2 update. I am following the LazyVim pattern for organizing all of my configuration options. I like LazyVim a lot and would use it myself - except I have an obsession with tinkering and doing this part myself. So I shall!
This commit is contained in:
parent
8591814ca5
commit
102af95a0b
6 changed files with 109 additions and 114 deletions
86
lua/plugins/coding.lua
Normal file
86
lua/plugins/coding.lua
Normal file
|
@ -0,0 +1,86 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-nvim-lsp" },
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
-- Highlights the first result always
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-o>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behaviour = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
}),
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
version = false,
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
version = false,
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
opts = {
|
||||
enable_autocmd = false,
|
||||
},
|
||||
},
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
version = false,
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring()
|
||||
or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"tpope/vim-commentary"
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
-- Highlights the first result always
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert"
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-o>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i" }),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behaviour = cmp.ConfirmBehavior.Insert,
|
||||
select = true
|
||||
})
|
||||
}),
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }
|
||||
}, {
|
||||
{ name = "buffer" }
|
||||
})
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip"
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
return {
|
||||
"m4xshen/hardtime.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
disable_mouse = true,
|
||||
disabled_keys = {
|
||||
-- Drill Sergeant Demchuk!
|
||||
["<Up>"] = { "", "i" },
|
||||
["<Down>"] = { "", "i" },
|
||||
["<Left>"] = { "", "i" },
|
||||
["<Right>"] = { "", "i" },
|
||||
},
|
||||
disabled_filetypes = {
|
||||
"checkhealth",
|
||||
"fugitive",
|
||||
"help",
|
||||
"lazy",
|
||||
"mason",
|
||||
"markdown",
|
||||
"neo-tree",
|
||||
"neo-tree-popup",
|
||||
"netrw",
|
||||
"noice",
|
||||
"notify",
|
||||
"qf",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"tpope/vim-surround"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue