From 617fbea06b6a1bdd4d90a8a8ad72433685b6091d Mon Sep 17 00:00:00 2001 From: yannickreiss Date: Sun, 18 Feb 2024 11:36:37 +0100 Subject: [PATCH] Add Keybindings, reading from yank register --- lua/sourcer/init.lua | 4 ++-- plugin/sourcer.vim | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/sourcer/init.lua b/lua/sourcer/init.lua index 38259a9..dcc51ba 100644 --- a/lua/sourcer/init.lua +++ b/lua/sourcer/init.lua @@ -1,9 +1,9 @@ local M = {} function M.lookup() - local keywords = vim.fn.getreg("") + local keywords = vim.fn.getreg("*") - print("Hallo Welt! " .. keywords) + print(keywords) end return M diff --git a/plugin/sourcer.vim b/plugin/sourcer.vim index 61b06ba..5dbbe35 100644 --- a/plugin/sourcer.vim +++ b/plugin/sourcer.vim @@ -12,3 +12,6 @@ let g:loaded_sourcer = 1 " Exposes the plugin's functions for use as commands in Neovim. command! -nargs=0 Lookup lua require("sourcer").lookup() + +" Bind to keys fo in normal mode +nnoremap fo :Lookup