changed highlights and plugins (adding mini)
This commit is contained in:
31
lua/lsp.lua
31
lua/lsp.lua
@@ -1,4 +1,4 @@
|
||||
vim.lsp.enable({ "lua_ls", "denols" })
|
||||
vim.lsp.enable({ "lua_ls", "denols", "svelte" })
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
@@ -42,10 +42,29 @@ vim.lsp.config("lua_ls", {
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(ev)
|
||||
local client = assert(vim.lsp.get_client_by_id(ev.data.client_id))
|
||||
if client:supports_method "textDocument/completion" then
|
||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||
end
|
||||
callback = function(event)
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("my.lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "InsertLeave" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "InsertEnter" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("my.lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds {
|
||||
group = highlight_augroup,
|
||||
buffer = event2.buf,
|
||||
}
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
@@ -1,13 +1,82 @@
|
||||
vim.pack.add {
|
||||
"https://github.com/NMAC427/guess-indent.nvim",
|
||||
"https://github.com/hiphish/rainbow-delimiters.nvim",
|
||||
vim.pack.add({
|
||||
"https://github.com/nvim-treesitter/nvim-treesitter",
|
||||
"https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"https://github.com/neovim/nvim-lspconfig",
|
||||
"https://github.com/folke/tokyonight.nvim",
|
||||
"https://github.com/echasnovski/mini.pick",
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
|
||||
-- functional
|
||||
"https://github.com/NMAC427/guess-indent.nvim",
|
||||
"https://github.com/folke/trouble.nvim",
|
||||
"https://github.com/stevearc/oil.nvim",
|
||||
}
|
||||
|
||||
-- visual
|
||||
"https://github.com/hiphish/rainbow-delimiters.nvim",
|
||||
"https://github.com/folke/todo-comments.nvim",
|
||||
"https://github.com/folke/tokyonight.nvim",
|
||||
|
||||
-- mini
|
||||
"https://github.com/echasnovski/mini.pick",
|
||||
"https://github.com/echasnovski/mini.bracketed",
|
||||
"https://github.com/echasnovski/mini.surround",
|
||||
"https://github.com/echasnovski/mini.clue",
|
||||
"https://github.com/echasnovski/mini.move",
|
||||
"https://github.com/echasnovski/mini.ai",
|
||||
})
|
||||
|
||||
require "guess-indent".setup {}
|
||||
require "oil".setup {}
|
||||
|
||||
require "todo-comments".setup {}
|
||||
|
||||
require "mini.bracketed".setup {}
|
||||
require "mini.surround".setup {}
|
||||
require "mini.move".setup {}
|
||||
require "mini.ai".setup {}
|
||||
|
||||
local miniclue = require "mini.clue"
|
||||
miniclue.setup({
|
||||
triggers = {
|
||||
-- Leader triggers
|
||||
-- { mode = "n", keys = "<Leader>" },
|
||||
-- { mode = "x", keys = "<Leader>" },
|
||||
|
||||
-- Built-in completion
|
||||
{ mode = "i", keys = "<C-x>" },
|
||||
|
||||
-- `g` key
|
||||
-- { mode = "n", keys = "g" },
|
||||
-- { mode = "x", keys = "g" },
|
||||
|
||||
-- Marks
|
||||
{ mode = "n", keys = "'" },
|
||||
{ mode = "n", keys = "`" },
|
||||
{ mode = "x", keys = "'" },
|
||||
{ mode = "x", keys = "`" },
|
||||
|
||||
-- Registers
|
||||
{ mode = "n", keys = '"' },
|
||||
{ mode = "n", keys = "@" },
|
||||
{ mode = "x", keys = '"' },
|
||||
{ mode = "i", keys = "<C-r>" },
|
||||
{ mode = "c", keys = "<C-r>" },
|
||||
|
||||
-- Window commands
|
||||
{ mode = "n", keys = "<C-w>" },
|
||||
|
||||
-- `z` key
|
||||
-- { mode = "n", keys = "z" },
|
||||
-- { mode = "x", keys = "z" },
|
||||
},
|
||||
|
||||
clues = {
|
||||
miniclue.gen_clues.builtin_completion(),
|
||||
-- miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers({ show_contents = true }),
|
||||
miniclue.gen_clues.windows({ submode_resize = true }),
|
||||
-- miniclue.gen_clues.z(),
|
||||
},
|
||||
|
||||
window = {
|
||||
delay = 200,
|
||||
},
|
||||
})
|
||||
|
@@ -1,5 +1,5 @@
|
||||
require "nvim-treesitter.configs".setup {
|
||||
ensure_installed = { "c", "bash", "lua", "luadoc", "vim", "vimdoc", "diff", "html", "javascript", "markdown" },
|
||||
ensure_installed = { "c", "bash", "lua", "luadoc", "vim", "vimdoc", "diff", "html", "javascript", "typescript", "svelte", "markdown" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
Reference in New Issue
Block a user