Skip to content

Commit

Permalink
init neovim and tweak layout
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Sep 25, 2024
1 parent 5eeb7e5 commit c584396
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 26 deletions.
40 changes: 40 additions & 0 deletions src/content/blog/neovim-wrapper/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Neovim wrapper from scratch
pubDate: 2024-09-25T09:38:41Z
summary: TODO
draft: true
---

What if told you, that you can have a portable Neovim configuration, that runs
on any system that has Nix? And that you only need a single `nix run` command to
execute it, without having to clone your `.config/neovim` and install your
plugins?

In this tutorial, I want to guide you how to write your own Neovim wrapper from
scratch, in the same spirit as
[Linux for Scratch](https://www.linuxfromscratch.org) (I haven't actually read it).
Wrapping Neovim, means that we create a new "fake" `nvim` executable, which
calls the original one, with different flags or environment variables. Neovim
has different flags that we can use for configuration, for example `-u
/path/to/init.lua` to a different place. If we create our wrapper with Nix, we
can use a complete suite of software (plugins, extra apps) that wrap Neovim
itself, making it self-contained in the `/nix/store`.
Then, you can take your wrapped Neovim to any machine, and simply `nix run` or
`nix shell` will give you your whole installation.

There are already multiple abstractions that wrap Neovim:

- [Nixpkgs's wrapper](https://nixos.org/manual/nixpkgs/stable/#vim)
- [NixVim](https://github.com/nix-community/nixvim)
- [Minimal Neovim Wrapper](https://github.com/Gerg-L/mnw)

My response to these: I'll teach you how to make your own wrapper, so you know
what is going on under the hood.


## The big idea

## Native plugin loading

## (Optional) Make your init.lua a plugin itself

9 changes: 0 additions & 9 deletions src/content/blog/nix-tuto-3/index.mdx

This file was deleted.

9 changes: 0 additions & 9 deletions src/content/blog/nix-tuto-4/index.mdx

This file was deleted.

13 changes: 5 additions & 8 deletions src/pages/blog/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ const { Content, headings } = await entry.render();
import Base from "../../layouts/Base.astro";
import Footer from "../../components/Footer.astro";
const file = `src/content/${entry.collection}/${entry.id}`;
import TOC from "../../components/TOC.astro";
---

Expand All @@ -35,13 +33,13 @@ import TOC from "../../components/TOC.astro";
<TOC headings={headings} />

<div id="content-wrapper" class="flex flex-col items-center">
<main class:list={["main-container", (entry.data.draft ? "draft" : null)]}>
<!-- <main> -->
<div class:list={["main-container", entry.data.draft ? "draft" : null]}>
<main>
<Content />
<!-- </main> -->
</main>

<Footer file={file} />
</main>
</div>
</div>
</div>

Expand Down Expand Up @@ -85,13 +83,12 @@ import TOC from "../../components/TOC.astro";
border: 2px solid red;
box-sizing: border-box;
}

</style>

<style is:global>
.subtitle {
display: flex;
gap: .5rem;
gap: 0.5rem;
}

.subtitle p {
Expand Down

0 comments on commit c584396

Please sign in to comment.