Author Topic: How to invoke autocomplete 'keywords' (variables) on save?  (Read 2585 times)

Offline zkey

  • Single posting newcomer
  • *
  • Posts: 8
How to invoke autocomplete 'keywords' (variables) on save?
« on: October 26, 2006, 12:37:04 pm »
Hi,

Is it possible to configure C::B to invoke autocomplete for all keywords (or a subset of them) contained within the file when that file is saved?
(I want to make C::B autocomplete e.g. the 'today' or 'now' keyword on save)

Thanks in advance :)

zkey

p.s. The keywords I mean are those defined in Settings > Editor > Abbreviations. Maybe it can be done a different way ..

Using: C::B Version 1.0 revision 3145 (2006-10-25 18:03:49) gcc 3.4.5 Windows/unicode

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2121
Re: How to invoke autocomplete 'keywords' (variables) on save?
« Reply #1 on: October 26, 2006, 02:39:40 pm »
http://forums.codeblocks.org/index.php?topic=4110.msg32396#msg32396

Here is a case where searching for anything with a $ in it will get you nowhere.
Searching for today or now will get you everything.

Anyway, maybe the above link will help

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: How to invoke autocomplete 'keywords' (variables) on save?
« Reply #2 on: October 26, 2006, 03:38:58 pm »
Enter the WiKi, type in "shortcuts" in the search field, press search and the first hit is this:
http://wiki.codeblocks.org/index.php?title=Keyboard_Shortcuts
Scroll down and see... you'll find CTRL+J.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How to invoke autocomplete 'keywords' (variables) on save?
« Reply #3 on: October 26, 2006, 04:55:22 pm »
I think what he is asking for is something different... he wants those keywords to be magically replaced when a file is saved, every time. Much in the sense of what a source control system does when you update.

The only keyword substitution that is supported by Code::Blocks is the one described by Pecan and Morten, and it only works for the current word (thus, you cannot simply type 3 dozen keywords and hit Ctrl-J once, it doesn't work that way). This is deliberate, too, as it might otherwise terribly mess up your sources.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline zkey

  • Single posting newcomer
  • *
  • Posts: 8
Re: How to invoke autocomplete 'keywords' (variables) on save?
« Reply #4 on: October 27, 2006, 05:44:12 pm »
I exactly ment what Thomas said. One solution I found in one of the links you posted is the ability to use svn-vars which are autoreplaced on commit, it's something that I will probably use. Anyway, thank you all :)

zkey