diff --git a/dotfiles/neovim/ftdetect/hkf.lua b/dotfiles/neovim/ftdetect/hkf.lua new file mode 100644 index 0000000..fdca1d4 --- /dev/null +++ b/dotfiles/neovim/ftdetect/hkf.lua @@ -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 +}) diff --git a/dotfiles/neovim/lua/my/helpers/wrapMovement.lua b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua new file mode 100644 index 0000000..65da948 --- /dev/null +++ b/dotfiles/neovim/lua/my/helpers/wrapMovement.lua @@ -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", "(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 diff --git a/dotfiles/neovim/lua/my/plugins/clipboard-image.lua b/dotfiles/neovim/lua/my/plugins/clipboard-image.lua new file mode 100644 index 0000000..e26ae69 --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/clipboard-image.lua @@ -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", "p", ":PasteImg") +end + +return M diff --git a/dotfiles/neovim/lua/my/plugins/easymotion.lua b/dotfiles/neovim/lua/my/plugins/easymotion.lua new file mode 100644 index 0000000..d003407 --- /dev/null +++ b/dotfiles/neovim/lua/my/plugins/easymotion.lua @@ -0,0 +1,10 @@ +local M = {} + +function M.setup() + vim.keymap.set("n", "qf", "(easymotion-bd-f)") + vim.keymap.set("n", "qj", "(easymotion-overwin-f2)") + vim.keymap.set("n", "qw", "(easymotion-bd-w)") + vim.keymap.set("n", "qL", "(easymotion-bd-L)") +end + +return M