is there a way to globally change back fonts (size and type) to the original?
too many paste…!
I’m not sure if I’m understanding you correctly, but two places where you might want to change:
- Bike > Settings > Editor … and then click the “Reset Typography” button to reset font and related size and spacing settings
- To remove bold/italic/etc from pasted content you can select those rows in Bike and use the menu Format > Clear Formatting
Can you expand ?
What is the context,
and the problem that you are trying to solve ?
You are pasting into Bike ?
Or copying from Bike and pasting elsewhere ?
I pasted into Bike from different sources…
and the problem that’s arising ?
I have then all fonts different because every pasted element retains its formatting
Presumably the font and font size don’t vary (Bike uses only one body text font and size at a time, as far as I understand, plus a monospaced font for code) but if you want to shed formats like bolding, strikethrough etc, you can purge the clipboard of rich text, and replace it with plain text only, for example with a Keyboard Maestro Paste as plain text
macro like:
Paste as plain text.kmmacros.zip (2.5 KB)
In which the clipboard is reduced to a plain text version by the following script:
Expand disclosure triangle to view JS source
return (() => {
"use strict";
// Recopy any plain UTF8 in the clipboard,
// dropping other formats.
ObjC.import("AppKit");
const main = () =>
either(
alert("Reduce clipboard to plain text only")
)(
message => message
)(
fmapLR(copyText)(
clipTextLR()
)
);
// ----------------------- JXA -----------------------
// alert :: String => String -> IO String
const alert = title =>
s => {
const sa = Object.assign(
Application("System Events"), {
includeStandardAdditions: true
});
return (
sa.activate(),
sa.displayDialog(s, {
withTitle: title,
buttons: ["OK"],
defaultButton: "OK"
}),
s
);
};
// clipTextLR :: () -> Either String String
const clipTextLR = () => {
// Either a message, or the plain text
// content of the clipboard.
const
v = ObjC.unwrap(
$.NSPasteboard.generalPasteboard
.stringForType($.NSPasteboardTypeString)
);
return Boolean(v) && 0 < v.length
? (
Right(v)
)
: Left("No utf8-plain-text found in clipboard.");
};
// copyText :: String -> IO String
const copyText = s => {
// ObjC.import("AppKit");
const pb = $.NSPasteboard.generalPasteboard;
return (
pb.clearContents,
pb.setStringForType(
$(s),
$.NSPasteboardTypeString
),
s
);
};
// --------------------- GENERIC ---------------------
// Left :: a -> Either a b
const Left = x => ({
type: "Either",
Left: x
});
// Right :: b -> Either a b
const Right = x => ({
type: "Either",
Right: x
});
// either :: (a -> c) -> (b -> c) -> Either a b -> c
const either = fl =>
// Application of the function fl to the
// contents of any Left value in e, or
// the application of fr to its Right value.
fr => e => "Left" in e
? fl(e.Left)
: fr(e.Right);
// fmapLR (<$>) :: (b -> c) -> Either a b -> Either a c
const fmapLR = f =>
// Either f mapped into the contents of any Right
// value in e, or e unchanged if is a Left value.
e => "Left" in e
? e
: Right(f(e.Right));
// MAIN()
return main();
})();
Thanks, but…
pasting should not vary default font an font size, isn’t it…?
Not clear to me how that can really happen in Bike, which can only display one body font and one monospaced code font at a time, and only one font size (with bold italic etc variations)
Can you show us a screenshot of what you mean ?
It’s not bringing in a font, or a size, from the source.
It looks as if the second stretch of text is interpreted by Bike as code.
Is it being pasted into a Bike row that is formatted as a code block ?
(Format > Row > Code Block
)
Select All (⌘A), followed by Format > Row > Body
should clear that.
If the clipboard contains rich text, formatted as Code, then the Paste as Plain Text
macro (above) may be what you need.
no,
only clear formatting does the trick…
still my question remains
pasting should not vary default font an font size, isn’t it…?
vary default font and font size
It doesn’t.
The only difference is between Bike’s body text and code text displays.
thanks
I’ll take care
If you are copying monospaced
material from elsewhere, I think Bike will assume, on a rich text paste, that it is to be treated as Code-formatted text
.
As long as your Bike cursor is in unformatted material, or a blank body line, Bike’s
Edit > Paste > Paste and Match Style
(⌥⇧⌘V)
should bypass the mapping of:
copied in source monospace
, topasted in Bike as code
.
You can try copying the three lines above, from should to code
, and then pasting them into Bike both ways:
- ⌘V
- ⌥⇧⌘V (
Edit > Paste > Paste and Match Style
)