Atom code editor - insert html comment - atom-editor

I'm aware of the shortcut (Mac) CMD+/ to comment out (HTML style) a line. Is there a shortcut or a way of doing the following. When I press a keybinding, the comment tags are inserted where the cursor is and the cursor gets moved inside the tags to write a comment (x):
<!-- x -->

Try inserting two hyphens and pressing TAB. It should expand to a full comment block with the cursor inside. It is a snippet.

Select the code you want to comment out and press Ctrl (or Command) + /

Related

How to add curly brackets and indent after element in CSS through autocompletion?

Is it possible to configure the editor that when you type a tag like:
body
and hit enter/tab, the editor will autocomplete it to:
body {
}
and indent the selection to where the first property would be typed?
I've looked into Editor/Codestyle/Stylesheets/CSS but found nothing.
Yes. A few different options:
Type body { and hit Enter. With default settings the IDE will insert missing }, add a new line and auto indent.
This is controlled by options at "Settings/Preferences | Editor | General | Smart Keys".
Type body and hit Ctrl + Shift +Enter (or whatever other shortcut you may have there in your Keymap for Code | Code Completion | Complete Current Statement action).
Write your own snippet (using Live Templates) that once expanded will replace the trigger code by inserting the snippet instead.
Lets assume that you have selected bb as the abbreviation for this snippet. Then typing bb and hitting Tab (or whatever other expand key you may select for this) will inert the whole block at once.

Render page breaks in DevExpress RichTextEdit

I want to be able to add and remove page-breaks to a RichEditControl element.
I understand that it's possible to add the page break by pressing Ctrl + Enter, but it's impossible for the user to see the page break and remove it, as it currently looks like it's a simple new line.
I tried to use the DXRichEditFormattingMarkVisibilityOptions to display a separator, thinking it would display the page break, without luck:
<d:RichEditControl ActiveViewType="Simple"
ShowBorder="False" Background="{x:Null}"
AutoSizeMode="Vertical" LayoutUnit="Document"
CommandBarStyle="Empty" BarManager="{TemplateBinding BarManager}">
<d:RichEditControl.FormattingMarkVisibilityOptions>
<d:DXRichEditFormattingMarkVisibilityOptions Separator="Visible"/>
</d:RichEditControl.FormattingMarkVisibilityOptions>
</d:RichEditControl>
Is there any way to render the page break in the RichEditControl and let it be easy to be removed by the user?
To display the Page Break character, you need to execute a command that display all hidden characters (such as paragraphs, spaces and tabs) and force these other characters to be hidden back, letting just the page break being displayed.
var command = new ToggleShowWhitespaceCommand(_richEditControl);
command.Execute();
Then you can apply this to the style of the control or alter directly via code:
<d:RichEditControl.FormattingMarkVisibilityOptions>
<d:DXRichEditFormattingMarkVisibilityOptions HiddenText="Hidden"
ParagraphMark="Hidden" Space="Hidden" TabCharacter="Hidden"/>
</d:RichEditControl.FormattingMarkVisibilityOptions>

Atom - disable single key binding

How can I disable a single key binding such as ctrl-alt-= in Atom?
I'm using the QWERTZ keyboard layout, so that I execute pane:increase-size when I type a '\'.
Open settings with File > Settings
Click Keybindings
Filter the list by typing ctrl-alt-= in the search box.
Click the clipboard icon next to the shortcut. This will copy the shortcut definition to your clipboard.
Click the hyperlinked text your keymap file.
Paste in the contents of the clipboard.
Replace 'pane:increase-size' with the value 'unset!'
Now ctrl-alt-= will not do anything.
EDIT: 'unset!' was previously null, see this atom discussion for details.
EDIT2: To fix issues with many non-QWERTY keyboard layouts, check out the keyboard-localization package for Atom.
Fix from #Monkey worked, here's the code from my keymap.cson for fixing backslash.
'atom-workspace atom-text-editor:not([mini])':
'ctrl-alt-[': 'unset!'
EDIT:
I'm using the QWERTZ keyboard layout.

Bootstrap switch with own text

I’d like to be able to add a LOCK / UNLOCK behaviour on the checkbox using twitter bootstrap. I found a similar sample at boostrap-switch.org at the section of Label Text. In this example they have used ON-TV-OFF, Similarly I want to give my own text in the place of ON, OFF. Like UNLOCK-Username-LOCK.
LOCK should be disappeared by clicking on UNLOCK then output should be like XXX-LOCK
UNLOCK should be disappeared by click on ON text then output should be like UNLOCK-XXX
How can I do this with bootstrap?
It's a Github repository. Go to /build/js and in the bootstrap-switch.js change the string in the following:
html = "ON";
It's the line 35 of the js file.
Similarly change the string in:
html = "OFF";
i.e. line 47.
This might not be exact same thing as boostrap-switch.org, but I have done it using fadeTo() property of jquery.
Here is the jsfiddle output link.

vs2010 - shortcut for surrounding a String by double quotes

I used to work with a developer who, selects a text in aspx page and applies a keyboard shortcut to enclose it in double quotes.
Eg: runat=server. when i select server and press ctrl+somekey, it should be runat="server"
Could someone tell me what is the keyboard shortcut, i tried googling a lot, but couldnt find one..
Currently we are overhauling a page, and need this badly...
Thanks in advance.
As far as I know this is a setting in Visual Studio which enables you to immediatelly place quotes when you type attribute and press equals sign or if you type a few letter and press CTRL+Space. This will autocomplete the attribute and place quotes. In order to enable the quotes click on Tools then Options. If it is not checked, check Show all settings. Expand Text Editor, then HTML and click on Formatting. On the right side enable Insert attribute values quote when typing and Insert attribute value quotes when formatting
Format selection: ctrl+k, ctrl+f
I also have Tools > Options > HTML > Formatting > Insert attribute value quotes when formatting checked.
I think you should try this with the replace function
search : runat=server
replace: runat="server"
The developer may have been using a refactoring tool such as CodeRush or Resharper. Have a look at this link for how you may be able to do something similar without extra tools.

Resources