This commit is contained in:
2024-06-02 01:17:37 +03:00
parent af1663315a
commit d2219b0ff1
7 changed files with 389 additions and 17 deletions

View File

@@ -0,0 +1,11 @@
return {
"norcalli/nvim-colorizer.lua",
lazy = true,
init = function()
local a = "#aaaa";
require("colorizer").setup()
end
}

View File

@@ -32,11 +32,14 @@ return {
-- ih.on_attach(client, bufnr)
end)
require('mason').setup({})
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('mason-lspconfig').setup({
ensure_installed = {},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({
capabilities = capabilities,
on_attach = function(client, bufnr)
ih.on_attach(client, bufnr)
end,
@@ -44,6 +47,33 @@ return {
end,
},
})
local cmp = require("cmp")
cmp.setup({
expand = function(args)
vim.snippet.expand(args.body)
end,
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-j>'] = cmp.mapping.scroll_docs(4),
['<Tab>'] = cmp.mapping.complete(),
['<Esc>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- require('lspconfig').clangd.setup({})
end

View File

@@ -0,0 +1,21 @@
return {
"nvim-treesitter/nvim-treesitter-context",
lazy=true,
init = function()
require('treesitter-context').setup{
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to show for a single context
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
zindex = 20, -- The Z-index of the context window
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
}
end
}

View File

@@ -32,9 +32,9 @@ return {
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
disable = { },
-- disable = { },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
disable = function(_, buf)
local max_filesize = 1024 * 1024 * 1-- 1 MB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then