The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Run The Currently Open Lua File In Neovim

TODO: Pull subtitle into page object

The Command

You can execute an open .lau file buffer inside Neovim with the "source" command like this:

Code
:so

Some Notes

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Run The Currently Open Lua File In Neovim

-- h2

The Command

You can execute an open .lau file buffer inside Neovim
with the "source" command like this:

-- code
-- type: nonums

:so

-- h2

Some Notes

-- list 

- The `:help source`` entry lists the details
of `:[range]so[urce] [file]`` as:

Runs `Ex`` commands or Lua code (".lua" files) 
from [file], or current buffer if no [file]. 
Triggers the `SourcePre`` autocommand.

- The command works with files that have a 
`.lua`` extension

- The command also works with non-saved buffers
that are named with a `.lua`` extension. For 
example, you can do `:e tmp.lau``, write some 
code and run it with `:so``, then delete
the buffer with `:bd!``

- The `:so`` command is shorthand for `:source``.
I like using the shorter version, but the longer
one works the same

- The command can also be run with `%`` like 
`:so %`` which uses the file path of the current 
buffer instead of the buffer itself. That means
if you make changes to the file buffer without 
saving them you'll see different behaviour from
`:so`` and `:so %`` until you save the file


-- ref
-- title: :source Neovim Documentation
-- url: https://neovim.io/doc/user/repeat.html#%3Asource

I copy/pasted the entry above. There's some
more links and other stuff around the entry and I've
never found skimming around docs to be time wasted

-- categories
-- Neovim 
-- Lua 

-- metadata
-- date: 2023-10-19 10:16:06
-- id: 2wzajvg2
-- site: aws
-- type: post
-- status: published