Vim clipboard, fixed esc inside tmux and other stuff
This commit is contained in:
parent
f17b922131
commit
f981cb55e9
7
dotfiles/neovim/ftdetect/hkf.lua
Normal file
7
dotfiles/neovim/ftdetect/hkf.lua
Normal 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
|
||||
})
|
21
dotfiles/neovim/lua/my/helpers/wrapMovement.lua
Normal file
21
dotfiles/neovim/lua/my/helpers/wrapMovement.lua
Normal 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
|
29
dotfiles/neovim/lua/my/plugins/clipboard-image.lua
Normal file
29
dotfiles/neovim/lua/my/plugins/clipboard-image.lua
Normal 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
|
10
dotfiles/neovim/lua/my/plugins/easymotion.lua
Normal file
10
dotfiles/neovim/lua/my/plugins/easymotion.lua
Normal 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
|
Loading…
Reference in a new issue