fix(nvim): cmp finally stopped jumping around

This commit is contained in:
Léana 江 2023-04-17 21:53:27 +02:00 committed by Léana 江
parent 859e77550e
commit d2c8493f28
10 changed files with 61 additions and 109 deletions

View file

@ -28,7 +28,7 @@ cmp.setup({
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()

View file

@ -1,71 +0,0 @@
vim.cmd.colorscheme "one-nvim"
local use_light = function()
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
-- LSP window border color
vim.cmd("highlight NormalFloat guibg=white")
vim.cmd("highlight FloatBorder guifg=black guibg=white")
-- Tune virtual text colors
-- vim.cmd ("highlight DiagnosticError gui=bold")
-- vim.cmd ("highlight DiagnosticWarn gui=italic")
-- vim.cmd ("highlight DiagnosticInfo guibg=black guibg=italic")
-- vim.cmd ("highlight DiagnosticHint guibg=black")
-- TreesitterContext border
vim.cmd("highlight TreesitterContext guibg=#EEEEEE")
vim.cmd("highlight TreesitterContextBottom guibg=#EEEEEE gui=underline guisp=Grey")
-- Diff colors override
vim.cmd("highlight DiffAdd guibg=#f0f0f0")
vim.cmd("highlight DiffChange guibg=#f0f0f0")
vim.cmd("highlight DiffDelete guibg=#f0f0f0")
vim.cmd("highlight DiffText guibg=#f0f0f0")
vim.cmd("highlight DiffAdded guibg=#f0f0f0")
vim.cmd("highlight DiffFile guibg=#f0f0f0")
vim.cmd("highlight DiffNewFile guibg=#f0f0f0")
vim.cmd("highlight DiffLine guibg=#f0f0f0")
vim.cmd("highlight DiffRemoved guibg=#f0f0f0")
end,
group = vim.api.nvim_create_augroup("MyColorOverride", { clear = true }),
pattern = "*",
})
vim.o.background = "light"
end
local use_dark = function()
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
-- LSP window border color
vim.cmd("highlight NormalFloat guibg=black")
vim.cmd("highlight FloatBorder guifg=white guibg=black")
-- Tune virtual text colors
-- vim.cmd "highlight DiagnosticError gui=bold"
-- vim.cmd "highlight DiagnosticWarn gui=italic"
-- vim.cmd "highlight DiagnosticInfo guifg=white guibg=black"
-- vim.cmd "highlight DiagnosticHint guifg=white guibg=black"
-- TreesitterContext border
vim.cmd("highlight TreesitterContext guibg=#555555")
vim.cmd("highlight TreesitterContextBottom guibg=#555555 gui=underline guisp=LightGrey")
-- Diff colors override
vim.cmd("highlight DiffAdd guibg=#303030")
vim.cmd("highlight DiffChange guibg=#303030")
vim.cmd("highlight DiffDelete guibg=#303030")
vim.cmd("highlight DiffText guibg=#303030")
vim.cmd("highlight DiffAdded guibg=#303030")
vim.cmd("highlight DiffFile guibg=#303030")
vim.cmd("highlight DiffNewFile guibg=#303030")
vim.cmd("highlight DiffLine guibg=#303030")
vim.cmd("highlight DiffRemoved guibg=#303030")
end,
group = vim.api.nvim_create_augroup("MyColorOverride", { clear = true }),
pattern = "*",
})
vim.o.background = "dark"
end
use_light()

View file

@ -1 +1,12 @@
require "colorizer".setup()
require "colorizer".setup {
scss = {
RGB = true,
RRGGBB = true,
names = true,
RRGGBBAA = true,
rgb_fn = true,
hsl_fn = true,
css = true,
css_fn = true,
}
}

View file

@ -121,6 +121,16 @@ require "lspconfig".rust_analyzer.setup {
on_attach = on_attach,
capabilities = capabilities,
}
-- Markdown
require "lspconfig".marksman.setup {
on_attach = on_attach,
capabilities = capabilities,
}
-- TOML
require "lspconfig".taplo.setup {
on_attach = on_attach,
capabilities = capabilities,
}
-- Scala
require "lspconfig".metals.setup {
on_attach = on_attach,
@ -147,14 +157,3 @@ require "lspconfig".html.setup {
capabilities = capabilities,
filetypes = { "html", "xhtml" },
}
-- DAP
local dap = require "dap"
vim.keymap.set("n", "<leader>dc", function() dap.continue() end)
vim.keymap.set("n", "<leader>dr", function() dap.repl.toggle() end)
vim.keymap.set("n", "<leader>dK", function() require "dap.ui.widgets".hover() end)
vim.keymap.set("n", "<leader>dt", function() dap.toggle_breakpoint() end)
vim.keymap.set("n", "<leader>dso", function() dap.step_over() end)
vim.keymap.set("n", "<leader>dsi", function() dap.step_into() end)
vim.keymap.set("n", "<leader>dl", function() dap.run_last() end)

View file

@ -28,7 +28,7 @@ require "lualine".setup({
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_c = { { 'filename', path = 2 } },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}

View file

@ -5,7 +5,7 @@ require "todo-comments".setup {
keywords = {
FIX = { icon = "", color = "error", alt = { "FIXME", "BUG", "FIXIT", "ISSUE" } },
TODO = { icon = "", color = "info" },
HACK = { icon = "!", color = "warning" },
HACK = { icon = "!", color = "warning", alt = { "DEBUG" } },
WARN = { icon = "!", color = "warning", alt = { "WARNING", "XXX" } },
NOTE = { icon = "·", color = "hint", alt = { "INFO" } },
TEST = { icon = "T", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },