1
Fork 0

Vim clipboard, fixed esc inside tmux and other stuff

This commit is contained in:
Matei Adriel 2022-09-12 13:48:29 +02:00
parent f17b922131
commit f981cb55e9
4 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,7 @@
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
group = vim.api.nvim_create_augroup("Detect hkf", {}),
pattern = "*.hkf",
callback = function()
vim.opt.filetype = "hkf"
end
})

View file

@ -0,0 +1,21 @@
local M = {}
local function swap(key)
vim.keymap.set("n", key, "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true })
end
-- Same as swap, but the key is aprt of an arpeggio chord
local function swapArpeggio(key)
vim.keymap.set("n", "<Plug>(arpeggio-default:" .. key .. ")", "g" .. key, { buffer = true })
vim.keymap.set("n", "g" .. key, key, { buffer = true })
end
function M.setup()
swapArpeggio("j")
swap("k")
swap("0")
swap("$")
end
return M

View file

@ -0,0 +1,29 @@
local M = {}
local function img_name()
vim.fn.inputsave()
local name = vim.fn.input('Name: ')
vim.fn.inputrestore()
if name == nil or name == '' then
return os.date('%y-%m-%d-%H-%M-%S')
end
return name
end
function M.setup()
require 'clipboard-image'.setup {
default = {
img_name = img_name
},
tex = {
img_dir = { "%:p:h", "img" },
affix = "\\includegraphics[]{%s}",
},
}
vim.keymap.set("n", "<leader>p", ":PasteImg<cr>")
end
return M

View file

@ -0,0 +1,10 @@
local M = {}
function M.setup()
vim.keymap.set("n", "qf", "<Plug>(easymotion-bd-f)")
vim.keymap.set("n", "qj", "<Plug>(easymotion-overwin-f2)")
vim.keymap.set("n", "qw", "<Plug>(easymotion-bd-w)")
vim.keymap.set("n", "qL", "<Plug>(easymotion-bd-L)")
end
return M