CMD no longer aborts on ESC (was conflicting), added color scheme toggle <leader>m

This commit is contained in:
2025-03-18 22:46:04 +01:00
parent 1561c18d35
commit e3cf322fc9
2 changed files with 13 additions and 20 deletions

View File

@@ -29,7 +29,9 @@ cmp.setup({
['<PageUp>'] = cmp.mapping.scroll_docs(-4),
['<PageDown>'] = cmp.mapping.scroll_docs(4),
['<Esc>'] = cmp.mapping.abort(),
-- ESC messes with standard ESC mapping, don't use
-- ['<Esc>'] = cmp.mapping.abort(),
['<C-e>'] = cmp.mapping.abort(),
-- Use <CR>(Enter) to confirm selection
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
@@ -95,21 +97,3 @@ cmp.setup({
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})

View File

@@ -26,6 +26,15 @@ vim.keymap.set('n', '<leader>c', ":Calendar -split=horizontal -position=below -h
-- Open current file in browser (chromium)
vim.keymap.set('n', '<space>o', ":silent !chromium '%'<cr>", { desc = "Open in browser" })
-- toggle colorscheme between dark and light
vim.keymap.set('n', '<leader>m', function()
if vim.opt.background:get() == "dark" then
vim.o.background = "light"
else
vim.o.background = "dark"
end
end, { desc = "Toggle dark/light mode" })
--
-- configure workspaces
-- also add a custom picker to fzf
@@ -47,7 +56,7 @@ local workspaces_fzf_picker = function(opts)
for i = 1, #ws do
fzf_cb(ws[i].name)
end
fzf_cb() -- EOF
fzf_cb() -- EOF
end, opts)
end
vim.keymap.set('n', '<leader>w', workspaces_fzf_picker, { desc = "Workspaces" })