enable clang lsp
This commit is contained in:
parent
12589539b4
commit
4a0a2c1d4a
59
init.lua
59
init.lua
|
|
@ -222,6 +222,13 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.filetype.add {
|
||||||
|
extension = {
|
||||||
|
compute = 'hlsl',
|
||||||
|
hlsl = 'hlsl',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
|
|
@ -506,6 +513,8 @@ require('lazy').setup({
|
||||||
{ 'mason-org/mason.nvim', opts = {} },
|
{ 'mason-org/mason.nvim', opts = {} },
|
||||||
'mason-org/mason-lspconfig.nvim',
|
'mason-org/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
|
@ -593,8 +602,10 @@ require('lazy').setup({
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||||
|
|
||||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
-- create a .cpp file for .hpp file automatically
|
||||||
---@param client vim.lsp.Client
|
map('<leader>gh', '<cmd>LspClangdSwitchSourceHeader<cr>', '[G]oto [H]ader/Source')
|
||||||
|
|
||||||
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) @param client vim.lsp.Client
|
||||||
---@param method vim.lsp.protocol.Method
|
---@param method vim.lsp.protocol.Method
|
||||||
---@param bufnr? integer some lsp support methods only in specific files
|
---@param bufnr? integer some lsp support methods only in specific files
|
||||||
---@return boolean
|
---@return boolean
|
||||||
|
|
@ -692,7 +703,7 @@ require('lazy').setup({
|
||||||
-- - settings (table): Override the default settings passed when initializing the server.
|
-- - settings (table): Override the default settings passed when initializing the server.
|
||||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
|
|
@ -856,7 +867,16 @@ require('lazy').setup({
|
||||||
-- <c-k>: Toggle signature help
|
-- <c-k>: Toggle signature help
|
||||||
--
|
--
|
||||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
preset = 'default',
|
preset = 'none', -- Disable the preset to avoid conflicts
|
||||||
|
['<Tab>'] = { 'snippet_forward', 'fallback' },
|
||||||
|
['<S-Tab>'] = { 'snippet_backward', 'fallback' },
|
||||||
|
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||||
|
['<C-e>'] = { 'hide' },
|
||||||
|
['<C-y>'] = { 'select_and_accept' },
|
||||||
|
['<C-p>'] = { 'select_prev', 'fallback' },
|
||||||
|
['<C-n>'] = { 'select_next', 'fallback' },
|
||||||
|
['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
|
||||||
|
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
|
||||||
|
|
||||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
|
|
@ -897,6 +917,37 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
-- Optional dependency to make it work with blink.cmp
|
||||||
|
dependencies = { 'saghen/blink.cmp' },
|
||||||
|
config = function()
|
||||||
|
require('nvim-autopairs').setup {}
|
||||||
|
-- If you want it to automatically add brackets when accepting a function
|
||||||
|
-- in the completion menu, you can integrate it with your cmp:
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter-context',
|
||||||
|
opts = {
|
||||||
|
max_lines = 3, -- How many lines the window should span
|
||||||
|
min_window_height = 0,
|
||||||
|
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
|
||||||
|
mode = 'cursor', -- Line used to calculate context. Can be 'cursor' or 'topline'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'andymass/vim-matchup',
|
||||||
|
setup = function()
|
||||||
|
-- may set any options here
|
||||||
|
vim.g.matchup_matchparen_offscreen = { method = 'popup' }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{ -- You can easily change to a different colorscheme.
|
{ -- You can easily change to a different colorscheme.
|
||||||
-- Change the name of the colorscheme plugin below, and then
|
-- Change the name of the colorscheme plugin below, and then
|
||||||
-- change the command in the config to whatever the name of that colorscheme is.
|
-- change the command in the config to whatever the name of that colorscheme is.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue