vim

walterl 2022-09-01T22:05:59.243219Z

[Not Clojure related] How can I create a Neovim window that contains only a section of a file, identified by boundary regexes? I'm working on a large Markdown document, and would like to open one of the sections (`start=/^### Section/, end=/^### /`) in a separate window for reference. I'd like to edit, search and move around in that window without leaving that section. https://github.com/chrisbra/NrrwRgn is the closest I could find (and very neat!), but it prevents the source buffer from being modified while a narrowing window is open.

walterl 2022-09-01T22:13:53.037799Z

A simple solution could be to limit the cursor to a region (defined by start/end regexes) in a window

walterl 2022-09-01T22:20:08.811439Z

I guess it could be useful in large Clojure files too 🙂

Martynas Maciulevičius 2022-09-01T23:38:11.918289Z

Why not use FZF and search for lines in the current buffer?

walterl 2022-09-01T23:46:46.041119Z

I think in spacial terms, so having to jump around (even when it's easy to jump back) really breaks my flow.

walterl 2022-09-01T23:47:07.829959Z

It's much easier for me to have context A in window 1, and context B in window 2. In this case contexts A and B are in the same buffer.

walterl 2022-09-01T23:50:40.089919Z

Conversely, every time the cursor jumps, I have to reorient myself. I try to mitigate this by adding zvzz to some of my jumping mappings.

Martynas Maciulevičius 2022-09-02T00:24:27.497699Z

I press <C-o> to go back 🤔 But it doesn't work all the time But actually <C-T> is a better one

2022-09-02T01:26:17.909169Z

This looks helpful (I have not tried it myself): https://github.com/Pocco81/true-zen.nvim

walterl 2022-09-02T05:12:25.167409Z

Yeah, found that one too. It's a nice plugin, but not what I'm after.

walterl 2022-09-02T05:12:57.346649Z

So I made one https://github.com/walterl/curlod 😬 neovim

👍 1