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

New feature requests? #3659

Open
jinghuazhao opened this issue Oct 26, 2023 · 5 comments
Open

New feature requests? #3659

jinghuazhao opened this issue Oct 26, 2023 · 5 comments

Comments

@jinghuazhao
Copy link

I installed 1.38 on our CentOS 7 system and have been very impressed with the implementation over gedit, for instance smart indentation is cool!

As a user of pico from pine/alpine (or nano) for many years, I get used to several features,

  1. select and write out a particular chunk of code outside to be used elsewhere.
  2. insert from another file at the spot.
  3. select a code chunk and paste to a console such as R.

Surely I may have missed many things, as I am new and still not sure about all its functions and yet to get 2.0 going as pango, glib and GTK+ are all out of dates

Any comments are welcome.

@elextr
Copy link
Member

elextr commented Oct 26, 2023

select and write out a particular chunk of code outside to be used elsewhere.

This is not directly available in base Geany and AFAIK not in any of the plugins collection. Would be best in a plugin.

The workaround is to copy and paste in a new file, select ctrl+c ctrl+n ctrl+v and saveactions can even make it a file automatically and you can save-as with your own name.

insert from another file at the spot.

There is no ability to do anything with a closed file, it has to be opened, this ensures that encoding issues have been addressed so that non-UTF-8 content is not pasted into the buffer. When open ctrl_a selects the whole file for you to copy and paste.

select a code chunk and paste to a console such as R.

Not sure why you can't copy and paste to R, that sounds like an R problem. I don't have R but can successfully copy and paste into the Python terminal.

@jinghuazhao
Copy link
Author

Thanks for refreshing my understandings! The sequences of ctrl-c,ctrl-n,ctrl-v as with ctrl-a on a file would help; probably I have been too used to the ctrl-^, ctrl-o (to write) and ctrl-r (to read) from pico/nano; copy/paste might be to do with the console I am using (mobaXterm) as it won't copy to anywhere (Bash,python,pico) where I use a lot.

@b4n
Copy link
Member

b4n commented Oct 26, 2023

select and write out a particular chunk of code outside to be used elsewhere.

You could use the context action with a custom script, but note that this can be set per-filetype as well, in which case it's less convenient for this. You could use a script like so:

Example script, use script.sh "%s" as the context action command

#!/bin/sh

# just in case, because it ruins the zenity call if set
unset G_MESSAGES_DEBUG

target="$(zenity --title="Choose a file where to write the selection" --file-selection --save --confirm-overwrite)" || exit 1
printf '%s' "$*" > "$target"

You can also abuse send selection to for this. It's kind of a hack because that feature is used to transform the selection, but you can still get away with it either by having your script exit with failure (then your selection won't be replaced), or have it send out the same data it got in, replacing your selection with the same contents.

Example script, use script.sh as the command

#!/bin/sh

# just in case, because it ruins the zenity call if set
unset G_MESSAGES_DEBUG

target="$(zenity --title="Choose a file where to write the selection" --file-selection --save --confirm-overwrite)" || exit 1
tee "$target"

# and possibly:
#exit 1

You can set custom keybindings for the first 9 configured commands.

[edit] however, as @elextr said a plugin might be the best option :)

@jinghuazhao
Copy link
Author

Thanks! Perhaps it will take time for me to learn and be familiar with these.

@jinghuazhao
Copy link
Author

I realised that if I use geany's terminal then I could select/copy/paste code chunks from editor there. I also got 2.0 compiled though still need to get debugger/spellcheck going.

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