Compare commits
2 Commits
2934dd2ed9
...
23914d9d09
| Author | SHA1 | Date |
|---|---|---|
|
|
23914d9d09 | |
|
|
659d8fb5d4 |
|
|
@ -1,5 +1,3 @@
|
||||||
--vim.keymap.set("", "<S-Tab>", "<C-d>", { remap = true })
|
|
||||||
|
|
||||||
-- Move by words
|
-- Move by words
|
||||||
vim.keymap.set("", "<C-j>", "b")
|
vim.keymap.set("", "<C-j>", "b")
|
||||||
vim.keymap.set("", "<C-l>", "e")
|
vim.keymap.set("", "<C-l>", "e")
|
||||||
|
|
@ -14,3 +12,23 @@ vim.keymap.set("", "<C-a>", "ggVG")
|
||||||
-- reselect visual selection after indentation
|
-- reselect visual selection after indentation
|
||||||
vim.keymap.set("v", "<", "< gv")
|
vim.keymap.set("v", "<", "< gv")
|
||||||
vim.keymap.set("v", ">", "> gv")
|
vim.keymap.set("v", ">", "> gv")
|
||||||
|
vim.keymap.set("", "<S-Tab>", "<C-o> <")
|
||||||
|
vim.keymap.set("v", "<Tab>", "> gv")
|
||||||
|
|
||||||
|
-- Line operations
|
||||||
|
-- -- duplicate line
|
||||||
|
vim.keymap.set("n", "<C-d>", "\"dyy \"dp")
|
||||||
|
|
||||||
|
-- -- swap lines
|
||||||
|
vim.keymap.set({ "i", "n" }, "<C-Up>", function()
|
||||||
|
if vim.fn.line(".") > 1 then
|
||||||
|
vim.cmd [[m-2]]
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
vim.keymap.set({ "i", "n" }, "<C-Down>", function()
|
||||||
|
if vim.fn.line(".") < vim.fn.line("$") then
|
||||||
|
vim.cmd [[m+1]]
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
--vim.keymap.set("v", "<C-Up>", )
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,19 @@ return {
|
||||||
require("mason-lspconfig").setup_handlers {
|
require("mason-lspconfig").setup_handlers {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require("lspconfig")[server_name].setup {
|
require("lspconfig")[server_name].setup {
|
||||||
capabilities = capabilites,
|
--capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
end,
|
||||||
|
["neocmake"] = function()
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
require("vim.lsp").set_log_level("TRACE")
|
||||||
|
require("lspconfig").neocmake.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
root_dir = function(fname)
|
||||||
|
return require("lspconfig").util.find_git_ancestor(fname)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -42,6 +53,7 @@ return {
|
||||||
"asm_lsp",
|
"asm_lsp",
|
||||||
"bashls",
|
"bashls",
|
||||||
"clangd",
|
"clangd",
|
||||||
|
"lua_ls",
|
||||||
"neocmake",
|
"neocmake",
|
||||||
"pyright",
|
"pyright",
|
||||||
},
|
},
|
||||||
|
|
@ -94,6 +106,7 @@ return {
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
if #cmp.get_entries() == 1 then
|
if #cmp.get_entries() == 1 then
|
||||||
|
|
@ -116,7 +129,10 @@ return {
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
end
|
end
|
||||||
|
|
||||||
end, { "i", "s", "c" }),
|
end, { "i", "s", "c" }),
|
||||||
["<CR>"] = cmp.mapping({
|
["<CR>"] = cmp.mapping({
|
||||||
i = function(fallback)
|
i = function(fallback)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,11 @@ return {
|
||||||
{
|
{
|
||||||
callback = function()
|
callback = function()
|
||||||
local colorizer = require("colorizer")
|
local colorizer = require("colorizer")
|
||||||
colorizer.attach_to_buffer(0, colorizer.get_buffer_options(0))
|
local options = nil
|
||||||
|
if colorizer.is_buffer_attached(0) then
|
||||||
|
options = colorizer.get_buffer_options(0)
|
||||||
|
end
|
||||||
|
colorizer.attach_to_buffer(0, options)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue