adjusted netrw; fixed ctrl+l in netrw
This commit is contained in:
@@ -7,9 +7,11 @@ function Color(color)
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" })
|
||||
-- If Vim thinks StatusLine and StatusLineNC are the same it overrides these settings
|
||||
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = "#ff0000", bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "EndOfBuffer", { fg = "none", bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = 0, bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "CursorLine", { link = "Visual" })
|
||||
vim.api.nvim_set_hl(0, "Pmenu", { link = "Normal" })
|
||||
vim.api.nvim_set_hl(0, "PmenuSel", { link = "Visual" })
|
||||
vim.api.nvim_set_hl(0, "PmenuSbar", { link = "Normal" })
|
||||
end
|
||||
|
||||
Color()
|
||||
-- #1E1E2E
|
||||
|
||||
@@ -4,26 +4,49 @@ lsp.preset("recommended")
|
||||
|
||||
require('mason').setup({})
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {'tsserver', 'rust_analyzer', 'lua_ls'},
|
||||
handlers = {
|
||||
lsp.default_setup
|
||||
}
|
||||
ensure_installed = { 'tsserver', 'rust_analyzer' },
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
lua_ls = function()
|
||||
local lua_opts = lsp.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
end
|
||||
}
|
||||
})
|
||||
|
||||
require('lspconfig').yamlls.setup {
|
||||
require('lspconfig').yamlls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.resolved_capabilities.document_formatting = true
|
||||
end,
|
||||
settings = {
|
||||
yaml = {
|
||||
customTags = { "!enemy", "!delay", "!composite" },
|
||||
validate = false,
|
||||
format = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
require('lspconfig').tsserver.setup {
|
||||
settings = {
|
||||
typescript = {
|
||||
preferences = {
|
||||
quoteStype = 'single'
|
||||
}
|
||||
},
|
||||
javascript = {
|
||||
preferences = {
|
||||
quoteStyle = 'single'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local cmp = require('cmp')
|
||||
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
})
|
||||
|
||||
@@ -31,47 +54,50 @@ cmp_mappings['<Tab>'] = nil
|
||||
cmp_mappings['<S-Tab>'] = nil
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered()
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<Tab>'] = nil,
|
||||
['<S-Tab>'] = nil
|
||||
})
|
||||
sources = {
|
||||
{ name = 'path' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'luasnip', keyword_length = 2 },
|
||||
{ name = 'buffer', keyword_length = 3 },
|
||||
},
|
||||
formatting = lsp.cmp_format(),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<Tab>'] = nil,
|
||||
['<S-Tab>'] = nil
|
||||
}),
|
||||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
hint = 'H',
|
||||
info = 'I'
|
||||
}
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
hint = 'H',
|
||||
info = 'I'
|
||||
}
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
lsp.setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true
|
||||
virtual_text = true
|
||||
})
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query" },
|
||||
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query", "c_sharp", "css", "gitcommit", "html", "svelte", "yaml", "astro", "toml", "jsdoc", "json" },
|
||||
|
||||
tree_docs = {
|
||||
enable = true
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
Reference in New Issue
Block a user