From c1642f7bb58226ee1497064b85c4037e7e9c9be3 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Mon, 11 Oct 2021 23:59:32 +0300 Subject: nvim: new %% mapping and lcd --- .config/nvim/lua/mappings.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index ffd8610..de661e3 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -76,7 +76,7 @@ map('n', 'xx', 'dd') map('n', 'X', 'D') -- change into pwd of current directory -map('n', 'cd', ':cd %:p:h:pwd') +map('n', 'cd', ':lcd %:p:h:pwd') -- press \g and start writing prose map('n', 'g', ':Goyo') @@ -93,6 +93,8 @@ map('n', 'nr', ':call CreateReference(expand(""))') -- create a new note map('n', 'nn', ':call CreateNote()') +vim.cmd("cnoremap %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'") + -- plug mappings {{{ -- -- mappings should not be noremap -- cgit v1.2.3-70-g09d2