migrated even more stuff from after to plugins
This commit is contained in:
@@ -1 +0,0 @@
|
||||
require("barbecue").setup()
|
||||
@@ -1,62 +0,0 @@
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
local border = require('409.ui').border
|
||||
|
||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
local winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None"
|
||||
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "luasnip", keyword_length = 2 },
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
},
|
||||
view = {
|
||||
entries = "custom",
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menuone,noselect,preview",
|
||||
docs_initially_visible = true,
|
||||
},
|
||||
window = {
|
||||
documentation = {
|
||||
border = border,
|
||||
winhighlight = winhighlight,
|
||||
},
|
||||
completion = {
|
||||
border = border,
|
||||
winhighlight = winhighlight,
|
||||
},
|
||||
},
|
||||
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. (strings[1] or "") .. " "
|
||||
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||
|
||||
return kind
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
|
||||
["<C-k>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-j>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-g>"] = cmp.mapping.complete(),
|
||||
["<Tab>"] = nil,
|
||||
["<S-Tab>"] = nil,
|
||||
}),
|
||||
})
|
||||
@@ -1,25 +1,3 @@
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
c = { "clang_format" },
|
||||
cs = { "csharpier" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
rust = { "rustfmt" },
|
||||
dart = { "dart_format" }
|
||||
},
|
||||
})
|
||||
conform.setup()
|
||||
|
||||
conform.formatters.clang_format = {
|
||||
args = { "--style", "{IndentWidth: 4, UseTab: Always, TabWidth: 4}" },
|
||||
}
|
||||
|
||||
conform.formatters.rustfmt = {
|
||||
args = { "--edition", "2021" },
|
||||
}
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
if not conform.format({ bufnr = vim.lsp.bufnr }) then
|
||||
vim.lsp.buf.format()
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
require("flutter-tools").setup({})
|
||||
3
after/plugin/lsp.lua
Executable file → Normal file
3
after/plugin/lsp.lua
Executable file → Normal file
@@ -6,7 +6,7 @@ local lsp_default_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
local capabilities = vim.tbl_deep_extend("force", {}, lsp_default_capabilities, default_capabilities)
|
||||
|
||||
require("mason").setup({})
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "tsserver", "rust_analyzer" },
|
||||
handlers = {
|
||||
@@ -16,7 +16,6 @@ require("mason-lspconfig").setup({
|
||||
})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
|
||||
@@ -1,86 +1,3 @@
|
||||
local theme = function()
|
||||
local colors = {
|
||||
darkgray = "#181825",
|
||||
gray = "#cdd6f4",
|
||||
innerbg = nil,
|
||||
outerbg = "#313244",
|
||||
normal = "#89b4fa",
|
||||
insert = "#a6e3a1",
|
||||
visual = "#cdd6f4",
|
||||
replace = "#f38ba8",
|
||||
command = "#fab387",
|
||||
}
|
||||
return {
|
||||
inactive = {
|
||||
a = { fg = colors.gray, bg = colors.outerbg, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
visual = {
|
||||
a = { fg = colors.darkgray, bg = colors.visual, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
replace = {
|
||||
a = { fg = colors.darkgray, bg = colors.replace, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
normal = {
|
||||
a = { fg = colors.darkgray, bg = colors.normal, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
insert = {
|
||||
a = { fg = colors.darkgray, bg = colors.insert, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
command = {
|
||||
a = { fg = colors.darkgray, bg = colors.command, gui = "bold" },
|
||||
b = { fg = colors.gray, bg = colors.outerbg },
|
||||
c = { fg = colors.gray, bg = colors.innerbg },
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = theme(),
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = { 'packer' },
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
-- local todo = require('todo-comments')
|
||||
-- todo.setup()
|
||||
45
after/plugin/treesitter.lua
Executable file → Normal file
45
after/plugin/treesitter.lua
Executable file → Normal file
@@ -1,47 +1,2 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"c_sharp",
|
||||
"css",
|
||||
"gitcommit",
|
||||
"html",
|
||||
"svelte",
|
||||
"yaml",
|
||||
"astro",
|
||||
"toml",
|
||||
"jsdoc",
|
||||
"json",
|
||||
},
|
||||
|
||||
tree_docs = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
disable = { "yaml" },
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
local trouble = require('trouble')
|
||||
|
||||
vim.keymap.set('n', '<leader>tt', ':TodoTrouble<CR>')
|
||||
vim.keymap.set('n', '<leader>tv', function ()
|
||||
trouble.open()
|
||||
end)
|
||||
@@ -1 +0,0 @@
|
||||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
||||
Reference in New Issue
Block a user