Hotkeys and keyboard tricks

Post Reply
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Hotkeys and keyboard tricks

Post by kvichans »

Offer to share experiences on the use of keyboad. What tricks do we know?

My tricks:
1. [Win] More then 10 years i use in all win apps only one-key-shortcuts Ctrl/` to copy/paste instead two-keys-shortcuts Ctrl+C/Ctrl+Ins/Ctrl+V/Shift+Ins.
To do that i install AutoHotkey and add to autostarted my.ahk

Code: Select all

Ctrl:: Send, ^{vk43}    ; Ctrl = Ctrl-C = Copy.
`:: Send, +{Ins}	     ; ` = Shift+Ins = Paste
2. [Cud/Syn] My favorite commands
- Copy word or [expression] or 'expression' without selection (with Alt+Left in my keymap)
- Replace word or [expression] or 'expression' with clip (with Alt+Right in my keymap)
They allow to skip many keypressing when i want to copy/paste simple data.

3. [Cud/Syn] Finding and Replacing without dialog
- Find clipboard string: next/prev (with Alt+PgDn/Alt+PgUp in my keymap)
- Replace all occurrences of selected string, with clipboard string (with Shift+Ctrl+A in my keymap)

4. [Cud/Syn] Repeat last command(s).
- repeat last text command (with F1 in my keymap)
- run last command plugin (with F2 in my keymap)
- find, next (with F3 in my keymap)
Often i start a search, do something with found fragment by one command and then press
F3, F1, F3, F1, ... (if the command from core)
F3, F2, F3, F2, ... (if the command from plugin)
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

Hi Andrey,
kvichans wrote:Offer to share experiences on the use of keyboad. What tricks do we know?
Good idea; I hope others will chime in on this thread!
My tricks:
1. [Win] More then 10 years i use in all win apps only one-key-shortcuts Ctrl/` to copy/paste instead two-keys-shortcuts Ctrl+C/Ctrl+Ins/Ctrl+V/Shift+Ins.
To do that i install AutoHotkey and add to autostarted my.ahk

Code: Select all

Ctrl:: Send, ^{vk43}    ; Ctrl = Ctrl-C = Copy.
`:: Send, +{Ins}	     ; ` = Shift+Ins = Paste
So, every time the control key is pressed, the selection is copied to clipboard?
2. [Cud/Syn] My favorite commands
- Copy word or [expression] or 'expression' without selection (with Alt+Left in my keymap)
- Replace word or [expression] or 'expression' with clip (with Alt+Right in my keymap)
They allow to skip many keypressing when i want to copy/paste simple data.
Hmm, that's very interesting! I need to investigate more of the commands in cuda_ext!
Question: what does [expression] or 'expression' mean, and also "expression" or (expression)?
3. [Cud/Syn] Finding and Replacing without dialog
- Find clipboard string: next/prev (with Alt+PgDn/Alt+PgUp in my keymap)
- Replace all occurrences of selected string, with clipboard string (with Shift+Ctrl+A in my keymap)
That makes sense: use 2. above to quickly select/copy word, then use this to replace!
4. [Cud/Syn] Repeat last command(s).
- repeat last text command (with F1 in my keymap)
- run last command plugin (with F2 in my keymap)
- find, next (with F3 in my keymap)
Often i start a search, do something with found fragment by one command and then press
F3, F1, F3, F1, ... (if the command from core)
F3, F2, F3, F2, ... (if the command from plugin)
That's very cool! 8-) Much better than creating a macro for the simple task.
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

qwerky wrote:So, every time the control key is pressed, the selection is copied to clipboard?
Yes. But only if single key is pressed - any key combinations (like Ctrl+Enter) work without changes.
qwerky wrote:Question: what does [expression] or 'expression' mean, and also "expression" or (expression)?
Good question.
Algo scheme:
1. Caret is inside or near a word
Then the word will be used to copy/replace.
2. (Else) Caret is near a quote sign (and the sign is paired).
  2.1 Caret is inside of quoted data. Data without quotes will be used.
  2.2 Caret is outside. Data with quotes will be used.
3. (Else) Caret is near a bracket sign (and the sign is paired).
  2.1 Caret is inside of bracketed data. Data without brackets will be used.
  2.2 Caret is outside. Data with brackets will be used.

Mnemonic scheme.
Notation:
   abc    any word chars
   -       any not-word chars
   '        ' or "
   []       [] or () or {} or <>
   |        caret

Code: Select all

-ab|c-  abc|-  -|abc ==>  abc
 'a c'|    |'a c'    ==> 'a c'
'|-b-'      '-b-|'   ==>  -b-
 [a c]|    |[a c]    ==> [a c]
[|-b-]      [-b-|]   ==>  -b-
For hedging command "Copy word or [expression] or 'expression' without selection" shows extracted fragment in statusbar.
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
qwerky
Posts: 172
Joined: 21.10.2013 00:58

Post by qwerky »

kvichans wrote:
qwerky wrote:So, every time the control key is pressed, the selection is copied to clipboard?
Yes. But only if single key is pressed - any key combinations (like Ctrl+Enter) work without changes.
Ah, very good, I like that. Is it possible to have AutoHotkey send Ctrl-C only when the right Ctrl key (or Alt key) is pressed (not the left)?
qwerky wrote:Question: what does [expression] or 'expression' mean, and also "expression" or (expression)?
Good question.
<Explanation snipped>
Thanks for a very thorough explanation. Having now a good understanding, should be able to get good use from these features! :)
User avatar
kvichans
Posts: 203
Joined: 07.10.2012 05:45

Post by kvichans »

> Is it possible to have AutoHotkey send Ctrl-C only when the right Ctrl key (or Alt key) is pressed (not the left)?
Yes
CudaText 1.163, TC9.51x32, Win10x64(1920x1080)
Post Reply