nix/prog/nvim: move folding augroup to lua
This commit is contained in:
parent
ce3ee731b3
commit
732ed6e01a
2 changed files with 15 additions and 8 deletions
|
@ -1,9 +1 @@
|
|||
lua require('basic')
|
||||
|
||||
" Set up folding
|
||||
aug folding
|
||||
au!
|
||||
au BufNewFile,BufRead *.js,*.jsx syntax on | setlocal foldmethod=syntax
|
||||
au BufNewFile,BufRead *.ts,*.tsx syntax on | setlocal foldmethod=syntax
|
||||
aug END
|
||||
|
||||
|
|
|
@ -136,6 +136,21 @@ vim.api.nvim_create_autocmd(bufReadFile, {
|
|||
callback = function () vim.wo.spell = true end,
|
||||
})
|
||||
|
||||
local folding_augroup = vim.api.nvim_create_augroup('folding', {})
|
||||
vim.api.nvim_create_augroup(bufReadFile, {
|
||||
group = folding_augroup,
|
||||
pattern = {
|
||||
'*.js',
|
||||
'*.jsx',
|
||||
'*.ts',
|
||||
'*.tsx',
|
||||
},
|
||||
callback = function ()
|
||||
vim.cmd 'syntax on'
|
||||
vim.wo.foldmethod = 'syntax'
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
--
|
||||
|
|
Loading…
Reference in a new issue