Difference between editor.addAction() and editor.addCommand() and their use case in Monaco Editor - difference

I am new to Monaco Editor, and found two examples on the official website playground:
Adding a command to an editor instance
Adding an action to an editor instance
After checking the code i am a little bit confuse, seems like an action is the advanced version of a command? The addCommand() only supports a shortcut to trigger it, while the addAction() can trigger it with shortcut, right click menu and command palette.
So what is the use case of using addCommand() and addAction()? To me, they have some functionality overlapped.

Related

Manual markers for code folding in RubyMine

In RubyMine, is it possible to insert manual fold markers (like vim or emacs)?
I want to automatically fold a very large hash whenever I open a file. It's available in IntelliJ.
Yes. Rubymine has the same function like IntelliJ.
Select any code region you like, press option+command+T on a mac or some other similar keys binding on windows (I haven't a win install right now). Also you can do this from menu: Code -> Surround With....
To go to any custom folding, press option+command+. on mac, or from menu: Navigate -> Custom Folding....

Visual Studio-like autocomplete in Vim

Coming from Visual Studio, I've grown accustomed to having automatic autocomplete when I type a non-alphanumeric character:
At this point in time, if I press space (or ), ;, etc.), Visual Studio will assume I want public and will insert it for me.
I'd like this functionality in Vim. The default autocomplete is close (pressing
Ctrl+P while in Insert mode), but I'd like to have the autocomplete dropdown open automatically.
I tried out the AutoComplPop plugin, which pops open the options dropdown automatically, but also requires the user to press Enter to actually insert the selection:
Is there a plugin that provides Visual Studio-style autocomplete functionality? Or is there a way to configure Vim's default autocomplete to behave in this manner?
Just to be clear, I'm not asking about the suggestions provided by Vim's autocomplete (I've found plenty of documentation about adding custom dictionaries), but rather the mechanics of the autocomplete itself.
Unlike <Down> and <Up> which only move down and up the popup menu, <C-n> and <C-p> also insert the selected suggestion so you can just keep typing (a <space>, a .…) without having to press <CR>.
For what it's worth, I've forked AutoComplPop to add PHP and JavaScript support and just hacked in support for the kind of interaction you want.
Fear not citizens, enter YouCompleteMe: finally a good, intelligent code completion plugin for Vim. It's free, fast and will save you lots of time. Couple YouCompleteMe with Supertab and you'll be even more of a coding machine than you already are in Vim. source
https://github.com/Valloric/YouCompleteMe

QtCreator opens links in new split

There is an option in QtCreator that makes it open a new split when you do CTRL + click on some function, Class, etc (even if it's in the same file). I activated it long time ago but I can't remember where it is in the UI to disable it. It's really annoying when I'm using a small screen.
I'm using QtCreator 3.0.0
I think it is in Options -> Text Editor -> Display. The setting is called Always open links in another split
Ctrl+Alt+click/ Ctrl+click works on qtcreator 4.8.2. With this shortcut, you can dynamicly switch which way you prefer to open the link.

Is it possible to replace the windows explorer context menu with something other than a menu?

I would like to write an application/extension that would replace the default explorer right-click context menu with something other than a menu, preferably a custom window. Is this possible, and if so, how?
I haven't tried it myself, but implementing a shell extension that subclasses the explorer window seems like the way to go. The following CodeProject article talks about a shell extension with a keyboard hook. It should be possible to adapt this to intercept the mouse and WM_CONTEXT messages:
Shell Extension with Keyboard Hook

How do I edit work items in the Visual Studio 2008 xml editor?

I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.
I don't have TFS but I know in regular VS there is an Open With... option in most items' contextual menu that even let you change the default editor. Very useful when you are tired of the Designer opening instead of the Code file on Windows forms.
Ah, looks like you have to go to File->Open and click the down arrow next to the Open button to "Open With" the xml editor. If someone wants to copy and paste this, free accepted answer :P
As per Coincoin's answer, this feature is also great for setting the default editor for ASPX. If you want to go to the Code Editor most often, then this is a default you'd want to change.
Reading this - I think perhaps you don't realize - that there is no need to edit the XML - in fact it is very difficult to do so. The graphical designer will actually let you change the Work Item type, adding new fields, changing workflow, rules etc.
The only reason to change the XML is if there's a bug in the Process Editor (the tool that gives the graphic designer). I have done extensive modifications of Work Item types and only had one instance where I had to change the XML.

Resources