forked from nico/dots
nvim: added neovim configuration
This commit is contained in:
parent
7182c3a7a0
commit
0399226628
17 changed files with 579 additions and 0 deletions
21
stow/.config/nvim/lua/nico/txt/enter.lua
Normal file
21
stow/.config/nvim/lua/nico/txt/enter.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- opts
|
||||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.textwidth = 80
|
||||
vim.opt.formatoptions:append("t")
|
||||
|
||||
-- ai slop that gets the job done
|
||||
-- redo formatting when leaving the insert mode
|
||||
vim.api.nvim_create_augroup("FormatText", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "markdown", "txt" },
|
||||
callback = function()
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
vim.cmd("normal! gggqG")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue