mirror of
https://codeberg.org/qwjyh/dotfiles.git
synced 2025-06-26 19:29:20 +09:00
Merge branch 'main' of github.com:qwjyh/dotfiles
This commit is contained in:
commit
8be02e7554
4 changed files with 43 additions and 61 deletions
|
@ -125,14 +125,6 @@ require('lazy').setup({
|
|||
},
|
||||
{
|
||||
"andymass/vim-matchup",
|
||||
config = function()
|
||||
vim.g.matchup_matchparen_offscreen = { method = "popup" }
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
matchup = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
|
@ -196,29 +188,7 @@ require('lazy').setup({
|
|||
-- see Julian/lean.nvim readme
|
||||
opts = {
|
||||
lsp = {
|
||||
on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
--vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below function
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'g1', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'grf', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
end,
|
||||
on_attach = require("lsp_config").on_attach,
|
||||
},
|
||||
mappings = true,
|
||||
},
|
||||
|
@ -455,7 +425,7 @@ require('gitsigns').setup {
|
|||
---@param mode string|string[]
|
||||
---@param l string
|
||||
---@param r any
|
||||
---@param opts table?
|
||||
---@param opts vim.keymap.set.Opts?
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
|
@ -617,30 +587,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
|||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
--vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below function
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'gT', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'g1', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'grf', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
end
|
||||
local on_attach = require("lsp_config").on_attach
|
||||
|
||||
-- cmp_nvim_lsp supports additional LSP completion capabilities
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
@ -755,11 +702,7 @@ lspconfig.powershell_es.setup {
|
|||
bundle_path = vim.fn.has('win32') == 1 and win_pwsh_es_path or arch_pwsh_es_path,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
-- ccls
|
||||
-- -- csharp
|
||||
-- lspconfig.omnisharp.setup {
|
||||
-- cmd = {'omnisharp'},
|
||||
-- }
|
||||
|
||||
|
||||
lspconfig.tinymist.setup {
|
||||
on_attach = on_attach,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue