nix/prog/nvim: move folding augroup to lua

This commit is contained in:
Dmitriy Pleshevskiy 2022-08-19 10:04:54 +03:00
parent ce3ee731b3
commit 732ed6e01a
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 15 additions and 8 deletions

View file

@ -1,9 +1 @@
lua require('basic') 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

View file

@ -136,6 +136,21 @@ vim.api.nvim_create_autocmd(bufReadFile, {
callback = function () vim.wo.spell = true end, 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,
})
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- --