i dont know|

This commit is contained in:
Robert Altner 2025-04-13 13:04:40 +02:00
parent 4f7e6068f3
commit 86bc70fb4a
No known key found for this signature in database
GPG key ID: 58794C52DAF9EAD8
3 changed files with 42 additions and 5 deletions

View file

@ -28,6 +28,7 @@ au ColorSchemePre kanagawa highlight! link RainbowDelimiterGreen MiniIconsGreen
au ColorSchemePre kanagawa highlight! link RainbowDelimiterViolet MiniIconsPurple au ColorSchemePre kanagawa highlight! link RainbowDelimiterViolet MiniIconsPurple
au ColorSchemePre kanagawa highlight! link RainbowDelimiterCyan MiniIconsCyan au ColorSchemePre kanagawa highlight! link RainbowDelimiterCyan MiniIconsCyan
au ColorScheme kanagawa highlight! LineNr guifg=#fcc35a au ColorScheme kanagawa highlight! LineNr guifg=#fcc35a
au ColorScheme kanagawa highlight! LspInlayHint guifg=#727296
"colorscheme tokyonight-storm "colorscheme tokyonight-storm

View file

@ -21,7 +21,8 @@ vim.opt.termguicolors = true
vim.filetype.add({ vim.filetype.add({
extension = { extension = {
pl = 'prolog' pl = 'prolog',
slint = 'slint'
} }
}) })
@ -46,6 +47,7 @@ vim.api.nvim_set_keymap("", "<UP>", "<NOP>", {})
vim.api.nvim_set_keymap("", "<DOWn>", "<NOP>", {}) vim.api.nvim_set_keymap("", "<DOWn>", "<NOP>", {})
vim.api.nvim_set_keymap("", "<LEFT>", "<NOP>", {}) vim.api.nvim_set_keymap("", "<LEFT>", "<NOP>", {})
vim.api.nvim_set_keymap("", "<RIGHT>", "<NOP>", {}) vim.api.nvim_set_keymap("", "<RIGHT>", "<NOP>", {})
vim.lsp.inlay_hint.enable()
require('goto-preview').setup { require('goto-preview').setup {
width = 120, -- Width of the floating window width = 120, -- Width of the floating window
@ -94,6 +96,9 @@ cmp.setup({
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered() documentation = cmp.config.window.bordered()
}, },
experimental = {
-- ghost_text = true
},
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
@ -101,19 +106,25 @@ cmp.setup({
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<TAB>'] = cmp.mapping(function(fallback) ['<TAB>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.confirm({ behaviour = cmp.ConfirmBehavior.Insert, select = true }) cmp.confirm({ behaviour = cmp.ConfirmBehavior.Replace, select = true })
elseif vim.fn["vsnip#available"](1) == 1 then elseif vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "") feedkey("<Plug>(vsnip-expand-or-jump)", "")
else else
fallback() fallback()
end end
end, { "i", "s" }) end, { "i", "s" }),
['<S-TAB>'] = cmp.mapping(function(fallback)
if vim.fn["vsnip#available"](1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, { "i", "s" })
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "vsnip" }, { name = "vsnip" },
{ name = "path" }
}, { }, {
{ name = "buffer" } { name = "file" }
}) })
}) })
@ -126,6 +137,21 @@ require("mason-lspconfig").setup_handlers {
require("lspconfig")[server_name].setup { require("lspconfig")[server_name].setup {
capabilities = capabilities capabilities = capabilities
} }
end,
["clangd"] = function()
require("lspconfig").clangd.setup {
capabilities = {
textDocument = {
completion = {
completionItem = {
snippetSupport = true
}
}
}
},
filetyped = { "c", "cpp", "cc", "h", "hpp", "hh" }
}
end end
} }
@ -236,6 +262,15 @@ vim.api.nvim_create_autocmd("TermClose", {
end end
}) })
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = buffer,
callback = function()
if vim.bo.filetype == "go" then
vim.lsp.buf.format { async = false }
end
end
})
require("ibl").setup() require("ibl").setup()
vim.g.barbar_auto_setup = false vim.g.barbar_auto_setup = false

View file

@ -20,11 +20,12 @@ map("n", "<leader>s", ":Telescope live_grep glob_pattern=*.{ts,html,c,cc,cpp,h,g
map("n", "<leader>sc", ":noh<CR>") map("n", "<leader>sc", ":noh<CR>")
-- map("n", "gs", ":call CocAction('jumpDefinition', 'split')<CR>") -- map("n", "gs", ":call CocAction('jumpDefinition', 'split')<CR>")
-- map("n", "gt", ":CocCommand clangd.switchSourceHeader<CR>") map("n", "gt", ":ClangdSwitchSourceHeader<CR>")
-- --
map("n", "p<C-]>", "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", {noremap=true}) map("n", "p<C-]>", "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", {noremap=true})
map("n", "q<C-]>", "<cmd>lua require('goto-preview').close_all_win()<CR>", {noremap=true}) map("n", "q<C-]>", "<cmd>lua require('goto-preview').close_all_win()<CR>", {noremap=true})
map("n", "r<C-]>", "<cmd>lua require('goto-preview').goto_preview_references()<CR>", {noremap=true}) map("n", "r<C-]>", "<cmd>lua require('goto-preview').goto_preview_references()<CR>", {noremap=true})
map("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", {noremap=true})
map("n", "<leader>1", "1gt") map("n", "<leader>1", "1gt")
map("n", "<leader>2", "2gt") map("n", "<leader>2", "2gt")