diff .chezmoitemplates/init.lua @ 574:8b04d5ffd210

Clean up unused functions and mappings
author zegervdv <zegervdv@me.com>
date Fri, 04 Mar 2022 10:35:44 +0100
parents c2cc785e1674
children 50e9c21e8e95
line wrap: on
line diff
--- a/.chezmoitemplates/init.lua	Thu Mar 03 10:55:29 2022 +0100
+++ b/.chezmoitemplates/init.lua	Fri Mar 04 10:35:44 2022 +0100
@@ -792,6 +792,18 @@
 map('n', '`', "'")
 map('n', "'", '`')
 
+-- Do not move on *
+map('n', '*', function()
+  local view = vim.fn.winsaveview()
+  vim.cmd [[ normal! * ]]
+  vim.fn.winrestview(view)
+end, { silent = true, desc = 'Search word under cursor without moving to first results' })
+
+map('n', '<UP>', ':cprev<CR>', { desc = 'Go to previous error/match' })
+map('n', '<DOWN>', ':cnext<CR>', { desc = 'Go to next error/match' })
+map('n', '<LEFT>', ':cpf<CR>', { desc = 'Go to previous error/match in previous file' })
+map('n', '<RIGHT>', ':cnf<CR>', { desc = 'Go to next error/match in next file' })
+
 local au = require 'au'
 
 -- Highlight yanked text