vim: replace FileType autocmds with ftplugins
This commit is contained in:
parent
0aaa310c4d
commit
c0dfdd1d6d
6 changed files with 15 additions and 6 deletions
4
nvim/.config/nvim/after/ftplugin/gitcommit.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/gitcommit.lua
Normal 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
|
||||||
|
|
3
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
3
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
|
||||||
|
vim.opt.spell = true -- turn on spell checking
|
||||||
|
|
3
nvim/.config/nvim/after/ftplugin/python.lua
Normal file
3
nvim/.config/nvim/after/ftplugin/python.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
vim.opt.foldmethod = 'indent'
|
||||||
|
vim.opt.foldignore = '#'
|
||||||
|
|
3
nvim/.config/nvim/after/ftplugin/text.lua
Normal file
3
nvim/.config/nvim/after/ftplugin/text.lua
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
vim.opt.formatoptions:append('t') -- wrap text on 'textwidth'
|
||||||
|
vim.opt.spell = true -- turn on spell checking
|
||||||
|
|
2
nvim/.config/nvim/after/ftplugin/vim.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/vim.lua
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
vim.opt.foldmethod = 'marker'
|
||||||
|
|
|
@ -19,12 +19,6 @@ make_autocmds {
|
||||||
{ 'BufNewFile,BufRead', 'init.lua',
|
{ 'BufNewFile,BufRead', 'init.lua',
|
||||||
"setlocal path+=~/.config/nvim/lua includeexpr=substitute(v:fname,'\\\\.','/','g')"},
|
"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 = {
|
windows = {
|
||||||
-- Disable cursorline when entering Insert mode (but remember it)...
|
-- Disable cursorline when entering Insert mode (but remember it)...
|
||||||
{ 'InsertEnter', '*', 'let g:stored_cursorline=&cursorline | set nocursorline' },
|
{ 'InsertEnter', '*', 'let g:stored_cursorline=&cursorline | set nocursorline' },
|
||||||
|
|
Loading…
Add table
Reference in a new issue