Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify the number of surrounding lines to show as context with ambr? #20

Open
Boscop opened this issue Sep 22, 2019 · 2 comments

Comments

@Boscop
Copy link

Boscop commented Sep 22, 2019

How to specify the number of surrounding lines to show as context with ambr?
For making better replacing decisions.

EDIT:
It doesn't seem to have that option, at least according to -h.
I suggest adding this option with -c <N> / --context <N>
It would also be useful for ambs.

Suggestion: If the number is specified with a plus (+) sign in front, only show N following lines, none behind.

@Selion05
Copy link

Would also be nice to have that in interactive mode in ambr.

e.g.
5 prints 5 lines before and after

for some searches I know I only need to see lines before/after the match so a nice to have feature
+5 prints 5 lines after the match
-5 prints 5 lines before the match

@dicktyr
Copy link

dicktyr commented Mar 1, 2024

context is indeed useful

probably best to follow established syntax
of tools such as grep, &c.

-A NUM, --after-context=NUM
-B NUM, --before-context=NUM
-C NUM, -NUM, --context=NUM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants