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

To reference a word or a line in .samrc, sam on steroids #122

Open
jacksonbenete opened this issue Feb 20, 2022 · 0 comments
Open

To reference a word or a line in .samrc, sam on steroids #122

jacksonbenete opened this issue Feb 20, 2022 · 0 comments

Comments

@jacksonbenete
Copy link

Hello there,

I was thinking if there is a way to reference a word or a line in the .samrc file.
We have a "delete previous word" command, meaning that we can detect a "last word" boundary.
We also know the reference of the current line and selected lines, because we can for example select lines on a file and executing a s/pattern/pattern/g on the command window will take effect on the selected lines.

I was thinking that if we manage to have a variable on .samrc to reference the current line or word, we could write very nice commands.

A bind C x send %line for example would allow for you to easily navigate on the command window lines and repeat commands.
A bind C <key> send %word or bind C <key> send %selection would allow to execute commands interactively.

In Acme we can select a text and a Button 2 click will execute the select portion as a command, if you "Button 2 click" on a word, it'll also execute the word as a command.
In Ecmas we can execute a line (or evaluate an Elisp expression) with something like C-x C-e, there are others keybindings for evaluation portions of a line or a word as well.

I'm not trying to transform Sam on Acme or Emacs, of course. I just thought that this would open a lot of possibilities and give us a lot of power.

This is possible to do at some extent on the command window, the Button 2 menu will have a send option that you can send the selected text to command window. What I'm proposing is to either have the same function as a keyboard action or to enable the send option on Button 2 menu for file windows as well, or both.

What do you think?

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

1 participant