User forums > Using Code::Blocks
[OK] editing all instances of a word in a block
tokapi:
Hi everyone.
I'm posting here because I'm looking for a very practical option in codeblocks if it exists and I just cant find it : I am currently writting a very annoying code with long repeated sequences in which only one or two repeated word change each time.
I noticed that when you select a word in codeblocks it highlights in red every instance of this word in the whole code, so I was wondering whether or not it was possible to do the following :
-> selecting a block (I mean a {})
-> selecting one word in this block
-> using the red highliting thing to select at once every instances of this word in the selected block
-> changing at once all these instances for an other word
This would be practical to copy/paste huge pieces of code and I am pretty sure codeblocks can do this but I can't find how.
If you know if it is possible and can tell me I would be thankful. =)
Thanks for your help.
Alpha:
This is not exactly what you are asking about, but the Code Snippets plugin and/or the Abbreviations plugin may help with some of your requests.
tokapi:
Ok thank you I will have a look at these
Pecan:
The keymacs plugin may be more helpful.
http://forums.codeblocks.org/index.php/topic,9980.msg70445.html#msg70445
You could mark the area to be modified, then issue a macro that replaced the desired word in the marked area.
thomas:
Notepad++ lets you do such cool things, I've wished for Code::Blocks to work as well as that in the past.
You can Ctrl-select several independent locations and start typing, and it will insert into each loaction, replacing the original. You can Alt-select an entire column and start typing, and it will write into each line within the selection... which is totally cool e.g. when you need to manually build a list of strings from #defines in a header.
Navigation
[0] Message Index
[#] Next page
Go to full version