nvim-config/lua/custom/keymaps.lua
dlond 68f26dc50d Optimize Neovim configuration structure and LSP setup
- Remove duplicate nvim-web-devicons loading (already in kickstart)
- Add clangd configuration to custom LSP setup with proper flags
- Replace complex clangd_helper with universal LSP reload keybind (<leader>lr)
- Clean up unused clangd target selection keybind
- Streamline plugin organization for better maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 19:56:13 +12:00

26 lines
606 B
Lua

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
-- LSP reload function
local function reload_lsp()
local clients = vim.lsp.get_clients()
if #clients == 0 then
print('No LSP clients running')
return
end
for _, client in ipairs(clients) do
vim.lsp.stop_client(client.id)
end
vim.defer_fn(function()
vim.cmd('LspStart')
print('LSP servers reloaded')
end, 500)
end
-- Reload LSP keybind
vim.keymap.set('n', '<leader>lr', reload_lsp, { desc = '[L]SP [R]eload all servers' })
-- Standard practice for Lua modules that don't need to return complex data
return {}