refactor(nvim): move plugin config to the

... `after/plugin` directory
This commit is contained in:
Oliver Davies 2022-01-09 23:13:41 +00:00
parent 8cf3fed368
commit 7d3b82884c
13 changed files with 4 additions and 14 deletions

View file

@ -0,0 +1,19 @@
local status_ok, autopairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
end
autopairs.setup {}
local cmp_status_ok, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
if not cmp_status_ok then
return
end
local cmp = require "cmp"
cmp.event:on(
"confirm_done",
cmp_autopairs.on_confirm_done {
map_char = { tex = "" },
}
)

View file

@ -0,0 +1,13 @@
local colorbuddy_status_ok, colorbuddy = pcall(require, "colorbuddy")
if not colorbuddy_status_ok then
return
end
local colorizer_status_ok, colorizer = pcall(require, "colorizer")
if not colorizer_status_ok then
return
end
colorbuddy.colorscheme "gruvbuddy"
colorizer.setup()

View file

@ -0,0 +1,19 @@
local status_ok, comment = pcall(require, "Comment")
if not status_ok then
return
end
comment.setup {
padding = true,
opleader = {
line = "gc",
block = "gb",
},
mappings = {
basic = true,
extra = true,
extended = false,
},
}

View file

@ -0,0 +1,63 @@
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
local snip_status_ok, luasnip = pcall(require, "luasnip")
if not snip_status_ok then
return
end
require("luasnip/loaders/from_vscode").lazy_load()
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.close(),
["<c-y>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
},
sources = {
{ name = "buffer", priority = 2, keyword_length = 5, max_item_count = 5 },
{ name = "calc" },
{ name = "path" },
{ name = "spell" },
{ name = "treesitter" },
-- Neovim
{ name = "nvim_lsp", priority = 10 },
{ name = "nvim_lua" },
-- Plugins
{ name = "luasnip" },
{ name = "cmp_tabnine" },
},
formatting = {
format = require("lspkind").cmp_format {
with_text = true,
menu = {
buffer = "[buf]",
cmp_tabnine = "[tn]",
luasnip = "[snip]",
nvim_lsp = "[lsp]",
nvim_lua = "[lua]",
path = "[path]",
},
},
},
experimental = {
ghost_text = true,
},
}

View file

@ -0,0 +1,8 @@
local map = vim.api.nvim_set_keymap
local options = { noremap = true }
map("n", "<leader>ld", "<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker<cr>", options)
map("n", "<leader>lg", "<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit<cr>", options)
map("n", "<leader>nn", "<cmd>FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde<cr>", options)
map("n", "<leader>tt", "<cmd>FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh<cr>", options)

View file

@ -0,0 +1,31 @@
local colorbuddy_status_ok, colorbuddy = pcall(require, "colorbuddy")
if not colorbuddy_status_ok then
return
end
local gitsigns_status_ok, gitsigns = pcall(require, "gitsigns")
if not gitsigns_status_ok then
return
end
local c = require("colorbuddy.color").colors
local Group = require("colorbuddy.group").Group
Group.new("GitSignsAdd", c.green)
Group.new("GitSignsChange", c.yellow)
Group.new("GitSignsDelete", c.red)
gitsigns.setup {
linehl = false,
numhl = true,
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr" },
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr" },
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr" },
topdelete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr" },
changedelete = { hl = "GitSignsDelete", text = "~", numhl = "GitSignsChangeNr" },
},
word_diff = false,
}

View file

@ -0,0 +1,18 @@
local status_ok, indent_blankline = pcall(require, "indent_blankline")
if not status_ok then
return
end
vim.opt.list = true
vim.opt.listchars = {
eol = "",
}
vim.cmd [[highlight IndentBlanklineIndent1 guifg=#555555 gui=nocombine]]
indent_blankline.setup {
char_highlight_list = {
"IndentBlanklineIndent1",
},
show_end_of_line = true,
}

View file

@ -13,7 +13,7 @@ local php = require "opdavies.snippets.php"
local snippets = {
js = javascript,
markdown = markdown,
all = markdown,
php = php,
typescript = javascript,
vue = javascript,

View file

@ -0,0 +1,3 @@
-- vim.g.seiya_auto_enable = 1
-- vim.g.seiya_target_groups = { "guibg" }

View file

@ -0,0 +1,18 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup {
context_commenting = {
enable = true,
},
ensure_installed = "maintained",
highlight = {
enable = true,
},
indent = {
disable = { "yaml" },
enable = true,
},
}

View file

@ -0,0 +1,13 @@
local map = vim.api.nvim_set_keymap
local options = {
silent = true,
}
map("n", "t<C-f>", ":TestFile<CR>", options)
map("n", "t<C-g>", ":TestVisit<CR>", options)
map("n", "t<C-l>", ":TestLast<CR>", options)
map("n", "t<C-n>", ":TestNearest<CR>", options)
map("n", "t<C-s>", ":TestSuite<CR>", options)
vim.g["test#strategy"] = "neovim"