Selecting styles by keyboard

Everything related to our flagship word processor.
Vanceone
Posts: 211
Joined: 2013-05-03 07:06:31

Selecting styles by keyboard

Post by Vanceone »

So Word has a nifty shortcut-- I think it's command option s or something-- wherein you can hit the shortcut key and immediately type, and it selects a style based on your text. Hit return or enter, and it applies the style. This enables mouse less style management.

Typically you can name your style something like "base_h" and just have to hit the letter h and it apples that style.

Does Nisus have that ability? I know you can assign styles to shortcuts, but I don't believe this flows across documents?
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Selecting styles by keyboard

Post by phspaelti »

Vanceone wrote:Does Nisus have that ability? I know you can assign styles to shortcuts, but I don't believe this flows across documents?
Correction: You can assign shortcuts to styles.
You can make these shortcuts up to three letters long. So for example if you assigned <cmd>BSH to your "base_h" style, you can then apply it with that key combination. (But you do need to use the command key. Or perhaps some other modifier combinations are possible?)

These shortcuts can conveniently be assigned in the style sheet, but that does not mean that they are not cross-document. Once assigned the shortcut will work like any other shortcut. In particular it will work in any document that has a style with the same name. Note that the shortcut does not transfer the style settings, so you would need to work via the style library, or similar mechanism to get the style consistent across documents. But on the flip side you can replace your style sheet with a different one having styles with the same names, and everything will continue to work. Only the look of your document will change.

If this is not good enough for you, it would be easy enough to write a macro that interprets a word to the left of the cursor as a style name, and then removes the name from the document and applies the corresponding style to the paragraph. But this macro would have to be specifically invoked (with some key combination, for example). Nisus does not (yet?) have any way to attach macros to its auto-complete "QuickFix" function.

And just a question/comment on that Word model. If what you describe is true, you can no longer have styles with simple names like "Normal" or "Heading", etc. or presumably every time you type such a name it will apply the style. (And delete the word!) Also multi-word style names will require underscores, or some such trick or you can't apply them that way either, I assume. If that's really how it works: Ugh! I think I'll stick with the Nisus model.
philip
Vanceone
Posts: 211
Joined: 2013-05-03 07:06:31

Re: Selecting styles by keyboard

Post by Vanceone »

Hmm. I think I wasn't quite clear.

