From 99531be4ad8347af219b8e0437fef1c7fb96a69b Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 19 Jun 2023 13:57:30 +0530 Subject: [PATCH] Revert "nvim: keymappings: Drop all key mappings for tags" This reverts commit 3657612dbbea4a63c63a6c89acadc77aadaaa418. We want to use fast-tags with Haskell. --- nvim/.config/nvim/lua/keymappings.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nvim/.config/nvim/lua/keymappings.lua b/nvim/.config/nvim/lua/keymappings.lua index 0f3075a..a6fe6fb 100644 --- a/nvim/.config/nvim/lua/keymappings.lua +++ b/nvim/.config/nvim/lua/keymappings.lua @@ -43,6 +43,12 @@ remap('n', 'tc', ':tabclose' , opts) -- Jump to first tab & close all other tabs. Helpful after running Git -- difftool. remap('n', 'T', ':tabfirst:tabonly', opts) +-- For tags +remap('n', '[t', ':tprevious', opts) +remap('n', ']t', ':tNext' , opts) +remap('n', '[T', ':tfirst' , opts) +remap('n', ']T', ':tlast' , opts) +remap('n', 'ts', ':tselect ', opts) -- Quickfix list mappings remap('n', 'qo', ':copen' , opts) remap('n', 'qc', ':cclose' , opts) @@ -57,6 +63,13 @@ remap('n', '[l', ':lprevious', opts) remap('n', ']l', ':lnext' , opts) remap('n', '[L', ':lfirst' , opts) remap('n', ']L', ':lfirst' , opts) +-- Preview tags +remap('n', 'pt', ':ptag ' , opts) +remap('n', '[p', ':ptprevious' , opts) +remap('n', ']p', ':ptnext' , opts) +remap('n', 'po', ':ppop' , opts) +remap('n', 'pc', ':pc' , opts) +remap('n', 'pi', ':psearch ', opts) -- Short cuts for setting fold methods remap('n', 'zmi', ':set foldmethod=indent', opts) remap('n', 'zmm', ':set foldmethod=manual', opts) @@ -79,6 +92,10 @@ remap('n', '7', '7w', opts) remap('n', '8', '8w', opts) remap('n', '9', '9w', opts) +-- Tag helpers +remap('n', '', ':vsp :tag ', opts) +remap('n', '' , ':sp :tag ' , opts) + -- Move across wrapped lines like regular lines -- Go to the first non-blank character of a line remap('n', '0', '^', opts)