chore: format everything with stylua and update
This commit is contained in:
parent
473d78494e
commit
e90763e223
22 changed files with 273 additions and 222 deletions
|
@ -1,25 +1,25 @@
|
|||
-- Setup nvim-cmp.
|
||||
local cmp = require 'cmp'
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
--vim.fn["vsnip#anonymous"](args.body)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = "nvim_lsp" },
|
||||
|
||||
-- For vsnip user.
|
||||
{ name = 'vsnip' },
|
||||
{ name = "vsnip" },
|
||||
|
||||
-- For luasnip user.
|
||||
-- { name = 'luasnip' },
|
||||
|
@ -27,8 +27,8 @@ cmp.setup({
|
|||
-- For ultisnips user.
|
||||
-- { name = 'ultisnips' },
|
||||
|
||||
{ name = 'buffer' },
|
||||
}
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Setup lsp.
|
||||
|
@ -36,4 +36,4 @@ metals_config = require("metals").bare_config
|
|||
metals_config.init_options.statusBarProvider = "on"
|
||||
metals_config.settings = { showImplicitArguments = true }
|
||||
metals_config.on_attach = on_attach
|
||||
metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
metals_config.capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
return {
|
||||
'crater2150/vim-theme-chroma',
|
||||
"crater2150/vim-theme-chroma",
|
||||
dev = true,
|
||||
lazy = false,
|
||||
branch = 'lush',
|
||||
branch = "lush",
|
||||
priority = 1000,
|
||||
config = function() vim.cmd.colorscheme("chroma") end
|
||||
config = function()
|
||||
vim.cmd.colorscheme("chroma")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -8,62 +8,64 @@ return {
|
|||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
-- 'hrsh7th/cmp-vsnip',
|
||||
-- 'hrsh7th/vim-vsnip',
|
||||
-- 'hrsh7th/vim-vsnip-integ',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'onsails/lspkind.nvim',
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind.nvim",
|
||||
{
|
||||
'zbirenbaum/copilot-cmp',
|
||||
dependencies = { "hrsh7th/nvim-cmp",
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
{
|
||||
'zbirenbaum/copilot.lua',
|
||||
"zbirenbaum/copilot.lua",
|
||||
opts = {
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
filetypes = {
|
||||
mail = false,
|
||||
text = false,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local lspkind = require('lspkind')
|
||||
local luasnip = require('luasnip')
|
||||
local cmp = require("cmp")
|
||||
local lspkind = require("lspkind")
|
||||
local luasnip = require("luasnip")
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
return col ~= 0
|
||||
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
--vim.fn["vsnip#anonymous"](args.body)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-CR>'] = cmp.mapping.confirm({
|
||||
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<CR>"] = cmp.mapping({
|
||||
["<C-CR>"] = cmp.mapping({
|
||||
i = function(fallback)
|
||||
if cmp.visible() and cmp.get_active_entry() then
|
||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
|
||||
|
@ -98,20 +100,20 @@ return {
|
|||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot" },
|
||||
}, {
|
||||
{ name = 'buffer', option = { keyword_pattern = [[\k\+]] } },
|
||||
{ name = "buffer", option = { keyword_pattern = [[\k\+]] } },
|
||||
--{ name = 'path' },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol_text', -- show only symbol annotations
|
||||
mode = "symbol_text", -- show only symbol annotations
|
||||
maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
ellipsis_char = '…', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
ellipsis_char = "…", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
symbol_map = { Copilot = "" },
|
||||
})
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
|
@ -1,17 +1,29 @@
|
|||
return {
|
||||
'ryicoh/deepl.vim',
|
||||
"ryicoh/deepl.vim",
|
||||
keys = {
|
||||
{ '<leader><C-e>', function() vim.fn['deepl#v']("EN") end, mode = 'v' },
|
||||
{ '<leader><C-d>', function() vim.fn['deepl#v']("DE") end, mode = 'v' },
|
||||
{
|
||||
"<leader><C-e>",
|
||||
function()
|
||||
vim.fn["deepl#v"]("EN")
|
||||
end,
|
||||
mode = "v",
|
||||
},
|
||||
{
|
||||
"<leader><C-d>",
|
||||
function()
|
||||
vim.fn["deepl#v"]("DE")
|
||||
end,
|
||||
mode = "v",
|
||||
},
|
||||
},
|
||||
dependencies = { {
|
||||
'tsuyoshicho/vim-pass',
|
||||
"tsuyoshicho/vim-pass",
|
||||
init = function()
|
||||
vim.g.pass_use_agent = 1
|
||||
end
|
||||
end,
|
||||
} },
|
||||
config = function()
|
||||
vim.g['deepl#endpoint'] = "https://api-free.deepl.com/v2/translate"
|
||||
vim.g['deepl#auth_key'] = vim.fn['pass#get']('web/deepl.com', 'apikey')
|
||||
end
|
||||
vim.g["deepl#endpoint"] = "https://api-free.deepl.com/v2/translate"
|
||||
vim.g["deepl#auth_key"] = vim.fn["pass#get"]("web/deepl.com", "apikey")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"ledger/vim-ledger",
|
||||
ft = "ledger",
|
||||
},
|
||||
{
|
||||
"nfnty/vim-nftables",
|
||||
ft = "nftables",
|
||||
},
|
||||
{
|
||||
"jvirtanen/vim-hocon",
|
||||
ft = "hocon",
|
||||
},
|
||||
{ "ledger/vim-ledger", ft = "ledger" },
|
||||
{ "nfnty/vim-nftables", ft = "nftables" },
|
||||
{ "jvirtanen/vim-hocon", ft = "hocon" },
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
return { 'tpope/vim-fugitive' }
|
||||
return { "tpope/vim-fugitive" }
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
return {
|
||||
'lambdalisue/gina.vim',
|
||||
'gisphm/vim-gitignore',
|
||||
'sjl/splice.vim',
|
||||
"lambdalisue/gina.vim",
|
||||
"gisphm/vim-gitignore",
|
||||
"sjl/splice.vim",
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = {
|
||||
signs = {
|
||||
add = { text = '▌' },
|
||||
change = { text = '▐' },
|
||||
add = { text = "▌" },
|
||||
change = { text = "▐" },
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
return {
|
||||
"lewis6991/hover.nvim",
|
||||
config = function()
|
||||
require("hover").setup {
|
||||
require("hover").setup({
|
||||
init = function()
|
||||
require("hover.providers.lsp")
|
||||
require('hover.providers.gh')
|
||||
require('hover.providers.man')
|
||||
require("hover.providers.gh")
|
||||
require("hover.providers.man")
|
||||
end,
|
||||
preview_opts = {
|
||||
border = nil
|
||||
border = nil,
|
||||
},
|
||||
-- Whether the contents of a currently open hover window should be moved
|
||||
-- to a :h preview-window when pressing the hover keymap.
|
||||
preview_window = false,
|
||||
title = true
|
||||
}
|
||||
title = true,
|
||||
})
|
||||
|
||||
-- Setup keymaps
|
||||
vim.keymap.set("n", "K", require("hover").hover, { desc = "hover.nvim" })
|
||||
vim.keymap.set("n", "gK", require("hover").hover_select, { desc = "hover.nvim (select)" })
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -176,5 +176,5 @@ return {
|
|||
end
|
||||
end,
|
||||
},
|
||||
'mfussenegger/nvim-jdtls',
|
||||
"mfussenegger/nvim-jdtls",
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
return {
|
||||
'euclio/vim-markdown-composer',
|
||||
build = 'cargo build --release',
|
||||
enabled = function() return vim.fn.executable("cargo") end
|
||||
"euclio/vim-markdown-composer",
|
||||
build = "cargo build --release",
|
||||
enabled = function()
|
||||
return vim.fn.executable("cargo")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,74 +1,77 @@
|
|||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = {
|
||||
{ 'kyazdani42/nvim-web-devicons', lazy = true },
|
||||
'crater2150/vim-theme-chroma',
|
||||
{ "kyazdani42/nvim-web-devicons", lazy = true },
|
||||
"crater2150/vim-theme-chroma",
|
||||
{
|
||||
'linrongbin16/lsp-progress.nvim',
|
||||
"linrongbin16/lsp-progress.nvim",
|
||||
config = function()
|
||||
require('lsp-progress').setup()
|
||||
end
|
||||
require("lsp-progress").setup()
|
||||
end,
|
||||
},
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
return {
|
||||
options = {
|
||||
theme = require('chroma-theme.lualine')
|
||||
theme = require("chroma-theme.lualine"),
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = { 'branch' },
|
||||
lualine_a = { "branch" },
|
||||
lualine_b = {},
|
||||
lualine_c = { { 'buffers', show_filename_only = false, symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁" }, } },
|
||||
lualine_c = {
|
||||
{
|
||||
"buffers",
|
||||
show_filename_only = false,
|
||||
symbols = { modified = " ✏️]", alternate_file = " 🔃", folder = " 📁" },
|
||||
},
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {
|
||||
{
|
||||
'tabs',
|
||||
"tabs",
|
||||
mode = 1,
|
||||
fmt = function(name, context)
|
||||
local buflist = vim.fn.tabpagebuflist(context.tabnr)
|
||||
local mod = not vim.tbl_isempty(vim.tbl_filter(
|
||||
function(bufnr)
|
||||
return vim.fn.getbufvar(bufnr, '&mod') ==
|
||||
1
|
||||
end,
|
||||
buflist))
|
||||
local mod = not vim.tbl_isempty(vim.tbl_filter(function(bufnr)
|
||||
return vim.fn.getbufvar(bufnr, "&mod") == 1
|
||||
end, buflist))
|
||||
|
||||
local wincount = #vim.tbl_filter(
|
||||
function(i) return i == 'leaf' end,
|
||||
vim.tbl_flatten(vim.fn.winlayout(context.tabnr))
|
||||
)
|
||||
local wincount = #vim.tbl_filter(function(i)
|
||||
return i == "leaf"
|
||||
end, vim.tbl_flatten(vim.fn.winlayout(context.tabnr)))
|
||||
|
||||
return name ..
|
||||
(wincount > 1 and ' +' .. (wincount - 1) or '') ..
|
||||
(mod and ' [✏️]]' or '')
|
||||
end
|
||||
} }
|
||||
return name
|
||||
.. (wincount > 1 and " +" .. (wincount - 1) or "")
|
||||
.. (mod and " [✏️]]" or "")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'filename' },
|
||||
lualine_b = { 'diff', 'diagnostics' },
|
||||
lualine_a = { "filename" },
|
||||
lualine_b = { "diff", "diagnostics" },
|
||||
lualine_x = {
|
||||
function()
|
||||
-- invoke `progress` here.
|
||||
return require('lsp-progress').progress()
|
||||
end
|
||||
return require("lsp-progress").progress()
|
||||
end,
|
||||
},
|
||||
lualine_y = { 'filetype' },
|
||||
lualine_z = { 'searchcount', 'selectioncount', 'location' }
|
||||
lualine_y = { "filetype" },
|
||||
lualine_z = { "searchcount", "selectioncount", "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
lualine_z = {},
|
||||
},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
extensions = {},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue