Assigning often used code blocks to Keyboard Shortcut (DreamWeaver) - dreamweaver

have any of you dreamweaver users had cases in which you are programming and finding yourself to use a particular piece of code over and over...
and over? See, I use all day the following pieces of code:
<?=__("
&
")?>
Question:
Is there anyway you programmers have found out a way to assign your favourite/most used code into a keyboard shortcut? I would love to put assign my two things to something like
Ctr+Shift+Num7 = [whatever programming code]
Ctr+Shift+Num9 = [whatever programming code]
Any suggestions would be very awesome as I know this is very specific...
I have tagged this question ad dreamweaver & adobe-dreamweaver only, this way hoping to find folks who have programming experience and have come across this real-world issue.

Dreamweaver allows you to assign keyboard shortcuts to Snippets.
Window -> Snippets
Create a snippet (click + button at bottom of the panel, or right click within the panel and choose New Snippet), in this case it appears that you want to have "wrap selection". Place the snippet content into the appropriate areas, give it a name an option description.
Edit -> Keyboard Shortcuts (or right-click in the Snippets panel select Edit Keyboard shortcuts.
Create a new keyboard shortcut set if have don't already have a custom set.
In the short cuts editor, make sure to select Snippets in the Commands list.
Select your snippet (it may be nested within a "folder", so drill in to the snippets locations).
Click + by Shortcuts
Enter your keyboard combination by hitting the key combo you want to use for this snippet.
Click OK
test your new snippet keyboard combo.

Related

Accessible hotkeys for superscript and subscript

I want to add a feature of making text super- or subscript to a WYSIWYG text editor in my web application and I need to set up hotkeys for it. Popular editors like Microsoft Word use Ctrl+Shift+= for superscript and Ctrl+= for subscript, but I can't use those since they trigger browser native zoom. Of course, I have separated buttons for super- and subscript and I will add hints to them, but I'd still like to make hotkeys as convenient as possible. Is there another common combination for these features?
Alternative Hotkeys
Ctrl + . for superscript and Ctrl + , for subscript are acceptable alternatives. (full stop / period and comma). They are the defaults set for Google Docs so familiarity will be reasonably high.
Accessibility Considerations
You cannot assume that any key is 'safe' as people may change their hotkeys to their preference.
For this reason you should always give people the option to change shortcut keys themselves in a settings menu (which should be easy to access).
You should also give people the option to toggle hotkeys on and off (yet again making the hotkey for that toggle customisable to their preference).
A lot of the time people come unstuck because they use a hotkey that overlaps with a screen reader hotkey and the hotkey doesn't work so make sure you consider the above before implementing hotkeys.
Also make it clear what hotkey is set for each item (to both sighted and screen reader users).

Moving between text and input and textarea areas without using mouse and closing panels

In the majority of programs and sites it is possible to switch between input and textarea fields by means of combinations of the Tab and Shift+Tab keys.
But in Sublime Text Tab — tabulation.
For example, for me open Goto Line Panel and console.
May I move between entry fields and my text also as in the majority of programs becomes by means of keyboard combinations of Tab and Shift+Tab? I know, what the Tab and Shift+Tab keys is needed for tabulation, but any combination of keys can be used to move between input and textarea fields.
Thanks.
TAB will not work but this can be achieved by series of shortcuts:
Opening line selector: Ctrl+G
Opening search: Ctrl+F
Going from search to founded string: Alt+Enter
Shortcuts above are available on Linux version. They may be different on Windows but they are there and can be found in online documentation.
With Sublime Text you can personalize your shortcut!
I found this guide on the official website and this "different but useful" question about it.
So you can create your own sort of switch with comfortable combination. Example:
alt+1 to go to search
alt+2 to go to the text
alt+3 to go to the bottom
...
this is also faster then the "tag way" because it is not cyclic!
i haven't tried it but as mentioned by Draco the commands to move exist so you can just make them more comfortable.

2 spaces indentation in google Docs

To prepare an exam, I have to learn coding using google docs rather than using an IDE. It may seem idiot or impratical but the teacher really insists on that. It seems that is the same thing as Google interviews for example...
So far, I really got used with using two spaces indentation (I hate using tab indendation). And I want to learn how can I do that quickly in Google docs. Is there a shortcut or a "tips" (add-on?) for that?
For example, if you have an "if-condition" starting at the position number 4 and you want to move to the following line, it can be really convenient to have the cursor position at 4. Then, you'll add two spaces to start your block at position number 6. (ALL the if block will have at least position 6). But in Docs, when you move to the following line, the cursor always start at the beginning of the line except if you use the tab indentation. And it's really shitting if you want to indent your code properly...
Do you have a solution for that please ?
I was facing the same problem.
To write Python code in google docs, my solution is:
Switch off auto-capitalization, auto-correction and smart quotes. And other auto-substitutions so that you may write code without docs like formatting.
To do this: Tools> Preferences and uncheck the above items. Screen shots attached below.
Set tab to two spaces.
Right-click on ruler on top of page. Add left-tab stop, an arrow will appear, move this tab stop to 2 spaces from left of ruler. Try adding tab in the current line and if the tab size is OK, save this formatting.
To save:
Format > Paragraph Styles > Normal Text > Update 'Normal Text' to match.
Last, to add color(synatx highlight), you may use 'code blocks extension'.
Click install.
Now, write code in docs, select the code in google doc, click on:
Add-ons > Code Block. A pop up opens up.
Choose language : 'python' for me.
Choose theme: 'atom-one-dark'
click Format.
The code looks much like IDE, and writing more code is easier too.
While I understand that sometimes a point can be made by making students do things in a way that might not seem logical, this one doesn't make any sense to me.
Students don't learn anything useful by pressing space twice instead of letting an editor or IDE do it for them.
I wonder, is it because he/she wants it delivered in Google Docs or because they want you coding that way? If it's the latter, you won't have to hide your workaround.
I can only suggest using a good text editor, I always use the excellent and free Notepad++, and copy and paste it to and from Google Docs. Your instructor will never know. In fact, I'd be hunting around to see of there was a way to access your code files directly in Google Docs from Notepad++, or to auto-sync a folder with Google docs.
Notepad++ has syntax colouring - which will save your life - and can be set to indent with tabs or spaces to whatever indent width you specify. If not using an IDE, I only use Notepad++.
Your instructor sounds like some I had, people who cross a line from being quirky but with a point to make to just being a dick. There is absolutely no point in telling a student to code only in Google docs. Google docs is a great thing, I love it, but it is by no stretch of the imagination a coding tool.
(I see that this is an aged thread, but I'll respond in case someone else with a similar issue - like this year's class for that course - comes looking for an answer.)
You could try (ab)using bulleted lists:
Insert a bulleted list
Right click on the bullet, select "More bullets..."
In the "Symbol" selection list, choose "Format & whitespace" and select one of the whitespace options as bullet char
Repeat for as many levels (of bullet sub-lists) as you think you may need in your program
Fix indentation to match whatever feels best for you
Every time you need to write a nested block, you will have to press "tab" only once, then bullet list level is kept and the indentation with it. To go back to the outer block, just press shift-tab.
However, IMHO it doesn't worth the trouble. Generally, interview question solutions are not that large and hitting spacebar a couple of times is not much of an overhead.
It's somewhat cumbersome but you can set as many tab stops as you want, and docs will move nested tabs to the next tab stop as well. For example:
You can add tab stops by right clicking on that tab bar where you want the tab stop to be and clicking Add left tab stop. You'll want to have all text in the document selected if you want the tab stop to apply everywhere.

What keyboard shortcut can i use without conflicts with modern browsers?

I'm developping a web application and i intend to use mouse and some keyboard shortcuts, and if possible, use modal keys (Ctrl / Shift / Alt).
I've noticed a lot a conflicts with modern browsers/OS. Here are some examples you may know:
Ctrl+S
Ctrl+F
Shift+R : refreshes the page on firefox
Alt+left click : moves a window on linux
Ctrl+J : opens the download tab in chrome
I can't find what shortcuts (with modal keys) i can use safely in my application. Is there a list somewhere of a rule to follow?
You could have a look at this, which is a rather exhaustive list of used shortcuts.
However your question has already been asked here and here and it seems there is no such list.
Try this:
http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
My suggestion would to throw something unique in the shortcut for example:
Say you needed to bookmark something quickly, chromes is ctrl+D, instead i would do ctrl+shift+m or ctrl+alt+m
Even still you might run into duplicate shortcuts, but going with something unique will give you the best results.
Hope this helps.

Visual Studio hot key - switch Find context/location

Is there a hot key to toggle the search context/location in the "Find"/"Find in Files" commands (Ctr+F and Shift+Ctrl+F respectively )? I'm talking about the drop down that asks where to search for example Current Project, Current Document, Entire Solution etc.
"Find" is probably my most used feature since working with markup and CSS very often I can't just F12 to a selector definition or Shift+F12 to Find Usages, a regular text search is really the only option and I want to make this as efficient as possible.
Yes, I can tab to it but this takes 6-tabs and if I do it fast, often get the count wrong and prematurely execute bad searches; so it's not cutting it.
If there isn't a hotkey how can I set one? Ctrl + F3 would work well since F3 is "Find Next"
Thanks
I'm not sure if there is a command in Visual Studio that does what you are looking for.
If there is one, you can set the shortcut key in the Tools\Options menu (Environment\Keyboard).
In the screenshot, I'm searching for all the VS command that contain "find". Perhaps one of these is what you need.
Then move to the Press shortcut keys textbox and choose your desired key binding.

Resources