Last active
January 10, 2025 22:39
-
-
Save devyassineh/28acdc95563d4e8031939e6f66e2538b to your computer and use it in GitHub Desktop.
minimal setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ui | |
vim.o.laststatus = 0 | |
vim.o.cursorline = true | |
vim.o.confirm = true | |
vim.o.number = true | |
vim.o.relativenumber = true | |
vim.api.nvim_set_hl(0, "WinSeparator", {fg='NvimDarkGrey2'}) | |
-- completion | |
vim.o.completeopt = "menu,menuone,noinsert,popup,fuzzy" | |
vim.keymap.set("i", "<cr>", function() | |
if vim.fn.pumvisible() == 1 then return '<c-y>' end | |
return '<cr>' | |
end, { expr = true }) | |
vim.keymap.set("i", "<C-Space>", "<C-X><C-O>") | |
-- fold | |
vim.o.foldenable = false | |
vim.o.foldmethod = "expr" | |
vim.o.foldexpr = "v:lua.vim.lsp.foldexpr()" | |
-- lsp | |
vim.lsp.config['clangd'] = { | |
cmd = { 'clangd' }, | |
filetypes = { 'c', 'cpp' }, | |
root_markers = {}, | |
} | |
vim.lsp.enable('clangd') | |
vim.api.nvim_create_autocmd('LspAttach', { | |
callback = function(args) | |
local client = vim.lsp.get_client_by_id(args.data.client_id) | |
if client:supports_method('textDocument/completion') then | |
vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = true}) | |
end | |
end, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment