8
Show and Tell: Neovim SOTD Plugin (sub.wetshaving.social)

I had the day off today, so I hacked together a port of the SOTD emacs plugin that @PorkButtsNTaters666@sub.wetshaving.social uses.

It's still a pretty rough implementation, but I wanted to share the repository here in case others who use Neovim might want to help me kick the tires. I'm fully aware that this is a niche within a niche, but you miss 100% of the shots you don't take!

I know there's some cleanup that needs to happen, and the config file format could use a bit more thought, but it works well enough for now. If anyone feels compelled to use it I'd welcome any feedback either here or on the repo itself.

The code is hosted on GitHub here.

top 9 comments
sorted by: hot top controversial new old
[-] walden@sub.wetshaving.social 3 points 1 month ago

Cool! I can't try it right now and I don't use neovim, but I'll try to remember to give it a shot when I get home next week.

[-] snooting@sub.wetshaving.social 3 points 1 month ago

That’d be awesome. Let me know if you have any issues getting set up!

[-] absenth@sub.wetshaving.social 2 points 1 month ago* (last edited 1 month ago)

Lazy doesn't appear to be loading the plugin, although it's installed. Perhaps I'm doing something daft?

Related SOTD.lua Config

[-] snooting@sub.wetshaving.social 1 points 1 month ago* (last edited 1 month ago)

Oh, it looks like I failed to document a pretty important step.

You currently need to define the SOTDCreate editor function somewhere, I have mine defined in .config/init.lua:

vim.api.nvim_create_user_command("SOTDCreate", function()
  require("sotd").create_sotd()
end, {})

This is not ideal and is a rough edge that should be fixed. I'll take a look today.

[-] absenth@sub.wetshaving.social 2 points 1 month ago

Excellent, the plugin now fires as expected. I'll give it a shot for tomorrow's SOTD post. Thanks!

I didn't think about going and looking for your dotfiles, I'm sure I would have found this had I looked. :)

[-] snooting@sub.wetshaving.social 1 points 1 month ago

I pushed up a change that wraps this up in the plugin creation, so it should no longer be necessary.

You'll also want to update your config to prevent lazy loading (since we want this plugin to be loaded immediately when nvim is opened):

{
    "snooting/sotd.nvim",
    dependencies = {
        "nvim-telescope/telescope.nvim",
        "nvim-lua/plenary.nvim",
        "b0o/schemastore.nvim",
    },
    lazy = false,
    config = function()
        require("sotd").setup({
            -- any config options
        })
    end,
}

[-] absenth@sub.wetshaving.social 2 points 1 month ago

Wait... did someone say.... Neovim.... and SoTD in the same sentence?!?!?!

[-] snooting@sub.wetshaving.social 1 points 1 month ago

It works well enough for now, but I'd love to get more eyes on it!

[-] absenth@sub.wetshaving.social 2 points 1 month ago

I'm making some progress on setting up my den.json

this post was submitted on 07 Nov 2024
8 points (100.0% liked)

WetShaving

728 readers
12 users here now

This is a community of enthusiasts, hobbyists and artisans who enjoy a traditional wet shave: brush, soap, and safety or straight razor. We are a part of the WetShaving community found on Reddit, Discord, and IRC.

New subscribers welcome!

Please visit our wiki, which is always and forever a work in progress.

🪒 Check out these alternative front-ends for this server:

https://gem.wetshaving.social/ - a nice modern interface

https://old.wetshaving.social/ - designed to look like old.reddit.com

Our sister Mastodon instance is https://wetshaving.social/.

🪒 Track the uptime of our various services here:

https://uptime.splettnet.com/status/wetshaving

🪒 Community Rules

Rule 1 - Behaviour and Etiquette
Rule 2 - Content Guidelines
Rule 3 - Reviews and Disclosure
Rule 4 - Advertising
Rule 5 - Inappropriate Content
Rule 10 - Moderator Discretion

founded 2 years ago
MODERATORS