If anyone is interested, I made a LuaScript doing this, it’s not perfect, but for me it works for now.
-- Move selection one character left
npp.AddShortcut("Selection Add Each", "Alt+,", function()
if not(editor.SelectionEmpty) then
local selText = editor:GetSelText()
editor:BeginUndoAction()
editor:DeleteBack()
editor:CharLeft()
editor:AddText(selText)
editor:SetSel(editor.CurrentPos, editor.CurrentPos-string.len(selText))
editor:EndUndoAction()
end
end)
-- Move selection one word left
npp.AddShortcut("Selection Add Each", "Alt+Shift+,", function()
if not(editor.SelectionEmpty) then
local selText = editor:GetSelText()
editor:BeginUndoAction()
editor:DeleteBack()
editor:WordLeft()
editor:AddText(selText)
editor:SetSel(editor.CurrentPos, editor.CurrentPos-string.len(selText))
editor:EndUndoAction()
end
end)
-- Move selection one character right
npp.AddShortcut("Selection Add Each", "Alt+.", function()
if not(editor.SelectionEmpty) then
local selText = editor:GetSelText()
editor:BeginUndoAction()
editor:Clear()
editor:CharRight()
editor:AddText(selText)
editor:SetSel(editor.CurrentPos, editor.CurrentPos-string.len(selText))
editor:EndUndoAction()
end
end)
-- Move selection one word right
npp.AddShortcut("Selection Add Each", "Alt+Shift+.", function()
if not(editor.SelectionEmpty) then
local selText = editor:GetSelText()
editor:BeginUndoAction()
editor:Clear()
editor:WordRight()
editor:AddText(selText)
editor:SetSel(editor.CurrentPos, editor.CurrentPos-string.len(selText))
editor:EndUndoAction()
end
end)