When searching (across files) or finding (within files), if you have regular expressions enabled and enter a certain character (backslash, opening paren, etc) it displays a drop-down box with hints in.
I don't need these hints; they get in the way of the rest of the dialog, and the stupid drop-down hijacks my home/end keys.
However, I can't find any preferences for disabling it - is there some hidden way to turn them off which I'm not aware of?
Alternatively, if I need to modify the source and rebuild, what files do I need to edit, and can I do it in a way that doesn't prevent upgrading?
(Eclipse Galileo 3.5)
I didn't find any obvious way to prevent the "content assistance" in that search field.
So what I usually do is: prepare the search expression in any editor I want, and copy-paste it in said search field.
A bit cumbersome, but it works nicely enough for me.
The goal: avoid this kind of situation.
(Eclipse Helios 3.6)
Note: according to bug 259592, the auto-completion is disabled by default in Eclipse Helios 3.6.
ctrl+space is available. A lightbulb is there to remind you that completion help is possible in this field.
Related
I got some legacy projects, with a source code encoding of IBM437/CP437. They need to be encoded that way at the moment, so please refrain from recommending a switch to utf-8.
So far I have unfortunately not found exactly what I need.
I experimented a lot and searched for several hours, yet my best workaround is the following:
While having the project opened in solution explorer, right click -> open with -> C++ Source Code Editor (with encoding).
In this huge dropdown I can choose the file encoding I need OEM United States - Codepage 437.
This is exactly what I need, but preferably automatic / persistent.
In the "Open With" window, the "C++ Source Code Editor (with encoding)" can also be set as default. This is a step in the right direction already, yet not at the right destination! With this setting, every time I open one of the files, I still need to use the dropdown and select the correct codepage every single time!
If anyone have anidea how to get this to work automatically, this would be great!
Most of the search results are about saving files in specific codepages, rather than opening them.
I tried playing around with .EditorConfig, yet it seems to support only like 5 codepages.
Also looked into the VS extensions and tried some. The FileEncoding extension looked promising, but it seems to just use .EditorConfig below the surface, since it's limited to the same few codepages.
Side note: I would even be perfectly fine with my Visual Studio opening all files in this codepage (for editor). So if someone knows a hack in that direction, it would be good too.
For example if I change the whole system codepage via registry keys:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP=437 (this is usually default for Western Europe)
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP=437 (ANSII Code Page)
It might work too, yet it's super dirty and system wide. Therefore I would rather live with the manual selection every time...
Also I could live with a shortcut, switching to the desired codepage. I used this approad in notepad++ for quite some time and got used to it. There I had a shortcut, e.g. ALT+X, switching to OEM US.
To summarize this up:
My perfect solution would be similar to the Open With -> C++ Source Code Editor (with encoding) workaround, but without having to select the codepage every single time!
In eclipse C++ (with CDT), I would like to find all C++ references of the selected text. Ideally with the following constraints:
accessible via keyboard shortcut
a working set can be selected to restrict the search
I do NOT need to right click on my working set directory in Project Explorer > Index > Update with Modified Files, so that search results are relevant
Currently, I know:
Ctrl+Shift+G : but it searches in the whole project which is just huge. For those who know Visual Assist Plugin in Visual Studio, it is more or less the equivalent of shortcut Alt+Shift+F except Visual Assist indexer seems really faster to me, and I have never been bothered by the latency before.
Ctrl+H, then Enter : cool but if I can skip the Enter, and have a direct shortcut somehow, it would be just better
So, I have three questions:
Have you got this issue, in a big project with thousands of files, that the indexer gets in a wrong state (it is not in a running step who could explain that, it just seems wrong), so that if you modify a file, a next references search shows weird results, except if your right click on a directory in Project Explorer > Index > Update with Modified Files ? I tried to play around with Window > Preferences > C/C++ > Indexer but had not luck to improve that.
Is it possible to have a shortcut for Ctrl+H, then Enter ?
If not, is it possible to record/tune some kind of macro to avoid repeating these uncomfortable and distracting steps ?
Thanks,
Eclipse details:
Eclipse Version: Luna Service Release 2 (4.4.2)
CDT Version: 8.6.0.201502131403
Try to find "References in Project" instead of in the whole workspace. If you have several projects in your workspace, the search is slower than in only one project. First try References > In Project from the context menu to see if this command works well enough for you.
If you are satisfied with it, assign a hot key in menu Windows -> Preferences > General > Keys. Filter by text "References in Project", select the item with "Source" category. Change its hot key below and change "When" field to "C/C++ Editor".
I made a simple regex search in Netbeans 7.3 on Windows (using Ctrl+F):
\{\{.*?\}\}
The results get highlighted correctly and the question is - how to extract highlighted text search results? Let it be copying to clipboard, saving as file or whatever else.
Is there any method doing this?
Maybe someone has any suggestion of alternative quick approach to such task in Netbeans? (or other editor)
What OS are you running? If OS X or Linux, read on!
I'm not sure about automatically copying the highlighted results to the clipboard, but I do workaround this quite a bit as well.
The easiest way to accomplish this for me without leaving NetBeans is to simply open a built in terminal window through Window>Output>Terminal (in 7.2.1) - I then navigate to my project, and run the RegEx that I built in the Find feature with my tool of choice. In fact, I use the built in terminal for this type of quick stuff in NetBeans quite a bit. If running Linux, using clipboard tools like xsel (http://linux.die.net/man/1/xsel) in combination with a built in terminal emulator can allow for devising some nice workflow shortcuts within IDEs if you are more comfortable working/coding at a terminal. Note that built in terminal emulators like the one in NetBeans is likely not going to play nicely with cut/copy/paste using the mouse, for various reasons that I won't get in to here.
As far as a built in/extension based solution for something like this, it would be helpful! I am not aware of one.
Hope this workaround helps in the meantime.
One of my favorite features of Eclipse is the ability to open a caller/callee hierarchy of a method.
By default, the view shows calls to/from classes that are outside of my codebase... which I don't usually care about.
There is an option to filter out specific package names I don't want, but I need to do the opposite... to filter out all packages except the one I want. What is the appropriate regex to use here to "match all strings except those that start with com.mycompany.?"
I had the same problem lately and exploring the options of the Call Hierarchy led me to the Search In option. It is activated by clicking on the triangle
The filtering options are pretty simple and effective:
It appears that "Filter Calls" uses glob syntax for filter patterns, not regular expressions. You can't specify something that should not match with glob patterns. Sorry.
It is not exactly what you are looking for, but it is an alternate solution. Take a look at nWire for Java. It is a code exploration plugin. Among many other things, it will present the call hierarchy. However, it will only show calls which originate from your own code, so it should fit your needs.
Another approach is to open the 'Type Hierarchy' view's View menu, select 'Select Working Set' and select an existing or new working set that only includes the project you're currently interested in (create one just for this purpose if necessary, e.g. called 'TypeHierarchyFilterWorkingSet').
I just did this using Eclipse Indigo, by the way, not sure whether the other versions have something similar.
After "Open Call Hierarchy" right click on the root of the results and select under "References" or "Declarations" the project you interest in:
One solution (though somewhat brute force) is to remove the other code from Eclipse's reach. Either put them into separate workspaces, or, if you sometimes do need them in one workspace, close the other projects when you don't want to see them.
You could try to add a parameter to the method, than all calls will be shown as error on rebuild.
you could filter out org., net., java.* and so on. This (in my case) reduces the list enormously
I was going to create the C++ IDE Vim extendable plugin. It is not a problem to make one which will satisfy my own needs.
This plugin was going to work with workspaces, projects and its dependencies.
This is for unix like system with gcc as c++ compiler.
So my question is what is the most important things you'd need from an IDE? Please take in account that this is Vim, where almost all, almost, is possible.
Several questions:
How often do you manage different workspaces with projects inside them and their relationships between them? What is the most annoying things in this process.
Is is necessary to recreate "project" from the Makefile?
Thanks.
Reason to create this plugin:
With a bunch of plugins and self written ones we can simulate most of things. It is ok when we work on a one big "infinitive" project.
Good when we already have a makefile or jam file. Bad when we have to create our owns, mostly by copy and paste existing.
All ctags and cscope related things have to know about list of a real project files. And we create such ones. This <project#get_list_of_files()> and many similar could be a good project api function to cooperate with an existing and the future plugins.
Cooperation with an existing makefiles can help to find out the list of the real project files and the executable name.
With plugin system inside the plugin there can be different project templates.
Above are some reasons why I will start the job. I'd like to hear your one.
There are multiple problems. Most of them are already solved by independent and generic plugins.
Regarding the definition of what is a project.
Given a set of files in a same directory, each file can be the unique file of a project -- I always have a tests/ directory where I host pet projects, or where I test the behaviour of the compiler. On the opposite, the files from a set of directories can be part of a same and very big project.
In the end, what really defines a project is a (leaf) "makefile" -- And why restrict ourselves to makefiles, what about scons, autotools, ant, (b)jam, aap? And BTW, Sun-Makefiles or GNU-Makefiles ?
Moreover, I don't see any point in having vim know the exact files in the current project. And even so, the well known project.vim plugin already does the job. Personally I use a local_vimrc plugin (I'm maintaining one, and I've seen two others on SF). With this plugin, I just have to drop a _vimrc_local.vim file in a directory, and what is defined in it (:mappings, :functions, variables, :commands, :settings, ...) will apply to each file under the directory -- I work on a big project having a dozen of subcomponents, each component live in its own directory, has its own makefile (not even named Makefile, nor with a name of the directory)
Regarding C++ code understanding
Every time we want to do something complex (refactorings like rename-function, rename-variable, generate-switch-from-current-variable-which-is-an-enum, ...), we need vim to have an understanding of C++. Most of the existing plugins rely on ctags. Unfortunately, ctags comprehension of C++ is quite limited -- I have already written a few advanced things, but I'm often stopped by the poor information provided by ctags. cscope is no better. Eventually, I think we will have to integrate an advanced tool like elsa/pork/ionk/deshydrata/....
NB: That's where, now, I concentrate most of my efforts.
Regarding Doxygen
I don't known how difficult it is to jump to the doxygen definition associated to a current token. The first difficulty is to understand what the cursor is on (I guess omnicppcomplete has already done a lot of work in this direction). The second difficulty will be to understand how doxygen generate the page name for each symbol from the code.
Opening vim at the right line of code from a doxygen page should be simple with a greasemonkey plugin.
Regarding the debugger
There is the pyclewn project for those that run vim under linux, and with gdb as debugger. Unfortunately, it does not support other debuggers like dbx.
Responses to other requirements:
When I run or debug my compiled program, I'd like the option of having a dialog pop up which asks me for the command line parameters. It should remember the last 20 or so parameters I used for the project. I do not want to have to edit the project properties for this.
My BuildToolsWrapper plugin has a g:BTW_run_parameters option (easily overridden with project/local_vimrc solutions). Adding a mapping to ask the arguments to use is really simple. (see :h inputdialog())
work with source control system
There already exist several plugins addressing this issue. This has nothing to do with C++, and it must not be addressed by a C++ suite.
debugger
source code navigation tools (now I am using http://www.vim.org/scripts/script.php?script_id=1638 plugin and ctags)
compile lib/project/one source file from ide
navigation by files in project
work with source control system
easy acces to file changes history
rename file/variable/method functions
easy access to c++ help
easy change project settings (Makefiles, jam, etc)
fast autocomplette for paths/variables/methods/parameters
smart identation for new scopes (also it will be good thing if developer will have posibility to setup identation rules)
highlighting incorrect by code convenstion identation (tabs instead spaces, spaces after ";", spaces near "(" or ")", etc)
reformating selected block by convenstion
Things I'd like in an IDE that the ones I use don't provide:
When I run or debug my compiled program, I'd like the option of having a dialog pop up which asks me for the command line parameters. It should remember the last 20 or so parameters I used for the project. I do not want to have to edit the project properties for this.
A "Tools" menu that is configurable on a per-project basis
Ability to rejig the keyboard mappings for every possible command.
Ability to produce lists of project configurations in text form
Intelligent floating (not docked) windows for debugger etc. that pop up only when I need them, stay on top and then disappear when no longer needed.
Built-in code metrics analysis so I get a list of the most complex functions in the project and can click on them to jump to the code
Built-in support for Doxygen or similar so I can click in a Doxygen document and go directly to code. Sjould also reverse navigate from code to Doxygen.
No doubt someone will now say Eclipse can do this or that, but it's too slow and bloated for me.
Adding to Neil's answer:
integration with gdb as in emacs. I know of clewn, but I don't like that I have to restart vim to restart the debugger. With clewn, vim is integrated into the debugger, but not the other way around.
Not sure if you are developing on Windows, but if you are I suggest you check out Viemu. It is a pretty good VIM extension for Visual Studio. I really like Visual Studio as an IDE (although I still think VC6 is hard to beat), so a Vim extension for VS was perfect for me. Features that I would prefer worked better in a Vim IDE are:
The Macro Recording is a bit error prone, especially with indentation. I find I can easily and often record macros in Vim while I am editing code (eg. taking an enum defn from a header and cranking out a corresponding switch statement), but found that Viemu is a bit flakey in that deptartment.
The VIM code completion picks up words in the current buffer where Viemu hooks into the VS code completion stuff. This means if I have just created a method name and I want to ctrl ] to auto complete, Vim will pick it up, but Viemu won't.
For me, it's just down to the necessities
nice integration with ctags, so you can do jump to definition
intelligent completion, that also give you the function prototype
easy way to switch between code and headers
interactive debugging with breaakpoints, but maybe
maybe folding
extra bonus points for refactoring tools like rename or extract method
I'd say stay away from defining projects - just treat the entire file branch as part of the "project" and let users have a settings file to override that default
99% of the difference in speed I see between IDE and vim users is code lookup and navigation. You need to be able to grep your source tree for a phrase (or intelligently look for the right symbol using ctags), show all the hits, and switch to that file in like two or three keystrokes.
All the other crap like repository navigation or interactive debugging is nice, but there are other ways to solve those problems. I'd say drop the interactive debugging even. Just focus on what makes IDEs good editors - have a "big picture" view of your project, instead of single file.
In fact, are there any plugins for vim that already achieve this?