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.

Create A Hello World Neovim Plugin In Lua

TODO: Pull subtitle into page object

This uses a _.vim__ file for the plugin. I'm working on making that _.lua__

This is a basic setup I used for creating a Neovim plugin in Lua. After adding the files and restarting Neovim, you can run `:HelloWorld` which will print "Hello, Lua Plugin" on the command line.

code_start_default_section code_end_default_section

Debugging Stuff

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

        -- title

Create A Hello World Neovim Plugin In Lua

-- note

This uses a _.vim__ file for the plugin. 
I'm working on making that _.lua__

-- p

This is a basic setup I used for creating a Neovim 
plugin in Lua. After adding the files and restarting 
Neovim, you can run `:HelloWorld` which will print 
"Hello, Lua Plugin" on the command line. 


-- code/
-- title: ~/.config/nvim/plugin/hello_world.vim
-- vimscript 

if exists('g:loaded_hello_world') | finish | endif

let s:save_cpo = &cpo
set cpo&vim

command! HelloWorld lua require'hello_world'.hello_world()

let &cpo = s:save_cpo
unlet s:save_cpo

let g:loaded_hello_world = 1

-- /code



-- code/
-- title: ~/.config/nvim/lua/hello_world.lua
-- lua

local function hello_world()
    print("Hello, Lua Plugin")
end

return {
    hello_world = hello_world
}

-- /code


-- categories
-- Neovim 

-- metadata
-- date: 2021-06-10 15:51:12
-- id: 20eo6leu
-- status: scratch
-- type: post
-- site: aws