Run The Currently Open Lua File In Neovim
The Command
You can execute an open .lau file buffer inside Neovim with the "source" command like this :
:so
Some Notes
-
The [TODO: Code shorthand span ] entry lists the details of [TODO: Code shorthand span ] as :
Runs [TODO: Code shorthand span ] commands or Lua code (".lua" files) from [file], or current buffer if no [file]. Triggers the [TODO: Code shorthand span ] autocommand.
-
The command works with files that have a [TODO: Code shorthand span ] extension
-
The command also works with non - saved buffers that are named with a [TODO: Code shorthand span ] extension. For example, you can do [TODO: Code shorthand span ] , write some code and run it with [TODO: Code shorthand span ] , then delete the buffer with [TODO: Code shorthand span ]
-
The [TODO: Code shorthand span ] command is shorthand for [TODO: Code shorthand span ] . I like using the shorter version, but the longer one works the same
-
The command can also be run with [TODO: Code shorthand span ] like [TODO: Code shorthand span ] 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 [TODO: Code shorthand span ] and [TODO: Code shorthand span ] until you save the file
Footnotes And References
- •:source Neovim Documentation
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