Jump to content

  • Log In with Google      Sign In   
  • Create Account


Qt Creator


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Ectara   Crossbones+   -  Reputation: 2913

Like
1Likes
Like

Posted 29 March 2014 - 05:16 PM

I've recently decided to try out Qt Creator, and while I'm impressed with its features, I'm very frustrated by its Find and Replace functionality. First, I'm bothered by the fact that the replacement buttons don't have mnemonics, so pressing Alt+A, for example, doesn't replace all, but opens a menu. Many other text editors allow you to find and replace without using the mouse; I've tried Tabbing to the buttons, but it only will give focus to the replace all button and the text fields, ignoring the other two replacement buttons and both finding buttons. I tried setting Replace Next to Alt+R in the shortcuts dialog, but pressing Alt+R doesn't seem to do anything; Alt+Shift+R does Replace Previous, but it is hard for that alone to be useful. I bound Replace to Ctrl+R, but I have yet to find out what that actually does, if anything.

 

In short, find and replace feels weak in Qt Creator, compared to some free text editors out there, and it is heavily affecting my workflow (I use find and replace a lot). Additionally, I can't seem to get it to replace within a single-line selection; every time I make a single-line selection and open the find dialog, it clears the selection if it is shorter than two lines! Are there any plugins for this to augment its behavior? I haven't found any. Has anyone here that uses Qt Creator managed to use keyboard shortcuts for this functionality? Ideally, I'd like it to function like Kate, or at least Notepad++ (not crazy about how MSVS does it, especially regex syntax).



Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 6036

Like
1Likes
Like

Posted 29 March 2014 - 05:35 PM

QTCreator has a built in Vim mode , if you enable it you can use:

http://vim.wikia.com/wiki/Search_and_replace

 

(it even supports regular expressions which is quite nice)


Edited by SimonForsman, 29 March 2014 - 05:36 PM.

I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#3 Ectara   Crossbones+   -  Reputation: 2913

Like
0Likes
Like

Posted 29 March 2014 - 05:54 PM

Does it replace within selections? I can't picture vi supporting it, but I haven't really used it.



#4 SimonForsman   Crossbones+   -  Reputation: 6036

Like
1Likes
Like

Posted 29 March 2014 - 07:11 PM

Does it replace within selections? I can't picture vi supporting it, but I haven't really used it.

yes, you can limit the search&replace to a selection by adding \%V at the start of the searchString. (you can also restrict it to a line range and a bunch of other things).

 

with vim (or fakeVim in QTCreator) you can also quickly select text using the keyboard by pressing v (to enter visual/select mode) and then follow it up with the normal commands for block or line manipulation. (viB selects the current { ... } block for example)

 

Also, if you don't like using fakevim you can just go into tools->options->enviroment->keyboard and add/change the normal keyboard shortcuts. (there are quite a few functions there that don't have a keybinding in the default configuration)


Edited by SimonForsman, 29 March 2014 - 07:16 PM.

I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#5 Ectara   Crossbones+   -  Reputation: 2913

Like
0Likes
Like

Posted 29 March 2014 - 07:53 PM


yes, you can limit the search&replace to a selection by adding \%V at the start of the searchString. (you can also restrict it to a line range and a bunch of other things).



with vim (or fakeVim in QTCreator) you can also quickly select text using the keyboard by pressing v (to enter visual/select mode) and then follow it up with the normal commands for block or line manipulation. (viB selects the current { ... } block for example)

It's certainly a possibility, but that's a steep learning curve to learn the control scheme of an entirely different text editor to work around an inadequate find and replace dialog panel.

 


Also, if you don't like using fakevim you can just go into tools->options->enviroment->keyboard and add/change the normal keyboard shortcuts. (there are quite a few functions there that don't have a keybinding in the default configuration)

As I said in the original post, I have already tried changing the keybindings there, with mixed success. Not everything I needed could be configured, and while some worked, some did nothing whatsoever, no matter which elements had focus when I pressed the key combination.

 

If making it behave like Kate isn't possible, I understand.



#6 Bregma   Crossbones+   -  Reputation: 4976

Like
0Likes
Like

Posted 30 March 2014 - 07:02 AM


that's a steep learning curve to learn the control scheme of an entirely different text editor to work around an inadequate find and replace dialog panel

Once you've learned vim, all other editors are inadequate1.  Take the plunge now, the only regret you will have is that you didn't learn it sooner.

 

 

1 Some say there's an equally good editor buried in emacs, but I have yet to find out how to access it.


Stephen M. Webb
Professional Free Software Developer




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS