![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 320
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
ctrl + 1 question
Ctrl + b forces you to select text first and this makes sense because sometimes you want to make bold only a word, not just the entire string between two <tag> pairs.
When putting the cursor anywhere in text enclosed by any tag pair you can convert that tag pair to <h1> and </h1>. It is not necessary to select the text between the tags first. Is there any snippet which can do the same thing? That is, without first selecting and highlighting the text? <p>This is a sentence.</p> converts to <h1>This is a sentence.</h1> The cursor can be anywhere inside of 'This is a sentence.' The entirety of the text does not have to be highlighted for the <p> to <h1> conversion when you hit Ctrl +1. Best regards, Pop |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Because a Heading is a phrase, not a single word out of one.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You are asking for a snippet to turn all text inside a tag bold?
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 320
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
Thanks for your replies. I stated the question unclearly. Ctrl + 1 converts to H1 when you put your cursor anywhere in the string; you do not first have to select all or portions of the string. This works differently than Ctrl + b which converts any selected portion of a string to bold. I would like to be able to put my cursor somewhere in a string, then convert the tags surrounding the string into tags of my choosing.
For example, if I put the cursor anywhere in 'Some string.' I can change <p> into <h1>. <p>Some string.</p> into <h1>Some string.</h1> In order to make some or all of 'Some string.' bold I must first select that portion before using Ctrl + b. This does not change any other tags. <p>Some string.</p> into <p>Some <b>string</b>.</p> I was hoping for a way to use, say, Ctrl + 4, to convert the tags surrounding a string when my cursor is anywhere within that string (without selecting text) into another pair of tags. <p>Some string.</p> into <Tag>Some string.</Tag> Best regards, Pop |
![]() |
![]() |
![]() |
#5 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,007
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Ctrl 4 ought to do heading level 4.
Consider adding or editing the style="whatever" in the p tag. IMO really <b>, <i>, <strong> and <em> should only be used for a word or part of a word. A paragraph <p> or heading <hx> should have any styles, size, margin, or font defined in the CSS. An aside. A heading shouldn't end with a period (full stop), usually either nothing, ? or ! Style guides differ on the : at the end of a heading. Last edited by Quoth; 11-12-2022 at 07:38 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Press Ctrl+alt+t and then ctrl+b the first will select the contents of the surrounding tag for you
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 320
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
Press Ctrl+alt+t and then ctrl+b the first will select the contents of the surrounding tag for you
__________________ Thanks for help, everybody. NOTE: Ctrl-Alt-t raises terminal in Linux and I was confused at this, but Ctrl-Alt-Capital-T selects everything in between tags. Could not find in 'keyboard shortcuts'. Is there a one-shot snippet which can convert any tag to another tag of your choosing? Thank you again for help. I learned a lot! Best regards, Pop |
![]() |
![]() |
![]() |
#8 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There I added ctrl+shift+t as well https://github.com/kovidgoyal/calibr...2abe40a00db3e6
or you can just disable the ctrl+alt+t global shortcut in your desktop settings. |
![]() |
![]() |
![]() |
#10 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
Quote:
I use ctrl+alt+t many times a day, for the terminal, so I think I'll keep that! |
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#12 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 320
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
Thanks to all.
Is there a one-shot snippet which can convert any tag to another tag of your choosing? |
![]() |
![]() |
![]() |
#13 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 320
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
|
How do you actually do the Ctrl-Alt-Capital-T sequence? On my Ubuntu box all I can get is the terminal. Tried Ctrl-Alt-Shift-T and it does nothing.
-------------- Yeah. It's tricky! I'm on 22.04 Ubuntu, so I can't say why that key-combo does not work for you. Hold down Ctrl-Shft-Alt-T at same time. When I do that it does not pull up terminal, but Ctrl-Alt-t does pull up terminal. Keyboard shortcuts requiring eleven or more simultaneous keypresses make me take off my shoes. But, you know, it's not bad at all to use four or five. You may (or may not) be younger than me and you may (or may not) recall that in years past the automobile 'headlight dimmer switch' was a foot-controlled button on the floor operated with your left foot. It is now, of course, located on a stalk on the steering wheel. Many Boomers have been injured by this needless transition because out of habit of foot-usage we kept getting our left foot caught in the steering wheel. Best regards, Pop |
![]() |
![]() |
![]() |
#14 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
|
![]() |
![]() |
![]() |
#15 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ctrl-R not working? | mbovenka | Calibre | 70 | 10-20-2020 08:34 AM |
Book view ctrl+v | rbruce1314 | Sigil | 25 | 05-15-2015 07:12 AM |
Ctrl-7 for <p> tags | phossler | Editor | 3 | 02-25-2014 05:40 PM |
Librarything using Ctrl-D in GUI | bwk | Calibre | 24 | 04-03-2012 11:34 AM |
iLiad No 'Ctrl' on iLiad?! | ericshliao | iRex Developer's Corner | 7 | 11-06-2008 06:12 PM |