(neovim) another try of my own setup
This commit is contained in:
parent
50e0f23feb
commit
7225cf3967
54 changed files with 677 additions and 586 deletions
|
@ -1,12 +1,61 @@
|
|||
return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<Tab>"] = { "accept", "fallback" },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
event = "InsertEnter",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("blink.cmp").setup({
|
||||
snippets = { preset = "luasnip" },
|
||||
signature = { enabled = true },
|
||||
appearance = {
|
||||
use_nvim_cmp_as_default = false,
|
||||
nerd_font_variant = "normal",
|
||||
},
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
providers = {
|
||||
cmdline = {
|
||||
min_keyword_length = 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
["<Tab>"] = { "accept", "fallback" },
|
||||
},
|
||||
cmdline = {
|
||||
enabled = false,
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
border = nil,
|
||||
scrolloff = 1,
|
||||
scrollbar = false,
|
||||
draw = {
|
||||
columns = {
|
||||
{ "kind_icon" },
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind" },
|
||||
{ "source_name" },
|
||||
},
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
window = {
|
||||
border = nil,
|
||||
scrollbar = false,
|
||||
winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc",
|
||||
},
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters = {
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "2", "-ci", "-bn" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
return {
|
||||
{ "akinsho/bufferline.nvim", enabled = false },
|
||||
{ "catppuccin/nvim", enabled = false },
|
||||
{ "folke/persistence.nvim", enabled = false },
|
||||
{ "folke/tokyonight.nvim", enabled = false },
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
{ "MagickDuck/grug-far.nvim", enabled = false },
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
{ "todo-comments.nvim", enabled = false },
|
||||
{ "windwp/nvim-ts-autotag", enabled = false },
|
||||
}
|
23
config/common/nvim/lua/plugins/gitsigns.lua
Normal file
23
config/common/nvim/lua/plugins/gitsigns.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters = {
|
||||
["markdownlint-cli2"] = {
|
||||
args = { "--config", vim.fn.stdpath("config") .. "/linters/global.markdownlint-cli2.yaml" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
95
config/common/nvim/lua/plugins/linters.lua
Normal file
95
config/common/nvim/lua/plugins/linters.lua
Normal file
|
@ -0,0 +1,95 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
cmd = "Mason",
|
||||
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
|
||||
build = ":MasonUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua-language-server",
|
||||
"markdown-toc",
|
||||
"markdownlint-cli2",
|
||||
"marksman",
|
||||
"shfmt",
|
||||
"stylua",
|
||||
"terraform-ls",
|
||||
"tflint",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason").setup(opts)
|
||||
local mr = require("mason-registry")
|
||||
local function ensure_installed()
|
||||
for _, tool in ipairs(opts.ensure_installed) do
|
||||
if mr.has_package(tool) then
|
||||
local p = mr.get_package(tool)
|
||||
if not p:is_installed() then
|
||||
vim.notify("Mason: Installing " .. tool .. "...", vim.log.levels.INFO)
|
||||
p:install():once("closed", function()
|
||||
if p:is_installed() then
|
||||
vim.notify("Mason: Successfully installed " .. tool, vim.log.levels.INFO)
|
||||
else
|
||||
vim.notify("Mason: Failed to install " .. tool, vim.log.levels.ERROR)
|
||||
end
|
||||
end)
|
||||
end
|
||||
else
|
||||
vim.notify("Mason: Package '" .. tool .. "' not found", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if mr.refresh then
|
||||
mr.refresh(ensure_installed)
|
||||
else
|
||||
ensure_installed()
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("lint").linters_by_ft = {
|
||||
markdown = { "markdownlint-cli2" },
|
||||
terraform = { "terraform_validate" },
|
||||
tf = { "terraform_validate" },
|
||||
}
|
||||
|
||||
local markdownlint = require("lint").linters["markdownlint-cli2"]
|
||||
markdownlint.args = {
|
||||
"--config",
|
||||
"/Users/f/.config/nvim-ftpd/linters/global.markdownlint-cli2.yaml",
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "mason.nvim" },
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
["terraform-vars"] = { "terraform_fmt" },
|
||||
bash = { "shfmt" },
|
||||
lua = { "stylua" },
|
||||
markdown = { "markdownlint-cli2" },
|
||||
sh = { "shfmt" },
|
||||
terraform = { "terraform_fmt" },
|
||||
tf = { "terraform_fmt" },
|
||||
zsh = { "shfmt" },
|
||||
},
|
||||
-- format_on_save = {
|
||||
-- lsp_fallback = true,
|
||||
-- async = false,
|
||||
-- },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
return {
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua-language-server",
|
||||
"terraform-ls",
|
||||
"tflint",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,57 +1,60 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
theme = "powerline",
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "powerline",
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
globalstatus = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
{ "branch" },
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
lualine_c = {
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "filename", file_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"lsp_status",
|
||||
symbols = {
|
||||
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
|
||||
done = "✓",
|
||||
separator = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ "filename", file_status = true, path = 1 },
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
"lsp_status",
|
||||
symbols = {
|
||||
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
|
||||
done = "✓",
|
||||
separator = " ",
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||
{ "location", padding = { left = 0, right = 1 } },
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
lualine_y = {
|
||||
{ "searchcount" },
|
||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||
{ "location", padding = { left = 0, right = 1 } },
|
||||
tabline = {
|
||||
lualine_a = { "buffers" },
|
||||
},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = { "buffers" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
20
config/common/nvim/lua/plugins/markdown.lua
Normal file
20
config/common/nvim/lua/plugins/markdown.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
ft = { "markdown", "norg", "rmd", "org", "codecompanion" },
|
||||
config = function()
|
||||
require("render-markdown").setup({
|
||||
code = {
|
||||
sign = false,
|
||||
width = "block",
|
||||
right_pad = 1,
|
||||
},
|
||||
heading = {
|
||||
sign = false,
|
||||
icons = {},
|
||||
},
|
||||
checkbox = {
|
||||
enabled = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
13
config/common/nvim/lua/plugins/mini.lua
Normal file
13
config/common/nvim/lua/plugins/mini.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mini.pairs").setup({
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
skip_ts = { "string" },
|
||||
skip_unbalanced = true,
|
||||
markdown = true,
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,15 +1,14 @@
|
|||
return {
|
||||
{
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
"loctvl842/monokai-pro.nvim",
|
||||
priority = 10000,
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"echasnovski/mini.icons",
|
||||
},
|
||||
config = function()
|
||||
require("monokai-pro").setup({
|
||||
filter = "classic",
|
||||
},
|
||||
},
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "monokai-pro",
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.cmd.colorscheme("monokai-pro")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,8 +1,27 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
opts = {
|
||||
messages = {
|
||||
view_search = false,
|
||||
},
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
messages = {
|
||||
view_search = false,
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,19 +1,26 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"diff",
|
||||
"gotmpl",
|
||||
"helm",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"regex",
|
||||
"terraform",
|
||||
"vim",
|
||||
},
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"diff",
|
||||
"gotmpl",
|
||||
"hcl",
|
||||
"helm",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"regex",
|
||||
"terraform",
|
||||
"vim",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,39 +1,38 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts_extend = { "spec" },
|
||||
opts = {
|
||||
preset = "helix",
|
||||
icons = {
|
||||
mappings = false,
|
||||
},
|
||||
defaults = {},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{
|
||||
"<leader>b",
|
||||
group = "buffer",
|
||||
expand = function()
|
||||
return require("which-key.extras").expand.buf()
|
||||
end,
|
||||
},
|
||||
{ "<leader>b", group = "buffer" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>h", group = "history" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
{ "<leader><tab>", group = "tabs", hidden = true },
|
||||
{ "<leader>d", group = "debug", hidden = true },
|
||||
{ "<leader>dp", group = "profiler", hidden = true },
|
||||
{ "<leader>gh", group = "hunks", hidden = true },
|
||||
{ "<leader>q", group = "quit/session", hidden = true },
|
||||
{ "<leader>s", group = "search", hidden = true },
|
||||
{ "<leader>t", hidden = true },
|
||||
{ "<leader>w", hidden = true },
|
||||
{ "<leader>x", group = "diagnostics/quickfix", hidden = true },
|
||||
{ "gx", desc = "Open with system app", hidden = true },
|
||||
config = function()
|
||||
require("which-key").setup({
|
||||
preset = "helix",
|
||||
delay = 300,
|
||||
icons = {
|
||||
rules = false,
|
||||
breadcrumb = " ",
|
||||
separator = " ",
|
||||
group = " ",
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins = {
|
||||
spelling = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
win = {
|
||||
height = {
|
||||
max = math.huge,
|
||||
},
|
||||
},
|
||||
spec = {
|
||||
{
|
||||
mode = { "n", "v" },
|
||||
{ "[", group = "previous..." },
|
||||
{ "]", group = "next..." },
|
||||
{ "<leader>b", group = "buffer" },
|
||||
{ "<leader>c", group = "code" },
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>h", group = "history" },
|
||||
{ "<leader>u", group = "ui" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue