this post was submitted on 21 May 2024
11 points (92.3% liked)

Linux 101 stuff. Questions are encouraged, noobs are welcome!

1053 readers
1 users here now

Linux introductions, tips and tutorials. Questions are encouraged. Any distro, any platform! Explicitly noob-friendly.

founded 1 year ago
MODERATORS
 

Sometimes adding a blank character helps with formatting. For example on Lemmy, it helps me separate lines of text if I insert a blank character between other lines. Currently, do that by copy-and-pasting the blank character from elsewhere. Here is an example

Is there a way I can do this on Linux easily from the keyboard? I am using KDE Neon and have the compose key enabled so that I can easily type uncommon characters like , ñ, and é easily.

all 11 comments
sorted by: hot top controversial new old
[–] DarkNightoftheSoul@mander.xyz 5 points 5 months ago (1 children)

Most people don't seem to know this, but you can in fact do line breaks on lemmy, too:

For each line you want to break
add two spaces to the end of the line
then press enter just once

[–] BackOnMyBS@lemmy.world 2 points 5 months ago (1 children)
[–] DarkNightoftheSoul@mander.xyz 3 points 5 months ago* (last edited 5 months ago)

Another one for ya: when quoting block text with the character ">", put a ">" on the blank lines between paragraphs to continue a single block quote.

so not

like this

instead

like this

formatting on lemmy is frankly bad, at least documentation of

[–] Zachariah@lemmy.world 3 points 5 months ago (1 children)

Is a blank character different from pressing the spacebar?

[–] moody@lemmings.world 9 points 5 months ago

Yes, but it mostly depends how it's interpreted by a given program. Some will interpret it as a character being there, but it may take up no space on the screen, for example. Some will show a space, but won't count it as a space character so it can bypass some text restrictions. Some may show different spacing. Many will also simply not accept them as valid characters.

[–] Ephera@lemmy.ml 3 points 5 months ago (1 children)

I believe Lemmy removed your blank character?
At least, it doesn't seem to show up when I try to select it or navigate around it with arrow keys, nor does the formatting look unusual.

It's usually possible to type Unicode characters by just inputting their codepoint/number. This kind of varies between desktop environments, but how it works for GNOME (and possibly others) is described here: https://help.ubuntu.com/stable/ubuntu-help/tips-specialchars.html.en#ctrlshiftu

Alternatively, you can also change your keyboard layout to include it. On X11, you'd do that with Xmodmap. Looks like there are some alternatives for Wayland, but I don't know what to recommend there.

Well, and another option would be to write a script which copies that character to your clipboard and then create a keyboard shortcut to call that script.
For copying to the clipboard, you can use xclip on X11 and wl-clipboard on Wayland.

[–] BackOnMyBS@lemmy.world 2 points 5 months ago

Thank you very much! I'll try this when I get home tonight.

[–] kamiheku@sopuli.xyz 2 points 5 months ago

FYI you can "separate lines" by simply adding two newlines by pressing Return twice.

Like this.

[–] RedditWanderer@lemmy.world 2 points 5 months ago

I'm pretty sure that two end lines will give you the space on lemmy.

Like on Reddit

[–] RoyalEngineering@lemmy.world 2 points 5 months ago

My go-to would be AutoHotKey on Windows. Maybe this Linux version would work? https://github.com/phil294/AHK_X11

Looks like you can get a script that replaces

; hotstrings - expand 'btw' to 'By the way' as you type
::btw::By the way
; hotkeys - press winkey-z to go to Google
#z::Run http://google.com

You might be able to use whatever character you're using instead of {Space}:

F19::{Space}