Fp abbreviations, kicad and nvim keymap docs
This commit is contained in:
parent
1ed61054f7
commit
eaebbca5b3
17 changed files with 351 additions and 237 deletions
dotfiles/neovim/lua/my
|
@ -48,18 +48,7 @@ function M.setup()
|
|||
-- {{{ Easier access to <C-^>
|
||||
M.move("<C-^>", "<Leader>a", { desc = "[A]lternate file" })
|
||||
-- }}}
|
||||
-- {{{ Quit current buffer / all buffers
|
||||
vim.keymap.set({ "n", "v" }, "<leader>q", function()
|
||||
local buf = vim.api.nvim_win_get_buf(0)
|
||||
|
||||
-- Only save if file is writable
|
||||
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then
|
||||
vim.cmd([[write]])
|
||||
end
|
||||
|
||||
vim.cmd("q")
|
||||
end, { desc = "[Q]uit current buffer" })
|
||||
|
||||
-- {{{ Quit all buffers
|
||||
M.nmap("Q", ":wqa<cr>", "Save all files and [q]uit")
|
||||
-- }}}
|
||||
-- {{{ Replace word in file
|
||||
|
@ -73,6 +62,7 @@ function M.setup()
|
|||
-- {{{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")
|
||||
-- }}}
|
||||
|
@ -83,6 +73,12 @@ function M.setup()
|
|||
vim.keymap.set({ "n", "v" }, "<f11>", '"+', { desc = "Use global clipboard" }) -- Use global clipboard with *cp*
|
||||
M.nmap("<f12>", ":silent write<cr>", "Save current file") -- 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 "q"
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "help" },
|
||||
|
@ -97,12 +93,6 @@ function M.setup()
|
|||
end,
|
||||
})
|
||||
-- }}}
|
||||
-- {{{ 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" })
|
||||
-- }}}
|
||||
|
||||
return M
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue