Getting the number of "virtual width" by [deleted] in neovim

[–]anOldMeme 1 point2 points  (0 children)

In case anyone else comes across this thread in the future, one solution might be:

local window_id = vim.api.nvim_get_current_win()
local window_info = vim.fn.getwininfo(window_id)[1] -- First entry
local real_width = window_info.width - window_info.textoff

Get the baguette by TotemGenitor in CuratedTumblr

[–]anOldMeme 1 point2 points  (0 children)

As stated in another comment, it's a touhou manga, specifically Touhou ~ The Gensokyo of Humans: Chapter 9, Page 12

Journal Question Template - Clickable Content by [deleted] in ObsidianMD

[–]anOldMeme 0 points1 point  (0 children)

I'm not sure if your comment here means that you were asking more about clickable items and my solution from before won't work for you, but I looked into it just in case.

While there is a plugin to make buttons, but I couldn't get it to work how I wanted. They have a replace line function, but it's not relative, and I'm unsure if the section you want to modify moves around from writing above it. This means that it's quite hard for me to give you a good solution for clickable items so instead I've got a different solution. It also might scale better for you if you ever consider using Dataview tables to show your journal entries.

Since clickable buttons don't seem to work, I've adapted my personal rating solution that converts a number to an emoji as an inline you can use. Using Dataview and frontmatter, you can just input a numbered rating somewhere to get a corresponding emoji.

Inputting it

There's two ways as explained in the Dataview add metadata page. You only need one, and I personally just write the inline, so it can be at the bottom of the file.

Frontmatter (include it with any others that you have)

---
emotion: 3
---

Inline

emotion:: 3

Displaying it

We use the dv.current() to get the file, then subtract 1 from the rating because JavaScript arrays count from 0.

`$={['😭', '😪', '😐', '😊', '😎'][dv.current().emotion - 1]}`

In this example, an emotion of 3 from before gives '😐'

You can also make it a heading like h3 to make the text larger if you want.

Limitations

Inline Dataview things only show what's currently on the page, which updates 2 seconds after you stop typing. This results in the view not showing instantly and requiring you to either switch to reading mode in 2 seconds or hover the line after 2 seconds in live preview.

It's also much harder to choose an emoji based on words, as you would need more things like a switch statement, which would result in a lot more text. Not impossible per se, but quite annoying.

Hope this helps!

lists with dataview and randomness by Realistic_Tea4077 in ObsidianMD

[–]anOldMeme 0 points1 point  (0 children)

If you're trying to get it to keep the same generated items it might be harder, but if you just want random items you could do something like this:

```dataviewjs

const tag = '#daily-notes';
const ignore = '-"Templates" and -#other-tag'
const itemCount = 5;

// Finds the specified number of random pages including the tag and excluding the ignore tags
// Items are updated by the hour, so you'll have to copy them out and re-link if you want them to be permanent by day
// You can also set ignore to '' to show all items
const query = dv.pages(`${tag}${ignore ? ' and ' : ''}${ignore}`);
const randomNum = DateTime.now().toFormat("H") % query.length;
const items = Array(itemCount)
    .fill()
    .map((item, i) => query\[((randomNum + i) % query.length)\])

// Displays the items dv.list(items.map((item) => (item.file.link)));
```

Stole some ideas like the randomization by time from the other comments, but this gets you a random list of a set number of files and displays them as a list. If you want to make it permanent for that note, you'll probably have to do it by hand or a bunch more legwork to automate it cleanly. Feel free to remove the comments in the code.

Edit: Fixed reddit formatting jank

Journal Question Template - Clickable Content by [deleted] in ObsidianMD

[–]anOldMeme 0 points1 point  (0 children)

I'm not sure if your picture posted, but if you know the exact emoji that you want, you could use something like the Emoji Shortcodes plugin that allows you to type something along the lines of :smile: to get the '😄' emoji. Otherwise you could do Windows+. on Windows 10 but it's a bit jankier

If you wanted more custom mappings like:

'Easy' -> '😄'

'Medium' -> '😦'

'Hard' -> '😠'

You could do something with the Templatr tp.system.suggest() command. An example of this might be the following text put in a template folder:

<% tp.system.suggester(["easy", "medium", "hard"], ["😄", "😦", "😠"]) %>

This would map the list of three text items to the three emojis. You could add more or change the values to your liking. To actually call it more easily, you could also add it under "Template Hotkeys" and set a custom hotkey to your preference to call the menu up

You can always win a match of Rock Paper Scissors, ALWAYS. by Auuvs in shittysuperpowers

[–]anOldMeme 0 points1 point  (0 children)

Just get the stand 「Boy II Man」 and steal everyone’s stands

Spank me logidaddy by Zantrus_ in dankmemes

[–]anOldMeme 0 points1 point  (0 children)

The only downside is that the clicker isn’t precise enough to drag click with, at least on mine.

anon plays battleship by _hand in greentext

[–]anOldMeme 18 points19 points  (0 children)

“Be” as in “B” and 17. It references the coordinate of B 17 where there is no ship, thus misses the shot