You are here: PSPad forum > English discussion forum > Re: how to add keyboard shortcut for html tidy profile

Re: how to add keyboard shortcut for html tidy profile

#1 how to add keyboard shortcut for html tidy profile

Posted by: erkange | Date: 05/01/2017 17:49 | IP: IP Logged

Hello,

I have hundreds of file to use html tidy.
Instead of use mouse, i want to use keyboard shortcut.

I see below explanations in TiDyCFG.INI file. But i couldn't find how to make it.

; quick reference: tidy.sourceforge.net
; cesky preklad: www.pspad.com
;
; PROFILE SHORTCUTS
; to define shortcut for profile use format:
; [profile name*shortcut], e.g. [Reformat only*Ctrl+Alt+O]

image

Options: Reply | Quote | Up ^


#2 Re: how to add keyboard shortcut for html tidy profile

Posted by: pspad | Date: 05/01/2017 18:25 | IP: IP Logged

Click on the modify link in TiDy menu - You need to have access into folder where TiDy .cfg file is. If you installed PSPad into program files, run PSPad as administrator.

Choose or modify profile you want or add new profile
Profile configuration starts with [Section name] - name in square brackets followed by list of options.
You can create new profile, e.g. [My new profile] and add option by including shortcut into section name:
[My new profile*myshortcut]
list of options
...
...

If you want to add e.g. Shift+Ctrl+R shortcut to "Reformat only" menuitem, change:
[Reformat only]
to
[Reformat only*Shift+Ctrl+R]

Options: Reply | Quote | Up ^


#3 Re: how to add keyboard shortcut for html tidy profile

Posted by: erkange | Date: 05/01/2017 18:53 | IP: IP Logged

pspad:
Click on the modify link in TiDy menu - You need to have access into folder where TiDy .cfg file is. If you installed PSPad into program files, run PSPad as administrator.

Choose or modify profile you want or add new profile
Profile configuration starts with [Section name] - name in square brackets followed by list of options.
You can create new profile, e.g. [My new profile] and add option by including shortcut into section name:
[My new profile*myshortcut]
list of options
...
...

If you want to add e.g. Shift+Ctrl+R shortcut to "Reformat only" menuitem, change:
[Reformat only]
to
[Reformat only*Shift+Ctrl+R]

It is exactly what you told. but when i click Shift+Ctrl+R nothing happens
image

Edited 1 time(s). Last edit at 05/01/2017 18:54 by erkange.

Options: Reply | Quote | Up ^


#4 Re: how to add keyboard shortcut for html tidy profile

Posted by: erkange | Date: 05/01/2017 18:55 | IP: IP Logged

Btw, I am using portable version.

Edited 1 time(s). Last edit at 05/01/2017 18:58 by erkange.

Options: Reply | Quote | Up ^


#5 Re: how to add keyboard shortcut for html tidy profile

Posted by: erkange | Date: 05/04/2017 15:18 | IP: IP Logged

Hello,

I have installed non portable version but it works.
But it still doesn't work for portable one

Edited 1 time(s). Last edit at 05/04/2017 15:20 by erkange.

Options: Reply | Quote | Up ^


#6 Re: how to add keyboard shortcut for html tidy profile

Posted by: Stefan | Date: 05/04/2017 16:08 | IP: IP Logged

About "[Reformat only*Shift+Ctrl+R]"

That shortcut trick doesn't work for my portable PSPad not either.

 

Just FYI.
 

 

.

--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings

Options: Reply | Quote | Up ^


#7 Re: how to add keyboard shortcut for html tidy profile

Posted by: pspad | Date: 05/04/2017 21:43 | IP: IP Logged

Stefan:
About "[Reformat only*Shift+Ctrl+R]"
That shortcut trick doesn't work for my portable PSPad not either.

I just tested it - it doesn't depends of portable/installed version. I have portable too.

I modified TiDy configuration and add this shortcut.
I opened any HTML - this is important, the file must be from HTML family and press Shift+Ctrl+R. It calls TiDy and reformat HTML.
I closed PSpad, start it again (last used HTML was automatically open) and it works again without any problem.

What can cause this nonfunctional:
- tidy.exe doesn't exists in PSpad folder
- your file is not HTML (HTML multihighlighter, XHTML or any highlighter from multihighlighter scripts) - on the status bar you see highlighter name
- shortcut is assigned for something else - it isn't in default
- shortcut is assigned for code clips (html, php, ... ) call clips (Ctrl+Space) and look into menu settings / Clips hotkeys
- shortcut is assigned for any script - you must check script menu manually, cause I don't know which scripts you use

Options: Reply | Quote | Up ^


#8 Re: how to add keyboard shortcut for html tidy profile

Posted by: Stefan | Date: 05/05/2017 08:56 | IP: IP Logged

I can confirm that that was the culprit:

"Chosen shortcut is already assigned to another command"

.

So I tested just with an definitely unused key combination,
instead of searching for where the non-working shortcut is assigned.

 

This works for me on portable PSPad:

; PROFILE SHORTCUTS
; to define shortcut for profile use format:
; [profile name*shortcut], e.g. [Reformat only*Ctrl+Alt+O]
;
;[Reformat only]
[Reformat only*Shift+Ctrl+Ö]
indent:yes
indent-spaces:2

.

.

.

Solved for me, thanks for support.

.

.

--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings

Options: Reply | Quote | Up ^


#9 Re: how to add keyboard shortcut for html tidy profile

Posted by: Stefan | Date: 05/05/2017 09:28 | IP: IP Logged

I took a deeper look... just for fun and the record.

.

I searched all files for "Shift+Ctrl+R" with PowerShell:
(you can also use TotalCommander > Find Files > Find Text: Shift+Ctrl+R)

PS X:\PSPad> dir *.* -rec |%{gc $_}|Select-String "ctrl"|Select-String "shift"|Select-String "\+R"
[Retrieve |G Retrievecontents of this variable]*Shift+Ctrl+R
[Retrieve |G Retrievecontents of this variable]*Shift+Ctrl+R

.

(before be sure to have a "KeyMap.INI" in PSPad folder or execute
"Settings > Program Settings... > KeyMap > [Save to File]" first)

.

Result for me:

X:\PSPad\Context\AutoHotkey.def---copy.txt
;;; ==================================================================
;;; PSPad clip definition file for AutoHotkey Version 1.0.25.14
;;; Language: English
;;; AUTHOR(s) beardboy, GoGoGadgetScott
;;; VERSION: 1.1.1, 04/19/2004 - 02/08/2005
;;; ==================================================================
;
; --------------------------------------------------------------------
; PHPad hotkeys
; --------------------------------------------------------------------
[Retrieve |G Retrievecontents of this variable]*Shift+Ctrl+R
%§|%
[Label |G name of the label or hotkey label]*Shift+Ctrl+L
§|::
[Hotstring |G name of the label or hotkey label]*Shift+Ctrl+H
::§::|
;

.

.

.

--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings

Edited 1 time(s). Last edit at 05/05/2017 09:35 by Stefan.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2017 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák