@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
9191vim .g .maplocalleader = ' '
9292
9393-- Set to true if you have a Nerd Font installed and selected in the terminal
94- vim .g .have_nerd_font = false
94+ vim .g .have_nerd_font = true
9595
9696-- [[ Setting options ]]
9797-- See `:help vim.opt`
@@ -616,7 +616,46 @@ require('lazy').setup({
616616 -- - settings (table): Override the default settings passed when initializing the server.
617617 -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
618618 local servers = {
619- -- clangd = {},
619+ clangd = {
620+ {
621+ ' clangd' ,
622+ ' --background-index' ,
623+ ' --clang-tidy' ,
624+ ' --header-insertion=iwyu' ,
625+ ' --completion-style=detailed' ,
626+ ' --function-arg-placeholders' ,
627+ ' --fallback-style=llvm' ,
628+ },
629+ init_options = {
630+ usePlaceholders = true ,
631+ completeUnimported = true ,
632+ clangdFileStatus = true ,
633+ },
634+ -- Configure clangd's capabilities
635+ capabilities = {
636+ offsetEncoding = { ' utf-16' },
637+ },
638+ -- Optional: Add custom on_attach function
639+ on_attach = function (client , bufnr )
640+ -- Enable completion triggered by <c-x><c-o>
641+ vim .api .nvim_buf_set_option (bufnr , ' omnifunc' , ' v:lua.vim.lsp.omnifunc' )
642+
643+ -- Key mappings
644+ local bufopts = { noremap = true , silent = true , buffer = bufnr }
645+ vim .keymap .set (' n' , ' gD' , vim .lsp .buf .declaration , bufopts )
646+ vim .keymap .set (' n' , ' gd' , vim .lsp .buf .definition , bufopts )
647+ vim .keymap .set (' n' , ' K' , vim .lsp .buf .hover , bufopts )
648+ vim .keymap .set (' n' , ' gi' , vim .lsp .buf .implementation , bufopts )
649+ vim .keymap .set (' n' , ' <C-k>' , vim .lsp .buf .signature_help , bufopts )
650+ vim .keymap .set (' n' , ' <space>D' , vim .lsp .buf .type_definition , bufopts )
651+ vim .keymap .set (' n' , ' <space>rn' , vim .lsp .buf .rename , bufopts )
652+ vim .keymap .set (' n' , ' <space>ca' , vim .lsp .buf .code_action , bufopts )
653+ vim .keymap .set (' n' , ' gr' , vim .lsp .buf .references , bufopts )
654+
655+ -- Set autoformat on save (optional)
656+ vim .cmd [[ autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]
657+ end ,
658+ },
620659 -- gopls = {},
621660 -- pyright = {},
622661 -- rust_analyzer = {},
@@ -849,7 +888,7 @@ require('lazy').setup({
849888 -- Load the colorscheme here.
850889 -- Like many other themes, this one has different styles, and you could load
851890 -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
852- vim .cmd .colorscheme ' tokyonight-night '
891+ vim .cmd .colorscheme ' blue '
853892
854893 -- You can configure highlights by doing something like:
855894 vim .cmd .hi ' Comment gui=none'
@@ -942,7 +981,7 @@ require('lazy').setup({
942981 -- This is the easiest way to modularize your config.
943982 --
944983 -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
945- -- { import = 'custom.plugins' },
984+ { import = ' custom.plugins' },
946985 --
947986 -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
948987 -- Or use telescope!
0 commit comments