diff options
author | Yigit Sever | 2024-10-14 17:03:09 +0200 |
---|---|---|
committer | Yigit Sever | 2024-10-14 17:03:09 +0200 |
commit | 4c89c5ce52617f0d6a517fb99cd2bc6ca17cc342 (patch) | |
tree | 9c0321e0f0403bc2b40fea4f94eb55e573a62230 | |
parent | 2b25091e29ca92499d77360a1532a1580697ba28 (diff) | |
download | dotfiles-4c89c5ce52617f0d6a517fb99cd2bc6ca17cc342.tar.gz dotfiles-4c89c5ce52617f0d6a517fb99cd2bc6ca17cc342.tar.bz2 dotfiles-4c89c5ce52617f0d6a517fb99cd2bc6ca17cc342.zip |
nvim: introduce keybind <leader>yp
hello! hope nr2char(10) is the correct way of doing this :)
-rw-r--r-- | .config/nvim/lua/core/keymaps.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index 95e5fcd..318cfc7 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua | |||
@@ -49,6 +49,11 @@ map("n", "<leader>lp", "gewi[[/papers/<ESC>Ea]]<ESC>", "vimwiki: link wrap word | |||
49 | -- call CreateReference on word below cursor | 49 | -- call CreateReference on word below cursor |
50 | map("n", "<leader>nr", '<cmd>call CreateReference(expand("<cword>"))<CR>', "vimwiki: new reference word under cursor") | 50 | map("n", "<leader>nr", '<cmd>call CreateReference(expand("<cword>"))<CR>', "vimwiki: new reference word under cursor") |
51 | 51 | ||
52 | -- nr2char(10) is, of course, a newline character | ||
53 | map("n", "<leader>yp", | ||
54 | "<cmd>call setreg('+', expand('%:h') . '/' . expand('%:t') . ':' . line('.') . nr2char(10) . getline('.'))<CR>", | ||
55 | "yank the current line contents, filename and line number to clipboard") | ||
56 | |||
52 | -- create a new note | 57 | -- create a new note |
53 | map("n", "<leader>nn", "<cmd>call CreateNote()<CR>", "vimwiki: new note for slipbox") | 58 | map("n", "<leader>nn", "<cmd>call CreateNote()<CR>", "vimwiki: new note for slipbox") |
54 | 59 | ||
@@ -70,6 +75,7 @@ map('n', "'", '`') | |||
70 | map("n", "n", "nzzzv") | 75 | map("n", "n", "nzzzv") |
71 | map("n", "N", "Nzzzv") | 76 | map("n", "N", "Nzzzv") |
72 | 77 | ||
78 | |||
73 | -- switch between light and dark modes | 79 | -- switch between light and dark modes |
74 | map("n", "<leader>ut", function() | 80 | map("n", "<leader>ut", function() |
75 | if vim.o.background == "dark" then | 81 | if vim.o.background == "dark" then |