update lsp and color
This commit is contained in:
		@@ -6,11 +6,11 @@ local has_words_before = function()
 | 
			
		||||
  return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
 | 
			
		||||
end
 | 
			
		||||
cmp.setup({
 | 
			
		||||
  snippet = {
 | 
			
		||||
    expand = function(args)
 | 
			
		||||
      require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
 | 
			
		||||
    end,
 | 
			
		||||
  },
 | 
			
		||||
  --  snippet = {
 | 
			
		||||
  --    expand = function(args)
 | 
			
		||||
  --      require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
 | 
			
		||||
  --    end,
 | 
			
		||||
  --  },
 | 
			
		||||
  mapping = {
 | 
			
		||||
    ['<C-k>'] = cmp.mapping.select_prev_item(),
 | 
			
		||||
    ['<C-p>'] = cmp.mapping.select_prev_item(),
 | 
			
		||||
@@ -47,12 +47,10 @@ cmp.setup({
 | 
			
		||||
    end, { "i", "s" })
 | 
			
		||||
  },
 | 
			
		||||
  sources = cmp.config.sources({
 | 
			
		||||
    { name = 'path' },
 | 
			
		||||
    { name = 'buffer' },
 | 
			
		||||
    { name = 'nvim_lsp' },
 | 
			
		||||
    { name = 'nvim_lsp_signature_help' },
 | 
			
		||||
    --{ name = 'nvim_lua' },
 | 
			
		||||
    { name = 'buffer' },
 | 
			
		||||
    --{ name = 'luasnip' }, -- For luasnip users.
 | 
			
		||||
--    { name = 'path' },
 | 
			
		||||
  }),
 | 
			
		||||
  window = {
 | 
			
		||||
    completion = cmp.config.window.bordered(),
 | 
			
		||||
 
 | 
			
		||||
@@ -71,12 +71,15 @@ require("dapui").setup()
 | 
			
		||||
 | 
			
		||||
M.setup()
 | 
			
		||||
dap.listeners.after.event_initialized["dapui_config"] = function()
 | 
			
		||||
  print('dap event init')
 | 
			
		||||
  dapui.open()
 | 
			
		||||
end
 | 
			
		||||
dap.listeners.before.event_terminated["dapui_config"] = function()
 | 
			
		||||
  print('dap event terminate')
 | 
			
		||||
  dapui.close()
 | 
			
		||||
end
 | 
			
		||||
dap.listeners.before.event_exited["dapui_config"] = function()
 | 
			
		||||
  print('dap event exit')
 | 
			
		||||
  dapui.close()
 | 
			
		||||
end
 | 
			
		||||
return M
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,23 @@
 | 
			
		||||
require('mason').setup({
 | 
			
		||||
	ui = {
 | 
			
		||||
        icons = {
 | 
			
		||||
            package_installed = "✓",
 | 
			
		||||
            package_pending = "➜",
 | 
			
		||||
            package_uninstalled = "✗"
 | 
			
		||||
        }
 | 
			
		||||
  ui = {
 | 
			
		||||
    icons = {
 | 
			
		||||
      package_installed = "✓",
 | 
			
		||||
      package_pending = "➜",
 | 
			
		||||
      package_uninstalled = "✗"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
require('mason-lspconfig').setup({
 | 
			
		||||
	ensure_installed = {"tsserver"}
 | 
			
		||||
})
 | 
			
		||||
require('mason-lspconfig').setup({})
 | 
			
		||||
 | 
			
		||||
require'mason-tool-installer'.setup {
 | 
			
		||||
    ensure_installed = {
 | 
			
		||||
        { 'bash-language-server', auto_update = true },
 | 
			
		||||
        'lua-language-server',
 | 
			
		||||
        'vim-language-server',
 | 
			
		||||
        'stylua',
 | 
			
		||||
    },
 | 
			
		||||
    auto_update = false,
 | 
			
		||||
    run_on_start = true,
 | 
			
		||||
    start_delay = 3000
 | 
			
		||||
require 'mason-tool-installer'.setup {
 | 
			
		||||
  ensure_installed = {
 | 
			
		||||
    { 'bash-language-server', auto_update = true },
 | 
			
		||||
    'lua-language-server',
 | 
			
		||||
    'vim-language-server',
 | 
			
		||||
    'typescript-language-server',
 | 
			
		||||
    'stylua',
 | 
			
		||||
  },
 | 
			
		||||
  auto_update = false,
 | 
			
		||||
  run_on_start = true,
 | 
			
		||||
  start_delay = 3000
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
 | 
			
		||||
vim.cmd('hi CursorLine term=bold cterm=bold ctermbg=darkgrey')
 | 
			
		||||
 | 
			
		||||
vim.cmd.colorscheme "gruvbox"
 | 
			
		||||
vim.o.background="light"
 | 
			
		||||
vim.o.termguicolors=true
 | 
			
		||||
vim.cmd.colorscheme "catppuccin"
 | 
			
		||||
vim.o.background = "light"
 | 
			
		||||
vim.o.termguicolors = true
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
 | 
			
		||||
-- 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')
 | 
			
		||||
  --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 functions
 | 
			
		||||
@@ -105,6 +105,17 @@ require('mason-lspconfig').setup_handlers {
 | 
			
		||||
      settings = {}
 | 
			
		||||
    }
 | 
			
		||||
  end,
 | 
			
		||||
  ['tsserver'] = function()
 | 
			
		||||
    require('lspconfig')['tsserver'].setup {
 | 
			
		||||
      on_attach = on_attach,
 | 
			
		||||
      flags = lsp_flags,
 | 
			
		||||
      settings = {
 | 
			
		||||
        init_options = {
 | 
			
		||||
          host_info = 'neovim'
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  end,
 | 
			
		||||
  ['yamlls'] = function()
 | 
			
		||||
    require('lspconfig')["yamlls"].setup {
 | 
			
		||||
      on_attach = on_attach,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user