Replies: 1 comment 1 reply
-
|
It's doable with a plugin. I have something similar in my ~/.config/micro/init.lua if you need a starting point: local micro = import("micro")
local buffer = import("micro/buffer")
local config = import("micro/config")
local mark = buffer.Loc(0, 1337)
function addMark(bufpane)
local cursor = bufpane.Buf:GetActiveCursor()
mark = buffer.Loc(cursor.Loc.X, cursor.Loc.Y)
end
function goToMark(bufpane)
local cursor = bufpane.Buf:GetActiveCursor()
local prev = buffer.Loc(cursor.Loc.X, cursor.Loc.Y)
cursor:GotoLoc(mark)
mark = prev
cursor:Relocate()
bufpane:Relocate()
end
function selectToMark(bufpane)
local cursor = bufpane.Buf:GetActiveCursor()
local curr = buffer.Loc(cursor.Loc.X, cursor.Loc.Y)
cursor:SetSelectionStart(mark)
cursor:SetSelectionEnd(curr)
end
function init()
config.MakeCommand("mark", addMark, config.NoComplete)
config.MakeCommand("go-to-mark", goToMark, config.NoComplete)
config.MakeCommand("select-to-mark", selectToMark, config.NoComplete)
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to set in/out points for selecting text? It would be helpful for huge files.
Place the caret, set in point, place it on the end, set out point = text selected, like in NLE video applications.
Beta Was this translation helpful? Give feedback.
All reactions