vim: replace FileType autocmds with ftplugins

This commit is contained in:
Fernando Schauenburg 2022-02-01 21:30:40 +01:00
parent 0aaa310c4d
commit c0dfdd1d6d
6 changed files with 15 additions and 6 deletions

View file

@ -0,0 +1,4 @@
vim.bo.textwidth = 72
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
vim.opt.spell = true -- turn on spell checking

View file

@ -0,0 +1,3 @@
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
vim.opt.spell = true -- turn on spell checking

View file

@ -0,0 +1,3 @@
vim.opt.foldmethod = 'indent'
vim.opt.foldignore = '#'

View file

@ -0,0 +1,3 @@
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
vim.opt.spell = true -- turn on spell checking

View file

@ -0,0 +1,2 @@
vim.opt.foldmethod = 'marker'

View file

@ -19,12 +19,6 @@ make_autocmds {
{ 'BufNewFile,BufRead', 'init.lua',
"setlocal path+=~/.config/nvim/lua includeexpr=substitute(v:fname,'\\\\.','/','g')"},
},
filetypes = {
{ 'FileType', 'gitcommit', 'setlocal textwidth=72' },
{ 'FileType', 'gitcommit,markdown,text', 'setlocal formatoptions+=t spell' },
{ 'FileType', 'python', 'setlocal foldmethod=indent foldignore=' },
{ 'FileType', 'vim', 'set foldmethod=marker' },
},
windows = {
-- Disable cursorline when entering Insert mode (but remember it)...
{ 'InsertEnter', '*', 'let g:stored_cursorline=&cursorline | set nocursorline' },