many small fixes and improvements, i think
This commit is contained in:
parent
31a6fc294d
commit
468195ab00
7 changed files with 53 additions and 57 deletions
|
|
@ -32,7 +32,7 @@ vim.filetype.add({
|
|||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
group = group,
|
||||
callback = function()
|
||||
if vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= nil and vim.bo.filetype ~= "" then
|
||||
if vim.bo.buftype ~= "terminal" and vim.bo.filetype ~= "TelescopePrompt" and vim.bo.filetype ~= nil and vim.bo.filetype ~= "" then
|
||||
vim.api.nvim_command("stopinsert")
|
||||
end
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ vim.opt.mouse = "a"
|
|||
vim.opt.updatetime = 250
|
||||
-- Decrease mapped sequence wait time
|
||||
-- Displays which-key popup sooner
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.timeoutlen = 250
|
||||
|
||||
-- line numbering, relative
|
||||
vim.opt.number = true
|
||||
|
|
@ -54,7 +54,6 @@ vim.opt.list = true
|
|||
vim.opt.listchars = { tab = "│ ", trail = "·", nbsp = "␣", eol = "↴" }
|
||||
|
||||
-- Search settings
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.incsearch = true
|
||||
|
||||
-- Preview substitutions live, as you type
|
||||
|
|
@ -71,6 +70,7 @@ vim.opt.splitright = true
|
|||
vim.opt.completeopt = "menu,menuone,noinsert"
|
||||
vim.diagnostic.config({
|
||||
float = { border = "single" },
|
||||
virtual_text = false,
|
||||
})
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ return {
|
|||
-- Scroll the documentation window [b]ack / [f]orward
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<esc>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.abort()
|
||||
|
|
|
|||
|
|
@ -159,9 +159,6 @@ return {
|
|||
vim.keymap.set("n", "m", api.marks.toggle, opts("Toggle Bookmark"))
|
||||
|
||||
vim.keymap.set("n", "<leader>c", api.fs.copy.absolute_path, opts("Copy Path to Clipboard"))
|
||||
|
||||
vim.keymap.set("n", "h", api.node.navigate.parent_close, opts("Close Directory"))
|
||||
|
||||
vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help"))
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ return {
|
|||
U.safeRequire("cmp_nvim_lsp", function(c)
|
||||
capabilities = vim.tbl_deep_extend("force", capabilities, c.default_capabilities())
|
||||
end)
|
||||
-- Export common capabilities to all servers via vim.lsp.config('*')
|
||||
vim.lsp.config('*', { capabilities = capabilities })
|
||||
local schemastore = require("schemastore")
|
||||
|
||||
-- TODO finish porting over lsp configs: https://github.com/RingOfStorms/nvim/blob/master/lua/plugins/lsp.lua
|
||||
|
|
@ -84,7 +86,6 @@ return {
|
|||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- Note that `rust-analyzer` is done via mrcjkb/rustaceanvim plugin above, do not register it here.
|
||||
lua_ls = {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
|
|
@ -133,26 +134,21 @@ return {
|
|||
-- },
|
||||
-- },
|
||||
gopls = {
|
||||
capabilities = capabilities,
|
||||
single_file_support = true,
|
||||
},
|
||||
nil_ls = { -- nix
|
||||
capabilities = capabilities,
|
||||
},
|
||||
ts_ls = {
|
||||
-- typescript/javascript
|
||||
capabilities = capabilities,
|
||||
implicitProjectConfiguration = {
|
||||
checkJs = true,
|
||||
},
|
||||
},
|
||||
svelte = {
|
||||
-- svelte
|
||||
capabilities = capabilities,
|
||||
},
|
||||
tailwindcss = {
|
||||
-- tailwind css
|
||||
capabilities = capabilities,
|
||||
-- https://www.tailwind-variants.org/docs/getting-started#intellisense-setup-optional
|
||||
tailwindCSS = {
|
||||
experimental = {
|
||||
|
|
@ -164,11 +160,9 @@ return {
|
|||
},
|
||||
cssls = {
|
||||
-- css
|
||||
capabilities = capabilities,
|
||||
},
|
||||
jsonls = {
|
||||
-- json
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = schemastore.json.schemas(),
|
||||
|
|
@ -178,19 +172,15 @@ return {
|
|||
},
|
||||
-- python
|
||||
pylsp = {
|
||||
capabilities = capabilities,
|
||||
},
|
||||
marksman = {
|
||||
-- markdown
|
||||
capabilities = capabilities,
|
||||
},
|
||||
taplo = {
|
||||
-- toml
|
||||
capabilities = capabilities,
|
||||
},
|
||||
yamlls = {
|
||||
-- yaml
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = schemastore.yaml.schemas(),
|
||||
|
|
@ -203,18 +193,32 @@ return {
|
|||
},
|
||||
lemminx = {
|
||||
-- xml
|
||||
capabilities = capabilities,
|
||||
},
|
||||
-- ocamllsp = {
|
||||
-- -- ocaml
|
||||
-- capabilities = capabilities,
|
||||
-- }
|
||||
}
|
||||
-- Remove new global default keymaps added by Nvim if you prefer your own bindings
|
||||
local global_unmaps = {
|
||||
{ mode = 'n', lhs = 'gra' },
|
||||
{ mode = 'n', lhs = 'gri' },
|
||||
{ mode = 'n', lhs = 'grn' },
|
||||
{ mode = 'n', lhs = 'grr' },
|
||||
{ mode = 'n', lhs = 'grt' },
|
||||
{ mode = 'n', lhs = 'gO' },
|
||||
{ mode = 'n', lhs = 'K' },
|
||||
{ mode = 'i', lhs = '<C-S>' },
|
||||
}
|
||||
for _, m in ipairs(global_unmaps) do
|
||||
pcall(vim.keymap.del, m.mode, m.lhs)
|
||||
end
|
||||
|
||||
if NIX then
|
||||
local lsp_servers = vim.tbl_keys(servers or {})
|
||||
for _, server_name in ipairs(lsp_servers) do
|
||||
local server_opts = servers[server_name] or {}
|
||||
vim.lsp.config[server_name] = server_opts
|
||||
vim.lsp.config(server_name, server_opts)
|
||||
vim.lsp.enable(server_name)
|
||||
end
|
||||
else
|
||||
|
|
@ -229,9 +233,8 @@ return {
|
|||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
server.capabilities =
|
||||
vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
vim.lsp.config[server_name] = server
|
||||
-- let vim.lsp.config('*') provide the base capabilities; do not reassign capabilities here
|
||||
vim.lsp.config(server_name, server)
|
||||
vim.lsp.enable(server_name)
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -45,13 +45,8 @@ return {
|
|||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
incremental_selection = { enable = true },
|
||||
ident = { enable = true },
|
||||
indent = { enable = true },
|
||||
autotag = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
}, nonNixOpts)
|
||||
end,
|
||||
config = function(_, opts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue