Compare commits
4 Commits
f5aeb38557
...
2228d8085c
Author | SHA1 | Date | |
---|---|---|---|
2228d8085c | |||
305d6f7a6c | |||
01c7e0d95a | |||
a494123bfa |
@ -123,6 +123,9 @@ M.setup = function()
|
|||||||
-- Alias <leader>/ to toggle comments
|
-- Alias <leader>/ to toggle comments
|
||||||
vim.keymap.set("n", "<leader>/", "gcc", { silent = true, remap = true, desc = "Comment: Toggle Line" })
|
vim.keymap.set("n", "<leader>/", "gcc", { silent = true, remap = true, desc = "Comment: Toggle Line" })
|
||||||
vim.keymap.set("v", "<leader>/", "gc", { silent = true, remap = true, desc = "Comment: Toggle Selection" })
|
vim.keymap.set("v", "<leader>/", "gc", { silent = true, remap = true, desc = "Comment: Toggle Selection" })
|
||||||
|
|
||||||
|
-- Bring up messages via keybind
|
||||||
|
vim.keymap.set("n", ";m", "<cmd>message<CR>", { silent = true, noremap = true, desc = "View Messages" })
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -18,10 +18,37 @@ vim.g.neovide_fullscreen = false
|
|||||||
vim.g.neovide_cursor_vfx_mode = "ripple"
|
vim.g.neovide_cursor_vfx_mode = "ripple"
|
||||||
vim.g.neovide_cursor_vfx_particle_lifetime = 0.3
|
vim.g.neovide_cursor_vfx_particle_lifetime = 0.3
|
||||||
|
|
||||||
-- Allow clipboard copy paste in neovim
|
-- ===== Allow clipboard copy paste in neovim
|
||||||
vim.keymap.set({ "n", "v" }, "<D-v>", '"+P') -- Paste normal and visual mode
|
-- Paste normal and visual mode
|
||||||
vim.keymap.set({ "i", "c" }, "<D-v>", "<C-R>+") -- Paste insert and command mode
|
vim.keymap.set({ "n", "v" }, "<D-v>", '"+P')
|
||||||
vim.keymap.set("t", "<D-v>", [[<C-\><C-N>"+Pi]]) -- Paste terminal mode
|
-- Paste insert and command mode
|
||||||
|
vim.keymap.set({ "i", "c" }, "<D-v>", function()
|
||||||
|
local register = "+"
|
||||||
|
local register_type = vim.fn.getregtype(register)
|
||||||
|
local register_content = vim.fn.getreg(register)
|
||||||
|
-- Set the register to be pasted `charwise`, see `:h charwise`
|
||||||
|
vim.fn.setreg(register, register_content, "c")
|
||||||
|
-- Handle pasting at the end of lines. Because we're invoking `normal!` commands whilst in
|
||||||
|
-- `insert` mode, we have to handle EOL stuff. For some reason (and I'm too lazy to investiage),
|
||||||
|
-- `nvim_feedkeys` doesn't block correctly here and the last `setreg` call is triggered too
|
||||||
|
-- early.
|
||||||
|
local cmd = '"' .. register .. "g"
|
||||||
|
if vim.fn.charcol(".") == (vim.fn.charcol("$")) then
|
||||||
|
-- At eol, paste AFTER the cursor
|
||||||
|
vim.cmd.normal({ cmd .. "p", bang = true })
|
||||||
|
-- Since we're in insert mode and we just invoked a `normal` mode command, the cursor is
|
||||||
|
-- actually offset one column to the left from where it should be -- move it over by one.
|
||||||
|
local win = vim.api.nvim_get_current_win()
|
||||||
|
local row, col = unpack(vim.api.nvim_win_get_cursor(win))
|
||||||
|
vim.api.nvim_win_set_cursor(win, { row, col + 1 })
|
||||||
|
else
|
||||||
|
vim.cmd.normal({ cmd .. "P", bang = true })
|
||||||
|
end
|
||||||
|
-- Restore the register's type back to what it was previously
|
||||||
|
vim.fn.setreg(register, register_content, register_type)
|
||||||
|
end)
|
||||||
|
-- Paste terminal mode
|
||||||
|
vim.keymap.set("t", "<D-v>", [[<C-\><C-N>"+Pi]])
|
||||||
|
|
||||||
-- Next/prev tabs
|
-- Next/prev tabs
|
||||||
vim.keymap.set({ "", "!", "v", "t" }, "<D-x>", "<cmd>tabnext<CR>", { noremap = true, silent = true })
|
vim.keymap.set({ "", "!", "v", "t" }, "<D-x>", "<cmd>tabnext<CR>", { noremap = true, silent = true })
|
||||||
@ -29,10 +56,32 @@ vim.keymap.set({ "", "!", "v", "t" }, "<D-z>", "<cmd>tabprevious<CR>", { noremap
|
|||||||
|
|
||||||
-- Spawn new terminal in new tab
|
-- Spawn new terminal in new tab
|
||||||
vim.keymap.set({ "", "!", "v", "t" }, "<D-t>", "<cmd>tabnew | terminal<CR>", { noremap = true, silent = true })
|
vim.keymap.set({ "", "!", "v", "t" }, "<D-t>", "<cmd>tabnew | terminal<CR>", { noremap = true, silent = true })
|
||||||
vim.keymap.set({ "n" }, "<C-S-Right>", "<cmd>vertical belowright terminal<CR>", { noremap = true, silent = true })
|
|
||||||
vim.keymap.set({ "n" }, "<C-S-Left>", "<cmd>vertical aboveleft terminal<CR>", { noremap = true, silent = true })
|
-- Spawn terminal in split direction
|
||||||
vim.keymap.set({ "n" }, "<C-S-Up>", "<cmd>horizontal aboveleft terminal<CR>", { noremap = true, silent = true })
|
vim.keymap.set(
|
||||||
vim.keymap.set({ "n" }, "<C-S-Down>", "<cmd>horizontal belowright terminal<CR>", { noremap = true, silent = true })
|
{ "", "!", "v", "t" },
|
||||||
|
"<C-S-Right>",
|
||||||
|
"<cmd>vertical belowright terminal<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set(
|
||||||
|
{ "", "!", "v", "t" },
|
||||||
|
"<C-S-Left>",
|
||||||
|
"<cmd>vertical aboveleft terminal<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set(
|
||||||
|
{ "", "!", "v", "t" },
|
||||||
|
"<C-S-Up>",
|
||||||
|
"<cmd>horizontal aboveleft terminal<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
vim.keymap.set(
|
||||||
|
{ "", "!", "v", "t" },
|
||||||
|
"<C-S-Down>",
|
||||||
|
"<cmd>horizontal belowright terminal<CR>",
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
|
||||||
-- Zoom in & out
|
-- Zoom in & out
|
||||||
vim.g.neovide_scale_factor = 1
|
vim.g.neovide_scale_factor = 1
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"rebelot/heirline.nvim",
|
"rebelot/heirline.nvim",
|
||||||
event = "ColorScheme",
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user