1
Fork 0

Huge progress on korora-based tempest generation

This commit is contained in:
Matei Adriel 2023-12-25 14:14:33 +01:00
parent 63d980ddf9
commit 42cd073278
No known key found for this signature in database
8 changed files with 1678 additions and 1462 deletions
home/features/neovim/config/lua/my

View file

@ -55,92 +55,11 @@ end
-- }}}
function M.setup()
-- {{{ Free up q and Q
M.move("q", "yq", { desc = "Record macro" })
M.move("Q", "yQ")
-- }}}
-- {{{ Easier access to <C-^>
M.move("<C-^>", "<Leader>a", { desc = "[A]lternate file" })
-- }}}
-- {{{ Quit all buffers
M.nmap("Q", ":wqa<cr>", "Save all files and [q]uit")
-- }}}
-- {{{ Replace word in file
M.nmap("<leader>rw", ":%s/<C-r><C-w>/", "[R]eplace [w]ord in file")
-- }}}
-- {{{ Toggle settings
M.nmap(
"<leader>sw",
require("my.helpers.wrapMovement").toggle,
"toggle word [w]rap"
)
-- }}}
-- {{{ Text objects
M.delimitedTextobject("q", '"', "[q]uotes")
M.delimitedTextobject("a", "'", "[a]postrophes")
M.delimitedTextobject("r", "[", "squa[r]e brackets")
-- }}}
-- {{{Diagnostic keymaps
M.nmap("[d", vim.diagnostic.goto_prev, "Goto previous [d]iagnostic")
M.nmap("]d", vim.diagnostic.goto_next, "Goto next [d]iagnostic")
M.move("J", "qj")
M.nmap("J", vim.diagnostic.open_float, "Open current diagnostic")
M.nmap("<leader>D", vim.diagnostic.setloclist, "[D]iagnostic loclist")
-- }}}
-- {{{ Chords (save, clipboard)
-- Different chords get mapped to f keys by a custom script of mine.
-- In the future, I might get this on my keyboard firmware.
vim.keymap.set({ "i", "v" }, "<f10>", "<Esc>", { desc = "Exit insert mode" }) -- Exit inset mode using *jk*
vim.keymap.set({ "n", "v" }, "<f11>", '"+', { desc = "Use global clipboard" }) -- Use global clipboard with *cp*
M.nmap("<f12>", "<cmd>silent write<cr>", "Save current file", true) -- Save using *ji*
-- }}}
-- {{{ Shift-Enter for not continuing the current comment
-- This does not preserve intendation. Not sure what a better solution would look like.
vim.keymap.set("i", "<S-CR>", function()
vim.paste({ "", "" }, -1)
end, { desc = "Insert newline without continuing the current comment" })
-- }}}
-- {{{ Allow quiting basic buffers with "qq"
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help" },
group = vim.api.nvim_create_augroup("BasicBufferQuitting", {}),
callback = function(event)
vim.keymap.set(
"n",
"qq",
"<cmd>close<cr>",
{ buffer = event.buf, silent = true, desc = "[q]uit current buffer" }
)
end,
})
-- }}}
-- {{{ Winblend
vim.api.nvim_create_autocmd("FileType", {
pattern = { "*" },
group = vim.api.nvim_create_augroup("WinblendSettings", {}),
callback = function()
vim.opt.winblend = 0
end,
})
-- }}}
-- {{{ Manage cmdheight
vim.api.nvim_create_autocmd("CmdlineEnter", {
group = vim.api.nvim_create_augroup("SetCmdheightCmdlineEnter", {}),
callback = function()
if not vim.g.inside_venn then
vim.opt.cmdheight = 1
end
end,
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
group = vim.api.nvim_create_augroup("SetCmdheightCmdlineLeave", {}),
callback = function()
if not vim.g.inside_venn then
vim.opt.cmdheight = 0
end
end,
})
-- }}}
end
return M