In Word, you can hit the shortcut (Command option S, I believe, on mac--windows it's control shift s) and it puts keyboard focus into the style list. When you type, it filters the style list based on your typing. And it does it either full word (yes, you can type "normal" if you want, or at least 'nor' and if you only have one style starting with 'nor' it focuses on that), or you can append an underscore to your style name and add an abbreviation and just type the first letter or so of the abbreviation. Hit enter, and it applies the style. And boom, you are back into the document where you were, ready to go. No mouse required. No replacing of text, or deleting your styles or anything.

It's better than Nisus because Nisus makes you eat up and define a keyboard shortcut for every style, instead of every style available via the command shortcut.

What I'm looking for, really, is a way to select and apply styles--any style-- only with the keyboard; without using the mouse. I.E. be able to navigate the styles palette via keyboard. Instead its mouse only, as far as I can tell. In order to apply a different style, either you have had the foresight to assign a command key combination, or you use the mouse (involving several clicks, if your palette is not on the styles tab, I believe).

I wish you could arrow up and down inside the styles palette as well, just to maybe flip through and apply the style quickly, rather than clicking the mouse each time.

Also, another style question: So I occasionally have some documents where I need a complicated list pattern--like Article V.1 or something. That's fine, and easy to do. Problem is that it is inline. So the List number should be bold, all caps or whatever. And then, the first sentence is sort of a caption, and should be styled. And the sentences after that are normal.

Eg:

ARTICLE V.III The Duty of the Seller. The seller is responsible to make sure that all titles are clear and clean. Further, that all loans have been paid off.

How could you achieve something like the above via style and not manually?
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Selecting styles by keyboard

Post by phspaelti »

Vanceone wrote:Hmm. I think I wasn't quite clear.

In Word, you can hit the shortcut (Command option S, I believe, on mac--windows it's control shift s) and it puts keyboard focus into the style list. When you type, it filters the style list based on your typing. And it does it either full word (yes, you can type "normal" if you want, or at least 'nor' and if you only have one style starting with 'nor' it focuses on that), or you can append an underscore to your style name and add an abbreviation and just type the first letter or so of the abbreviation. Hit enter, and it applies the style. And boom, you are back into the document where you were, ready to go. No mouse required. No replacing of text, or deleting your styles or anything.

It's better than Nisus because Nisus makes you eat up and define a keyboard shortcut for every style, instead of every style available via the command shortcut.

What I'm looking for, really, is a way to select and apply styles--any style-- only with the keyboard; without using the mouse. I.E. be able to navigate the styles palette via keyboard. Instead its mouse only, as far as I can tell. In order to apply a different style, either you have had the foresight to assign a command key combination, or you use the mouse (involving several clicks, if your palette is not on the styles tab, I believe).

I wish you could arrow up and down inside the styles palette as well, just to maybe flip through and apply the style quickly, rather than clicking the mouse each time.
Ok. I misunderstood what you meant.

But I believe you can do this, although it is not quite the same idea. I believe there is some keyboard shortcut for the context menu, but I'm not sure (Where is Hamid, when you need him :) ) Anyhow with the context menu you can select paragraph styles by keyboard, but you do have to type "P" and then <right arrow> to get in the Paragraph Styles submenu of the context menu.
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Selecting styles by keyboard

Post by phspaelti »

Vanceone wrote:Also, another style question: So I occasionally have some documents where I need a complicated list pattern--like Article V.1 or something. That's fine, and easy to do. Problem is that it is inline.
Well there is the problem. Nisus currently allows only for numbering schemes where the number is at the beginning of the paragraph and set off with a tab character. This is a feature that the Classic version had, and we're still waiting on that one to be re-instated. :roll:
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Selecting styles by keyboard

Post by phspaelti »

Vanceone wrote:So the List number should be bold, all caps or whatever. And then, the first sentence is sort of a caption, and should be styled. And the sentences after that are normal.

Eg:

ARTICLE V.III The Duty of the Seller. The seller is responsible to make sure that all titles are clear and clean. Further, that all loans have been paid off.

How could you achieve something like the above via style and not manually?
Returning to this point once more; the auto numbering is limited in the way mentioned before. If your numbering consistently includes the text "ARTICLE", and you can live with a tab after the number ("V.III" in this case), then you can use a list style. You can attach this list style to a paragraph style and then the two will come together as one. You can apply bold to the number in the list style and that way only the number will be bold, and the paragraph will be normal.

For the "The Duty of the Seller" part which also needs to be bold you can use a character style. However the character style cannot be attached to the paragraph style, so you will either need to select is separately, or you can put the paragraph style and the character style specification into a macro. The macro would have only two lines: the first applies the paragraph style and the second applies the character style. Then instead of applying the paragraph style from the style menu, you would apply it via the macro menu (or a shortcut). When you reach the end of the bolded heading, you choose "Remove style" from the "Character style" menu. So that is as close as Nisus is going to get to automatic for this kind of thing.

If the tab after the automatic number is an unsurmountable problem, you could try a more macroized solution, where the macro would update your numbering. Again this would best be combined with the character style + paragraph style set-up described before. But it's really going to depend on what suits you best.
philip
Vanceone
Posts: 211
Joined: 2013-05-03 07:06:31

Re: Selecting styles by keyboard

Post by Vanceone »

Thanks for the help and advise, phspaelti!

Does anyone know the keyboard command for contextual menus? The manual doesn't have it, unless I missed it.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Selecting styles by keyboard

Post by martin »

Vanceone wrote:Does anyone know the keyboard command for contextual menus? The manual doesn't have it, unless I missed it.
I don't know of any keyboard shortcut to show the contextual menu, and this article suggests there isn't any such feature.
I wish you could arrow up and down inside the styles palette as well, just to maybe flip through and apply the style quickly, rather than clicking the mouse each time.
I'm thinking of two possible enhancements to help with this:

1. Allow the user to define custom keyboard shortcuts for intermediate menus. For example, let the user set a shortcut for the menu Format > Paragraph Style which would show the relevant submenu listing all the document styles. From there you could type to auto-select the desired style name.

2. Add a collapsed mode to the Styles palette that shows the document style list as a text entry field, which would allow autocompletion of style names. We already have this kind of collapsed mode for the Character palette, where the font list is shown as a text entry field. Of course we'd also need some way for the keyboard to throw focus to a particular palette.

What do you think about these possible solutions? Personally I prefer enhancement #1, since it allows other kinds of useful interactions.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Selecting styles by keyboard

Post by phspaelti »

martin wrote:
Vanceone wrote:Does anyone know the keyboard command for contextual menus? The manual doesn't have it, unless I missed it.
I don't know of any keyboard shortcut to show the contextual menu, and this article suggests there isn't any such feature.
Yeah, it seems so.

martin wrote:I'm thinking of two possible enhancements to help with this:

1. Allow the user to define custom keyboard shortcuts for intermediate menus. For example, let the user set a shortcut for the menu Format > Paragraph Style which would show the relevant submenu listing all the document styles. From there you could type to auto-select the desired style name.

Personally I prefer enhancement #1, since it allows other kinds of useful interactions.
This sounds good to me too.
While investigating this, I discovered that typing in a menu does not always seem to behave the way I would have thought. For example in the Format menu, if I type P the selection goes right down to Paragraph and skips Paragraph Styles. Typing P again does not choose any of the other menus. (But typing PP selects Remove Attributes and Styles!!) I would think that typing P repeatedly should select each P-menu in turn.
philip
NisusUser
Posts: 317
Joined: 2011-01-12 05:32:38

Re: Selecting styles by keyboard

Post by NisusUser »

martin wrote:1. Allow the user to define custom keyboard shortcuts for intermediate menus. For example, let the user set a shortcut for the menu Format > Paragraph Style which would show the relevant submenu listing all the document styles. From there you could type to auto-select the desired style name.
I like this proposed feature, too.
Vanceone
Posts: 211
Joined: 2013-05-03 07:06:31

Re: Selecting styles by keyboard

Post by Vanceone »

Well, I like both ideas, personally. Style application is so important that using the style palette would be nice, as it shows a bit of a preview of what the style actually does; whereas the submenu is just the name (and is cluttered with a lot of the auto styles, like Heading 9--very seldom used, for instance) Indeed, that is one of the reasons I think word allows you to subselect the styles with using say the number 9, because typing out "Heading 9" is worse than just using the mouse.

That said, quickly accessing submenus would be fantastic too.

It strikes me as a bit odd that Nisus cannot fully be controlled from the keyboard without turning on the system accessibility inspector. For a power program, I'd like to be able to do so. I'm used to the Terminal, so controlling via keyboard is quite nice.

I think that as long as Nisus has the palettes, we should be able to key over into it and use the keyboard to navigate all of them. Switch the palette view; key our command, switch back to whatever view we had, key back to the document and keep going.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Selecting styles by keyboard

Post by martin »

Thank you to everyone for your feedback.
phspaelti wrote:While investigating this, I discovered that typing in a menu does not always seem to behave the way I would have thought. For example in the Format menu, if I type P the selection goes right down to Paragraph and skips Paragraph Styles. Typing P again does not choose any of the other menus. (But typing PP selects Remove Attributes and Styles!!) I would think that typing P repeatedly should select each P-menu in turn.
This is a feature we get from Apple for free. I'm not sure what their rules are for auto-select behavior in the main menu, but I would guess that after you've typed two P's the autocompletion has accumulated to match "pp". If you don't have a menu item with such a prefix it skips to the next entry alphabetically, eg: "R" comes after "P".

This is not something we could easily or cleanly override.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Selecting styles by keyboard

Post by martin »

Vanceone wrote:Style application is so important that using the style palette would be nice, as it shows a bit of a preview of what the style actually does; whereas the submenu is just the name (and is cluttered with a lot of the auto styles, like Heading 9--very seldom used, for instance)
In Nisus Writer the style menu and style palette both only show styles actually in your document's stylesheet. This is as opposed to Word where it potentially shows you every style ever conceived. You can also edit the default set of styles (as added to every new document you create) by editing your Nisus New File template.
I think that as long as Nisus has the palettes, we should be able to key over into it and use the keyboard to navigate all of them. Switch the palette view; key our command, switch back to whatever view we had, key back to the document and keep going.
This point is well taken, and I'll also file it, thanks.
Vanceone
Posts: 211
Joined: 2013-05-03 07:06:31

Re: Selecting styles by keyboard

Post by Vanceone »

Time to revise this old thread. In the next update are we going to be able to tab over into palettes?
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Selecting styles by keyboard

Post by xiamenese »

My solution to this is to have a minimal Nisus New File, the only paragraph styles being 'Footer', 'Header' and Normal'—I've modified the latter as to font and size and made fully justified—together with the default four character styles, default 'Footnote' and 'Endnote', and default list styles.

Then I have set up a stylesheet for all of the documents I know I'm going to produce, including a generic stylesheet as a start for any other document I might suddenly need. I have also set up templates with boilerplate and styles for any short documents I produce regularly. But the way of working in NWP from scratch is to open a new file, and first off import the appropriate stylesheet. A dialog comes up saying there are duplicated styles and I overwrite the existing ones with those from the stylesheet and away I go.

I also use NWPs brilliant multi-letter shortcuts, so each of the styles has an easy to remember shortcut and I can set styles from the keyboard. I have the styles palette floating to the right of the main window, with the inspector opening on the left, so the rare styles for which I haven't set shortcuts are only a mouse-click away.

That said, my long documents start life in Scrivener, so I use colour to distinguish the paragraphs to which I want to apply given styles, then I can use the colour icon in the status bar to select all text in that colour and then simply apply the style through the keyboard shortcut.

Mark
Post Reply