How to save marks in less for later access?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
If I mark a line in less, the mark will lost when the current less session ends.
So, let's say, if I often check the bash man page for READLINE section, I have to search ^REA
every time.
Seems like less doesn't have any config files. Is there a way to save the marks in less so I can use it for next time?
less
add a comment |Â
up vote
3
down vote
favorite
If I mark a line in less, the mark will lost when the current less session ends.
So, let's say, if I often check the bash man page for READLINE section, I have to search ^REA
every time.
Seems like less doesn't have any config files. Is there a way to save the marks in less so I can use it for next time?
less
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
If I mark a line in less, the mark will lost when the current less session ends.
So, let's say, if I often check the bash man page for READLINE section, I have to search ^REA
every time.
Seems like less doesn't have any config files. Is there a way to save the marks in less so I can use it for next time?
less
If I mark a line in less, the mark will lost when the current less session ends.
So, let's say, if I often check the bash man page for READLINE section, I have to search ^REA
every time.
Seems like less doesn't have any config files. Is there a way to save the marks in less so I can use it for next time?
less
edited Jul 27 at 9:57
Jeff Schaller
30.7k846104
30.7k846104
asked Jul 27 at 2:41
dotc
163
163
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
Not in the version of less
I looked at. Another problem is that man
may write to temporary files, so how would the marks line up between /tmp/man.sLCaUQkJ3k
and /tmp/man.yuvNSUrFZo
even if they were being saved?
We can cheat a little and use vim
which does with suitable configuration save marks for future use, and also use the same filename for each man
page. Note that a system-wide temporary directory would most likely be a very bad place to put static filenames, unless you like generating new CVE.
function mman col -bx > "$HOME/tmp/man.$1"
vim -R "$HOME/tmp/man.$1"
#rm "$HOME/tmp/man.$1"
The generated page could either be removed immediately, or maybe a cron job cleans them up. Another problem is that man section names or other arguments to man
are not supported, so this code may likely need to be complicated to handle man 3 rand
the same as man rand
(though those two may not be the same depending on your system and whether the OpenSSL rand
man page intrudes).
Please specify your version ofless
.
â agc
Jul 27 at 3:57
add a comment |Â
up vote
0
down vote
There are no way to preserve the marks across invocations... But:
So, let's say, if I often check the bash man page for READLINE section, I have to search
^REA
every time.
less
saves search history by default. It stores it in ~/.lesshst
, which can be overridden by setting the $LESSHISTFILE
environment variable to point to another file's path. So at least you can use that to search for a regexp you used before (assuming you're using that same one often.) I hope you might find that useful (in case you didn't know about it.)
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Not in the version of less
I looked at. Another problem is that man
may write to temporary files, so how would the marks line up between /tmp/man.sLCaUQkJ3k
and /tmp/man.yuvNSUrFZo
even if they were being saved?
We can cheat a little and use vim
which does with suitable configuration save marks for future use, and also use the same filename for each man
page. Note that a system-wide temporary directory would most likely be a very bad place to put static filenames, unless you like generating new CVE.
function mman col -bx > "$HOME/tmp/man.$1"
vim -R "$HOME/tmp/man.$1"
#rm "$HOME/tmp/man.$1"
The generated page could either be removed immediately, or maybe a cron job cleans them up. Another problem is that man section names or other arguments to man
are not supported, so this code may likely need to be complicated to handle man 3 rand
the same as man rand
(though those two may not be the same depending on your system and whether the OpenSSL rand
man page intrudes).
Please specify your version ofless
.
â agc
Jul 27 at 3:57
add a comment |Â
up vote
0
down vote
Not in the version of less
I looked at. Another problem is that man
may write to temporary files, so how would the marks line up between /tmp/man.sLCaUQkJ3k
and /tmp/man.yuvNSUrFZo
even if they were being saved?
We can cheat a little and use vim
which does with suitable configuration save marks for future use, and also use the same filename for each man
page. Note that a system-wide temporary directory would most likely be a very bad place to put static filenames, unless you like generating new CVE.
function mman col -bx > "$HOME/tmp/man.$1"
vim -R "$HOME/tmp/man.$1"
#rm "$HOME/tmp/man.$1"
The generated page could either be removed immediately, or maybe a cron job cleans them up. Another problem is that man section names or other arguments to man
are not supported, so this code may likely need to be complicated to handle man 3 rand
the same as man rand
(though those two may not be the same depending on your system and whether the OpenSSL rand
man page intrudes).
Please specify your version ofless
.
â agc
Jul 27 at 3:57
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Not in the version of less
I looked at. Another problem is that man
may write to temporary files, so how would the marks line up between /tmp/man.sLCaUQkJ3k
and /tmp/man.yuvNSUrFZo
even if they were being saved?
We can cheat a little and use vim
which does with suitable configuration save marks for future use, and also use the same filename for each man
page. Note that a system-wide temporary directory would most likely be a very bad place to put static filenames, unless you like generating new CVE.
function mman col -bx > "$HOME/tmp/man.$1"
vim -R "$HOME/tmp/man.$1"
#rm "$HOME/tmp/man.$1"
The generated page could either be removed immediately, or maybe a cron job cleans them up. Another problem is that man section names or other arguments to man
are not supported, so this code may likely need to be complicated to handle man 3 rand
the same as man rand
(though those two may not be the same depending on your system and whether the OpenSSL rand
man page intrudes).
Not in the version of less
I looked at. Another problem is that man
may write to temporary files, so how would the marks line up between /tmp/man.sLCaUQkJ3k
and /tmp/man.yuvNSUrFZo
even if they were being saved?
We can cheat a little and use vim
which does with suitable configuration save marks for future use, and also use the same filename for each man
page. Note that a system-wide temporary directory would most likely be a very bad place to put static filenames, unless you like generating new CVE.
function mman col -bx > "$HOME/tmp/man.$1"
vim -R "$HOME/tmp/man.$1"
#rm "$HOME/tmp/man.$1"
The generated page could either be removed immediately, or maybe a cron job cleans them up. Another problem is that man section names or other arguments to man
are not supported, so this code may likely need to be complicated to handle man 3 rand
the same as man rand
(though those two may not be the same depending on your system and whether the OpenSSL rand
man page intrudes).
answered Jul 27 at 3:55
thrig
21.8k12651
21.8k12651
Please specify your version ofless
.
â agc
Jul 27 at 3:57
add a comment |Â
Please specify your version ofless
.
â agc
Jul 27 at 3:57
Please specify your version of
less
.â agc
Jul 27 at 3:57
Please specify your version of
less
.â agc
Jul 27 at 3:57
add a comment |Â
up vote
0
down vote
There are no way to preserve the marks across invocations... But:
So, let's say, if I often check the bash man page for READLINE section, I have to search
^REA
every time.
less
saves search history by default. It stores it in ~/.lesshst
, which can be overridden by setting the $LESSHISTFILE
environment variable to point to another file's path. So at least you can use that to search for a regexp you used before (assuming you're using that same one often.) I hope you might find that useful (in case you didn't know about it.)
add a comment |Â
up vote
0
down vote
There are no way to preserve the marks across invocations... But:
So, let's say, if I often check the bash man page for READLINE section, I have to search
^REA
every time.
less
saves search history by default. It stores it in ~/.lesshst
, which can be overridden by setting the $LESSHISTFILE
environment variable to point to another file's path. So at least you can use that to search for a regexp you used before (assuming you're using that same one often.) I hope you might find that useful (in case you didn't know about it.)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
There are no way to preserve the marks across invocations... But:
So, let's say, if I often check the bash man page for READLINE section, I have to search
^REA
every time.
less
saves search history by default. It stores it in ~/.lesshst
, which can be overridden by setting the $LESSHISTFILE
environment variable to point to another file's path. So at least you can use that to search for a regexp you used before (assuming you're using that same one often.) I hope you might find that useful (in case you didn't know about it.)
There are no way to preserve the marks across invocations... But:
So, let's say, if I often check the bash man page for READLINE section, I have to search
^REA
every time.
less
saves search history by default. It stores it in ~/.lesshst
, which can be overridden by setting the $LESSHISTFILE
environment variable to point to another file's path. So at least you can use that to search for a regexp you used before (assuming you're using that same one often.) I hope you might find that useful (in case you didn't know about it.)
answered Jul 27 at 6:18
Filipe Brandenburger
2,894417
2,894417
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458734%2fhow-to-save-marks-in-less-for-later-access%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password