Fakevim replaces everything instead of one at a time replacement (:%s/A/B/gc) - qt-creator

I am using Fakevim in Qt Creator 4.5.0. One of my most frequently used commands in normal vim is :%s/exprA/exprB/gc . However, in Fakevim, this works just like :%s/exprA/exprB/g - it replaces everything, and doesn't let me scan through and choose which replaces to carry out.
I Googled this topic, and couldn't find a similar bug report, or setting that I need to change in Qt Creator. Am I missing something?

Unfortunately, FakeVim doesn't support c substitution flag. It ignores any unrecognized flag. That's why in FakeVim :%s/exprA/exprB/gc works same as :%s/exprA/exprB/g.

Related

How to add a kit to Qt Creator from the command line, or other programmatic manner? [duplicate]

SO!
Let's say I have a number of settings (GCC compiler 9.3.0 built from source, as the distribution I have to use has a very old one, along with environment setup) for a new Kit in QtCreator.
I have managed to setup an environment for compilation and execution of compiled binaries, and made a script to make it work (like qmake -nocache -recursive/make/sudo make install, direct execution of g++, and other stuff).
One thing that script can't do at the moment, is that it cannot create a kit for QtCreator with new compilers and environment being set as required, so after running a script, its user has to go through setting it up himself through GUI, which is bad, because this can cause misconfiguration.
This thing I'm trying to create is going to be used by around ~200 people in my company, so leaving readme.txt with instructions just doesn't go well enough for me - I don't want running around fixing missing "{" and "}" in Environment description in created Kits, and other stuff.
Are there ways to create Kits for QtCreator automatically from command line? Maybe, there's some files to edit?
I've looked into this one a few years back (I wanted to do something similar for registering Buildroot toolchains automatically in QtCreator), and I was unable to find an off the shelf solution. So i think there are 2 ways to implement this:
a) Implementing a command line utility the manipulate the ~/.config/QtProject/qtcreator/{toolchains,profiles}.xml files. Maybe by (re)using the existing C++ implementation within QtCreator, or just re-implement it ie. in Python. Back than I didn't start to work on this as there was no real business need.
b) Switching to qbs, as qbs has support for setting up toolchains from the command line ( see: https://doc.qt.io/qbs/cli-setup-toolchains.html)
If you decide to go with solution a), please let me know and maybe we can partner up to implement it.
Check out the command line sdktool bundled with QtCreator:
The SDK tool can be used to set up Qt versions, tool chains, devices
and kits in Qt Creator.
There still is a lot of knowledge about Qt Creator internals required
to use this tool!
I haven't tried it yet, but I did find the executable under Tools/QtCreator/libexec/qtcreator subdirectory of the Qt Creator installation directory. ./sdktool --help works for me under Linux.

What does BII_IMPLICIT_RULES_ENABLED do when switched on or off in CMakeLists.txt?

I was wondering about the BII_IMPLICIT_RULES_ENABLED flag which I had switched off in one of my CMakeLists.txt files, in order to get an OpenGL related block to compile on a Mac, following a suggestion from biicode. This setting is still there and everything works perfectly, but I would like to find out more about it. Could someone explain what it does exactly?
Thanks!
BII_IMPLICIT_RULES_ENABLED activates the addition of system libs to the target that has included certain headers. For example, if your code contains an:
#include "math.h"
And you are in *nix systems, then the library "m" (libm) will be added to your target via TARGET_LINK_LIBRARIES.
You can see the headers that are processed in your cmake/biicode.cmake file, in the HANDLE_SYSTEM_DEPS
My recommendation: Put it to False whenever possible, and handle the required system libs yourself, exactly what you have done. It is something that will be deprecated soon, or at least set to False by default to new projects. This option sometimes causes troubles, if something fails or there is a bug in biicode.cmake, e.g. in the past it tried to add libm to targets also in windows. It will be gradually deprecated and probably substituted by some CMake macros hosted (as in http://www.biicode.com/biicode/cmake) that could be used by users if they decide to, but not automatically as it is done now.

How to add an object file to every link

There is a bug in RHEL5's gcc-4.3.2 with which we are stuck. As a work-around we have extracted the missing object and put it in an object file. Adding this object file to every link makes the problem go away.
While adding it directly to LDFLAGS seems like a good solution, this doesn't work since e.g. libtool cannot cope with non-la files in there.
A slightly more portable solution seems to be to directly patch the gcc spec to add this to every link. I came up with
*startfile:
+ %{shared-libgcc:%{O*:%{!O0:/PATH/TO/ostream-inst.o}}}
where ostream-inst.o is added to the list of startfiles used in the link when compiling a shared library with optimizations.
Trying to compile boost with this spec gives some errors though since its build directly sets some objects with ld's --startgroup/--endgroup.
How should I update that spec to cover that case as well, or even better, all cases?
Go through this URL Specifying subprocesses and the switches to pass to them and GCC Command Options
If this help you, thats great.
I know this is not the answer you want to hear (since you specified otherwise in your question), but you are running into trouble here and are likely to run into more since your compiler is buggy. You should find a way of replacing it, since you'll find yourself writing even more work-around code the next time some obscure build system comes along. There's not only bjam out there.
Sorry I can't help you more. You might try simply writing a .lo file by hand (it's a two-liner, after all) and insert it into your LDFLAGS.
If it is a bug of GCC 4.3, did you try to build (by compiling from sources) and use a newer GCC. GCC 4.6.2 is coming right now. Did you consider using it?

Tlib.exe (Borland / Embarcadero) doesn't handle paths properly that contain hifen-minus symbols, what can I do?

When I try to execute something similar to this line below:
tlib.exe /C mylib.lib
+-obj\Release\lib-10\src\object\objectFile.obj
I get this output:
TLIB 6.2 Copyright (c) 1987-2010 Embarcadero Technologies, Inc.
Warning: '.\obj\Release\objectFile.obj' not found in library
If I remove the "lib-10" manually and put the objectFile.obj at the "obj\Release\src\object\" dir it works fine.
What can I do?
At the website there are no useful information about this. If there is no workaroud I will try this manual solution. Just to clarify: tlib.exe is my only choice.
Thanks
Recent versions of Tlib will handle properly quoted paths with -/+ on the command line, but older versions do not. If the IDE or your shell isn't properly quoting these paths, your best bet is to use a different path.
I would discourage use of paths containing those characters. I know it's a remnant of times past, but many console applications grew out of those legacy times and still have the old constraints.

Is it possible to se a macro in .viemurc for ViEmu?

I am using the ViEmu plugin for VS2008.
I was wondering if there is a way to set a macro in the .viemurc file, so I don't have to redo it every time I start up VS.
I know that it can be done in regular Vim via:
:let #s="0ftwwy$bp"
This will set a macro on register 's' for example.
Doing the same in .viemurc so far just got me an error message.
Someone just answered the same question here.
Right now ViEmu doesn't support setting macros in the .viemurc.
Unfortunately multi-key mappings are not supported yet either.

Resources