Key bindings in Pluma

Is there a way to change key bindings in pluma?
Specifically, I want to change 'find next' to F3.

You can try this and see if it allows your choice by double clicking on present setting and pressing the F3 key.

Edit: Idiot me confused Terminal with Pluma.

2 Likes

After changing 'Find Next' to F3 and 'Find Previous' to Shift+F3, I get the following when I press
Ctrl+F:

Ctrl+F

When I hit Ctrl+g (note: no shift) I get the 'Replace' requester.

Shift+F3 and Shift+Ctrl+F3 does nothing.

Changing them back to Shift+Ctrl+H and Shift+Ctrl+G does not restore previous operation.

Any chance I can get back to Default operation of pluma?

Oops wrong thinking was thinking terminal. If you changed them in terminal change back. Just tried here and they have no effect on Pluma. Checked config file and it showed the normal shortcuts. Open Pluma and click on search and it should show the normal ones. On my system Pluma find results in different window. Note the Search choices. Off chance you can go to
/home/user_name/.config and drag the Pluma folder to your Desktop. Then open Pluma and close and a new one will be generated. Note: Close all open Pluma windows first.

Edit: Never mind looks like mate-search-tool

s

Now I'm really screwed, I think. Geany is now acting the same way as Pluma.
Ctrl+f brings up the 'Search for Files' box as I showed above.
Shift+Ctrl+F brings up a 'Find in Files' box.

Shift+Ctrl+F

Clicking the Find in the menu on Pluma or Geany works as expected, just can't do a find from the keyboard now.

Still pondering. On my box if I open with Pluma a .svg file and then ctrl-f it opens Find box. Type in word and it highlights all the hits. Then have to close the box and ctrl-g and shift-ctrl-g move up and down the list. Just installed Geany and it reacts in the same manner with a different find window.


After entering search item, hit enter and close window then the hotkeys take over because the window has focus.
To check shortcuts for Geany (should be ok if in menu bar they are showing correct) this link has another link on top ofpage in Keyboard shortcuts section that brings you to the keyboard settings page for Geany. Note the (C) means if you change it can affect other apps that also use that shortcut.

Geany Keyboard Shortcuts

1 Like

Well, when I hit a Ctrl+f it brings up the 'Search for Files' box, in both Pluma and Geany.

If I use the 'Find' in the Pluma menu, it works as expected, bringing up the 'Find' window. After that, Ctrl+g and Shift+Ctrl+G work in the way you mentioned.

If I use the menu in Geany, It works as expected, bringing up the 'Find' window. After that, F3 and Shift+F3 work as expected. I probably used Geany's Keybindings to set that.

The bad behaviour of the Ctrl+f is not limited to Geany and Pluma. I just found out today that Firefox does the same thing with Ctrl+f, instead of bringing up the 'Find in page' box.

So the upshot is that changing the 'Find next' and 'Find previous' changes I made messed up the operation of Ctrl+f, and it remained messed up even after I reversed the changes.

Possibly did you change a keyboard shortcut in Control Center, specifically the one shown in the image. I changed it and it now mimics

If so double click on it and hit backspace. Be forewarned if not don't double click on Search as I have not yet found or figured out how to re-enter the original Search as the shortcut. Just found it my laptop I enter fn F9 and the word Search pops up. fn F9 brings up Search box.

4 Likes

If I changed that, it was inadvertent, but I cleared that Key in Control Centre, and now Pluma and Geany both react properly to Ctrl+f.

Geany now uses F3 to do a 'find next' and a Shift+Ctrl+F3 to do a 'find previous'. I set those up when I first switched to Linux.

Pluma, however, now does a 'find next' with Ctrl+G, and a 'find previous' with Shift+Ctrl+G. I suspect that's normal operation, but I seldom use it.

Thanks for the help!

3 Likes

Hi, @lar3ry :slight_smile:

You wrote:

I've just found out a way to change Keyboard Shortcuts in the Pluma text editor. At least, it seems to be working with Pluma version 1.26.0 which is what I have in my laptop computer running Ubuntu MATE 22.04 LTS ("Jammy Jellyfish"). The trick is to edit the "accels" file of Pluma which is ~/.config/pluma/accels. The word "accels" stands for "accelerators" which I think it's a specific type of keyboard shortcuts / bindings, based on my understanding of the following excerpt from "Gtk.AccelGroup" - https://docs.gtk.org/gtk3/class.AccelGroup.html: "(...) Accelerators are shortcuts for activating a menu item; they appear alongside the menu item they’re a shortcut for. For example “Ctrl+Q” might appear alongside the “Quit” menu item.(...)"

So, to change the keyboard shortcuts / key bindings to "Find" the Next and Previous occurrence of a text string / expression, I suggest that you:

1 - Start by making a backup copy of that "accels" file:

cp -pv ~/.config/pluma/accels ~/.config/pluma/accels.ORIG

The lines that start with ; (semicolon) in that "accels" file are comments / commented lines. So, what we need to do is "uncomment" two lines in that "accels" file and change the keyboard shortcuts that are assigned. Now, to do that:

2 - Change the following line in that "~/.config/pluma/accels" file:

; (gtk_accel_path "<Actions>/PlumaWindowActions/SearchFindNext" "<Primary>g")

... so that it becomes the following instead (you can see that I've removed the ; from the beginning of the line and that I've replaced "<Primary>g" by "F3"):

(gtk_accel_path "<Actions>/PlumaWindowActions/SearchFindNext" "F3")

3 - Change the following line in that "~/.config/pluma/accels" file:

; (gtk_accel_path "<Actions>/PlumaWindowActions/SearchFindPrevious" "<Primary><Shift>g")

... so that it becomes the following instead (you can see that I've removed the ; from the beginning of the line and that I've replaced "<Primary><Shift>g" by "<Shift>F3"):

(gtk_accel_path "<Actions>/PlumaWindowActions/SearchFindPrevious" "<Shift>F3")

4 - If you have Pluma opened, then please close it and open it again.

I hope this helps :slight_smile:

5 Likes

As it happens, I have Pluma 1.26.0 running on Ubuntu MATE 22.04 as well.

Made a backup. Made the changes, and it works like a charm. Thank you VERY much.

I had marked a post made by @mendy as Solved, but that one had solved a problem that arose as part of the attempts to change the bindings for the search keys. Since your post solved the original question, I took the liberty of changing your post to 'Solved'.

2 Likes

I'm glad that my solution also worked for you, @lar3ry :slight_smile: You're most welcome. Thanks for the follow-up and for having marked my answer as the Solution.

1 Like