lunarvim cmp keybind redesign

This commit is contained in:
Daniel Yrovas 2022-03-26 00:57:49 +11:00
parent 19d10b7c90
commit 8c1ff008e5
Signed by: danielyrovas
GPG key ID: C181BAC70BDE7C00
2 changed files with 77 additions and 3 deletions

View file

@ -5,16 +5,35 @@ lvim.format_on_save = true
lvim.builtin.alpha.mode = "startify"
lvim.builtin.nvimtree.show_icons.git = 1
local o = vim.opt
o.timeoutlen = 300
o.shell = "/bin/sh"
-- Keymappings
local delete = function () end
lvim.leader = "space"
local delete = function () end
local cmp_status_ok, cmp = pcall (require, 'cmp')
if cmp_status_ok then
lvim.builtin.cmp.formatting.kind_icons.Method = "m "
lvim.builtin.cmp.formatting.kind_icons.Module = ""
lvim.builtin.cmp.formatting.kind_icons.Variable = ""
lvim.builtin.cmp.formatting.kind_icons.Constant = ""
lvim.builtin.cmp.formatting.kind_icons.Interface = ""
lvim.builtin.cmp.formatting.kind_icons.Field = ""
lvim.builtin.cmp.mapping["<C-Space>"] = delete()
lvim.builtin.cmp.mapping["<C-k>"] = delete()
lvim.builtin.cmp.mapping["<C-j>"] = delete()
lvim.builtin.cmp.mapping["<Tab>"] = delete()
lvim.builtin.cmp.mapping["<S-Tab>"] = delete()
lvim.builtin.cmp.mapping["<CR>"] = delete()
lvim.builtin.cmp.mapping["<C-y>"] = cmp.mapping.confirm { select = true}
lvim.builtin.cmp.mapping["<C-d>"] = delete()
lvim.builtin.cmp.mapping["<C-b>"] = cmp.mapping.scroll_docs(-4)
end
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
lvim.builtin.cmp.mapping["<C-Space>"] = delete()
lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
lvim.builtin.which_key.mappings["t"] = {
@ -52,9 +71,13 @@ lvim.builtin.terminal.active = true
lvim.builtin.dap.active = true
lvim.plugins = {
{ "folke/tokyonight.nvim", },
{ "folke/tokyonight.nvim",
config = function()
vim.cmd[[colorscheme tokyonight]]
end, },
{ "nvim-neorg/neorg", config = req "conf.neorg", },
{ "folke/trouble.nvim", cmd = "TroubleToggle", },
}
require "conf.luasnip"
require "conf.dap"

View file

@ -0,0 +1,51 @@
local status_ok, dap = pcall(require, 'dap')
if not status_ok then
return
end
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed
name = "lldb"
}
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
-- 💀
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
runInTerminal = false,
-- 💀
-- If you use `runInTerminal = true` and resize the terminal window,
-- lldb-vscode will receive a `SIGWINCH` signal which can cause problems
-- To avoid that uncomment the following option
-- See https://github.com/mfussenegger/nvim-dap/issues/236#issuecomment-1066306073
postRunCommands = {'process handle -p true -s false -n false SIGWINCH'}
},
}
-- If you want to use this for rust and c, add something like this:
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp