Перенос авто-команд в отдельный файл
Signed-off-by: Valentin Popov <valentin@popov.link>
This commit is contained in:
		
							
								
								
									
										10
									
								
								init.vim
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								init.vim
									
									
									
									
									
								
							@@ -1,10 +1,2 @@
 | 
				
			|||||||
" Connecting the plugin manager
 | 
					" Подключение пользовательской конфигурации
 | 
				
			||||||
lua require('init')
 | 
					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
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								lua/autocommands.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lua/autocommands.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					local cmd = vim.api.nvim_create_autocmd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Автоматическое удаление пробелов в конце строки
 | 
				
			||||||
 | 
					cmd({ 'BufWritePre' }, {
 | 
				
			||||||
 | 
					  pattern = '*',
 | 
				
			||||||
 | 
					  command = ':%s/\\s\\+$//e'
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
require('plugins')
 | 
					require('plugins')
 | 
				
			||||||
require('settings')
 | 
					require('settings')
 | 
				
			||||||
require('keymaps')
 | 
					require('keymaps')
 | 
				
			||||||
 | 
					require('autocommands')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user