finished? please test
This commit is contained in:
parent
65cbba91ab
commit
bad5a2d0b8
3 changed files with 46 additions and 18 deletions
42
init.lua
42
init.lua
|
@ -471,7 +471,7 @@ require('lazy').setup({
|
|||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of it's *type*, not where it was *defined*.
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
|
@ -502,6 +502,21 @@ require('lazy').setup({
|
|||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -526,7 +541,6 @@ require('lazy').setup({
|
|||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
-- If you use something like typescript, where the tooling is as bad as the language,
|
||||
|
@ -568,7 +582,7 @@ require('lazy').setup({
|
|||
'stylua', -- Used to format lua code
|
||||
})
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
-- Ensure the servers and tools above are installed
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
-- :Mason
|
||||
|
@ -584,6 +598,9 @@ require('lazy').setup({
|
|||
cmd = server.cmd,
|
||||
settings = server.settings,
|
||||
filetypes = server.filetypes,
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||
capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}),
|
||||
}
|
||||
end,
|
||||
|
@ -611,18 +628,22 @@ require('lazy').setup({
|
|||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- Adds LSP completion capabilities
|
||||
-- Adds other completion capabilities.
|
||||
-- nvim-cmp does not ship with all sources by default. They are split
|
||||
-- into multiple repos for maintenance purposes.
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-path',
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
-- If you want to add a bunch of pre-configured snippets,
|
||||
-- you can use this plugin to help you. It even has snippets
|
||||
-- for various frameworks/libraries/etc. but you will have to
|
||||
-- set up the ones that are useful for you.
|
||||
-- 'rafamadriz/friendly-snippets',
|
||||
},
|
||||
config = function()
|
||||
-- See `:help cmp`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
|
@ -631,9 +652,8 @@ require('lazy').setup({
|
|||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert,noselect',
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
|
||||
-- For an understanding of why these mappings were
|
||||
-- chosen, you will need to read `:help ins-completion`
|
||||
--
|
||||
|
@ -771,7 +791,7 @@ require('lazy').setup({
|
|||
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
||||
-- put them in the right spots if you want.
|
||||
|
||||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "" for kickstart
|
||||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional plugins for kickstart
|
||||
-- These are some example plugins that I've included in the kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them.
|
||||
-- require 'kickstart.plugins.debug',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue