diff options
-rw-r--r-- | init.vim | 10 | ||||
-rw-r--r-- | lua/autocommands.lua | 7 | ||||
-rw-r--r-- | lua/init.lua | 1 |
3 files changed, 9 insertions, 9 deletions
@@ -1,10 +1,2 @@ -" Connecting the plugin manager +" Подключение пользовательской конфигурации lua require('init') - -augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source <afile> | PackerCompile -augroup end - -" Automatic file trimming when saving -autocmd BufWritePre * :%s/\s\+$//e diff --git a/lua/autocommands.lua b/lua/autocommands.lua new file mode 100644 index 0000000..565a2a7 --- /dev/null +++ b/lua/autocommands.lua @@ -0,0 +1,7 @@ +local cmd = vim.api.nvim_create_autocmd + +-- Автоматическое удаление пробелов в конце строки +cmd({ 'BufWritePre' }, { + pattern = '*', + command = ':%s/\\s\\+$//e' +}) diff --git a/lua/init.lua b/lua/init.lua index b4f48f3..401a7d2 100644 --- a/lua/init.lua +++ b/lua/init.lua @@ -1,3 +1,4 @@ require('plugins') require('settings') require('keymaps') +require('autocommands') |