I fell that the highlight in vim is not as powerful as I want. such as "&&","||" these can not be highlighted. I know it can be changed by cpp.vim but I don not know how to do it. Can someone tell me how to do it? Thank you
If default highlight options does not suits you, try some custom plug-in before trying to write your own, most of plug-ins are located on github e.g.
https://github.com/octol/vim-cpp-enhanced-highlight
Maybe you should start with one on vim plug-in managers first e.g.
https://github.com/VundleVim/Vundle.vim
Related
Does anyone know of a plugin where I can get the breadcrumbs of a file I am working on.
Lets say I am working on app/controllers/admin/crs/abc, So I can see this info at the top or start of the window.
I am using ember and due to pod structure its hard to know which file I am working as all of them have different folders but same names.
Simply edit your user preferences and add
"show_full_path": true
and the full path of the file will appear in Sublime's titlebar when the file is active.
Compare with the setting (OS X):
to without it:
I know this is an old question but still, I think this is an interesting Package that not many people know of.
On top of #mattdmo answer, you might even want to check the breadcrumbs for a nested structure (pretty much like you'd do in VS Code): just install Breadcrumbs for Sublime Text. Not as cool, but it works ok.
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.
I use the Eclipse CDT for C development and I automate many mundance tasks using regexes. I have built up a set of quite complicated regexes that I use a lot which I have ended up keeping in a text file. Every time I want to use one of my commonly used regexes I have to copy the find and replace expressions into the find/replace dialog fields (separately) before using it. This can be very time consuming. Does anyone know of a plugin which would allow me to store and select from named fjnd/replace favourites that I can then apply to code in the editor?
The "Find" and "Replace" dialogs have a memory. If you use a regex, it is saved in this memory and you can select it later using the drop-down menu in each of "Find" and "Replace".
Besides from this, I don't think there's a plugin to do what you want to do...
i am writing (using C++ and GTKmm) a simple photo browser that is available on GitHub:
https://github.com/jjkrol/ZPR
Currently i am working on creating a button, which will allow user to open currently displayed photo in external editor (for example GIMP). Because of this, i have two questions:
Are there any examples of using Gtk::AppChooserDialog class? I couldn't find any and it's hard to start working on choosing the editor without them.
Most important question - i am thinking about a way to launch an application with photo in command line. The only solution that comes to my mind is using system() call to do something like this: system("gimp /path/to/current/photo.jpg"); , but it is probably not the best way of doing this. Anybody knows a better way? I would like to port my application to Windows someday and a more portable way would be great.
Thank you very much in advance.
Instead of system, you might want to use Glib::spawn_command_line_async. There are other similar functions that gives more control if you need it.
For examples, you might want to look the source code of an application like glom.
Thank you very much for answers, gpoo and ergosys! In the end i decided to use Gio::Appinfo as it looks more OOP-like. If anyone would face the same problem - this is what i have end up with:
Glib::RefPtr<Gio::AppInfo> editor = Gio::AppInfo::create_from_commandline("gimp",
"GIMP", Gio::APP_INFO_CREATE_SUPPORTS_URIS);
Glib::RefPtr<Gio::File> photo = Gio::File::create_for_path(
(*currentPhoto)->getPath().string());
editor->launch(photo);
Of course choosing the editor with Gtk::AppChooserDialog is not yet implemented.
I have a simple question (that I don't seem to be able to answer),
I am a new VIM/Linux user, and since I do c++ development I decided to install the C.VIM plugin to speed up my development time. The problem is, it says in the plug-in (c++) menu that to do a switch statement I have to write \ss (for me the leader is ",", so it's ",ss") but when I do this it just puts me in insert mode and nothing happens. I know the plugin is well set up because when I open a new c++ file it generates a comment box where I can give the description of the program.
I would love it if I would be able to use the shortcuts, because using the menu just losses the point of using vim.
Oh and please, just keep in mind that I am new to vim, I still have hard time figuring out what means <c-r> + TAB (which is, if i'm not mistaking "ctrl-r <tab>"), so if you could just try to explain the solution clearly without to much jargon I would appreciate it. (while i'm here, does anyone know of a good vim tutorial where I could understands all of the vim jargon, thanks!)
I appreciate all the help.
I use this cheat sheet:
http://www.worldtimzone.com/res/vi.html
Please add the below line to .vimrc and
helptags ~/.vim/bundle/c.vim/doc
Note: I have pointed to my c.vim doc and I use bundle, it may differ for you :)