1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 11:24:55 +02:00

nvim: formatting

This commit is contained in:
Henrik Hautakoski 2024-09-01 14:38:06 +02:00
parent b46a37b4b2
commit 1da358dff8
8 changed files with 163 additions and 165 deletions

View file

@ -121,7 +121,7 @@ local options = {
["@lsp.type.property"] = { link = "@variable" },
-- Bash
["@variable.parameter.bash"] = { fg=colors.rosewater },
["@variable.parameter.bash"] = { fg = colors.rosewater },
-- Makefile
["@function.make"] = { link = "Keyword" },

View file

@ -1,36 +1,36 @@
return {
"echasnovski/mini.bufremove",
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
},
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {
debounce = 10,
indent = {
char = "",
},
scope = {
enabled = false,
},
exclude = {
filetypes = {
"help",
"dashboard",
},
},
},
config = function(_, opts)
require("ibl").setup(opts)
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {
debounce = 10,
indent = {
char = "",
},
scope = {
enabled = false,
},
exclude = {
filetypes = {
"help",
"dashboard",
},
},
},
config = function(_, opts)
require("ibl").setup(opts)
local hooks = require("ibl.hooks")
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
end,
},
local hooks = require("ibl.hooks")
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
end,
},
-- Better folds
{
'kevinhwang91/nvim-ufo',

View file

@ -1,93 +1,93 @@
return {
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- autocomplete from buffer
"hrsh7th/cmp-path", -- autocomplete from filesystem
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- autocomplete from buffer
"hrsh7th/cmp-path", -- autocomplete from filesystem
"f3fora/cmp-spell",
},
opts = function()
local cmp = require("cmp")
local utils = require("user.utils.cmp")
},
opts = function()
local cmp = require("cmp")
local utils = require("user.utils.cmp")
local format = require("user.utils.cmp_format")
-- local lspkind = require("user.utils.lspkind")
local icons = require("user.icons")
-- local lspkind = require("user.utils.lspkind")
local icons = require("user.icons")
local selectPrev = utils.selectPrev({ behavior = cmp.SelectBehavior.Insert })
local selectNext = utils.selectNext({ behavior = cmp.SelectBehavior.Insert })
local selectPrev = utils.selectPrev({ behavior = cmp.SelectBehavior.Insert })
local selectNext = utils.selectNext({ behavior = cmp.SelectBehavior.Insert })
return {
preselect = false,
completion = {
completeopt = "menu,menuone,longest,popup",
},
view = {
entries = { name = "custom", selection_order = "near_cursor" },
},
window = {
documentation = {
border = { "", "", "", "", "", "", "", " " },
},
completion = {
scrolloff = 4,
},
},
mapping = {
["<Up>"] = selectPrev,
["<S-Tab>"] = selectPrev,
["<Down>"] = selectNext,
["<Tab>"] = selectNext,
["<C-c>"] = cmp.mapping.abort(),
["<CR>"] = utils.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
},
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
formatting = {
fields = { "abbr", "kind", "menu" },
format = format({
symbol_map = icons.symbols,
return {
preselect = false,
completion = {
completeopt = "menu,menuone,longest,popup",
},
view = {
entries = { name = "custom", selection_order = "near_cursor" },
},
window = {
documentation = {
border = { "", "", "", "", "", "", "", " " },
},
completion = {
scrolloff = 4,
},
},
mapping = {
["<Up>"] = selectPrev,
["<S-Tab>"] = selectPrev,
["<Down>"] = selectNext,
["<Tab>"] = selectNext,
["<C-c>"] = cmp.mapping.abort(),
["<CR>"] = utils.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
},
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
formatting = {
fields = { "abbr", "kind", "menu" },
format = format({
symbol_map = icons.symbols,
widths = {
menu = 0,
}
}),
},
sources = {
{ name = "nvim_lsp" },
}),
},
sources = {
{ name = "nvim_lsp" },
{ name = 'nvim_lsp_signature_help' },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{
name = "spell",
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
{
name = "spell",
keyword_length = 3,
option = {
keep_all_entries = false,
enable_in_context = function()
return require('cmp.config.context').in_treesitter_capture('spell')
end,
preselect_correct_word = true,
},
},
},
-- experimental = {
-- ghost_text = {
-- hl_group = "NonText",
-- },
-- },
}
end,
config = function(_, opts)
local cmp = require("cmp")
cmp.setup(opts)
option = {
keep_all_entries = false,
enable_in_context = function()
return require('cmp.config.context').in_treesitter_capture('spell')
end,
preselect_correct_word = true,
},
},
},
-- experimental = {
-- ghost_text = {
-- hl_group = "NonText",
-- },
-- },
}
end,
config = function(_, opts)
local cmp = require("cmp")
cmp.setup(opts)
-- insert () on function completion using autopairs
local has_autopair, autopair = pcall(require, "nvim-autopairs.completion.cmp")
if has_autopair then
cmp.event:on("confirm_done", autopair.on_confirm_done())
end
end,
-- insert () on function completion using autopairs
local has_autopair, autopair = pcall(require, "nvim-autopairs.completion.cmp")
if has_autopair then
cmp.event:on("confirm_done", autopair.on_confirm_done())
end
end,
}

View file

@ -53,7 +53,6 @@ return {
local augroup = vim.api.nvim_create_augroup("Lsp", {})
for name, server_opts in pairs(opts.servers) do
local on_attach = function(_, bufnr)
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })