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.

Using ~/.config/nvim/after/plugin For Neovim Mod Files

TODO: Pull subtitle into page object
Code
~/.config/nvim/after/plugin 

Any `.lua`` files in that directory get loaded as one of the last parts of pulling things into the runtime. So, pretty much everything else should be loaded.

My thinking is to make it easier to break out parts of my config into the individual files and to make it easier to add little scripts to mod behavior.

For example, putting this script in the directory configures Neovim to print "File saved!" every time a file is written

code_start_default_section code_end_default_section

Postscript

So far. So good. I've created a half dozen files and everything is working as expected.

Debugging Stuff

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

        -- title

Using ~/.config/nvim/after/plugin For Neovim Mod Files

I'm experimenting with putting lua scripts to modify 
Neovim in:

-- code 
-- type: nonums

~/.config/nvim/after/plugin 

-- p

Any `.lua`` files in that directory get loaded
as one of the last parts of pulling things into
the runtime. So, pretty much everything else
should be loaded. 

My thinking is to make it easier to break out
parts of my config into the individual files and
to make it easier to add little scripts to 
mod behavior.

For example, putting this script in the directory
configures Neovim to print "File saved!" every
time a file is written

-- code/
-- lua
-- title: ~/.config/nvim/after/plugin/example.lua

vim.api.nvim_create_autocmd("BufWritePost", {
  group = vim.api.nvim_create_augroup("EaxmpleFileSaveMessage", { clear = true }),
  callback = function() 
    print("File saved!")
  end,
})

-- /code

That's not particullarly useful, but it proves the point
that autocmds can be setup from the directory. 

-- h3

Postscript

So far. So good. I've created a half dozen files
and everything is working as expected. 


-- ref
-- title: after-directory Neovim Documentation
-- url: https://neovim.io/doc/user/options.html#after-directory

The subsection of the `runtimepath`` docs that talks
about how the `after`` directories get loaded. Scoll up a bit
to get a better idea of the entire process


-- categories
-- Neovim 

-- metadata
-- date: 2023-10-19 11:49:26
-- id: 2wzlfkqu
-- site: aws
-- type: post
-- status: draft