tinymce creating quick responses / keyboard shortcuts - tinymce

I was wondering whether there is a way we can create "shortcuts" in tinymce so when typing a specific phrase, it'll change it to a full sentence from an array

The textpattern plugin can solve this for you:
https://www.tiny.cloud/docs/plugins/textpattern/
For example this could be in your configuration:
textpattern_patterns: [
{start: '--', replacement: 'β€”'},
{start: '//brb', replacement: 'Be Right Back'},
],

Related

TinyMce disable all possibilities to insert paragraphs

I need TinyMce to write Markdown with formatting options. Here I do not need paragraphs, simple <br> elements which can be reliably replaced to \n would be best.
To illustrate the problem, the following output was created after inserting the third line as a paragraph:
<p>## Heading<br />
Some Text</p>
<p>Some More Text</p>
I cannot think of an easy solution to find and replace incorrect paragraphs like the ones around the first block. Thus I want to turn off paragraphs completely.
I already found the configuration forced_root_block : '' to disable automatic creation of paragraphs for every line break. Here the solution is shown how to disable Shift+Enter. The last remaining puzzle piece is the styleselect-toolbar, which has a possibility to add paragraphs. I only found a solution how to add options to that toolbar, but not how to hide or remove.
Can someone help me how to hide the paragraph-style from the styleselect toolbar? Or maybe point out that I am missing an elegant solution which completely disables paragraphs in one step?
With Try-and-Error I changed the following part in the current themes theme.js, which hides the "Paragraph" button in the styleselect-toolbar:
var defaultStyleFormats = [
...
{
title: 'Blocks',
items: [
{// removed this block
title: 'Paragraph',
format: 'p'
},
{
title: 'Blockquote',
format: 'blockquote'
},
...
Removing part of the JS file was possible because we do not import it from npm but rather copied the code manually in our repository. So this solution might not apply to everyone.

Formatting text in snippet description field

It there any way to formatting text inside description field of a snippet?
Basic formatting like \n \t working fine but is there any way for example changing text color or something?
I don't think many people need this feature. If you want for example mark some snippet you can use emoji: πŸ“™πŸ“˜πŸ“—πŸ“•πŸ”΄πŸ”΅πŸ”ΆπŸ”·
"πŸ“—console.log": {
"prefix": "cl",
"body": [
"console.log($1)"
]
}

RubyMine reformatting

This is in the RubyMine IDE.
It seems really simple but I can't find a way to do it. I want to take a line
[:a, :b, :c]
and as part of the reformatting rearrange each value to one line like so:
[
:a,
:b,
:c
]
And assign a nice little keyboard shortcut.
Any idea how I do this? RubyMine documentation isn't great.
Not familiar with a way to use the IDE reformatter for this need.
But, you can achieve the rearrangement using the find an replace tool (CTRL + R).
Mark the regex checkbox.
In the find box look for space - ().
In the replace box, insert newline - \n\t.
Then hit Replace all - it should do most of the job.

How to Auto complete double quotation marks in notepad++

Im am using TextFX plugin in Notepad++ and all xhtml and html autocomplete values are opened. Html tags are completing with no problem but i want to insert double "" (quotation marks ) in one button press but only one " mark is occuring. How can i fix this?
Notepad V6.5.5:
In the "Settings" Menu > "Preferences" > "Automatic conclusion".
Then you can choose what is duplicated when you type.
Example: { [ "" ] }
etc.
You can use a plugin called XBrackets Lite
http://sourceforge.net/projects/npp-plugins/files/XBrackets%20Lite/

Search and replace macro in Netbeans

How do I record (or write) search and replace macro in Netbeans?
I want to record the actions I do in Ctrl+H dialog.
This is not possible (Netbeans 6.8).
The only field you can preset is the field "Find What". The other options stay unchanged.
Eventually, if you have a complex regexp to search, you can use the following tip :
caret-end-line insert-break "regexp" selection-begin-line replace remove-line
I ran into somewhat the same problem! Maybe this will ease it up a bit!
http://mrhaki.blogspot.com/2008/12/use-regular-expressions-for-search-and.html