fix shortmess, add trouble toggle function
This commit is contained in:
		
							parent
							
								
									a4035b5483
								
							
						
					
					
						commit
						65aec821bc
					
				@ -44,11 +44,8 @@ opt.foldlevel = 0
 | 
			
		||||
opt.number = true
 | 
			
		||||
opt.hidden = true
 | 
			
		||||
-- opt.shortmess = add { 'I' } -- Don't pass messages to ins-completion-menu.
 | 
			
		||||
opt.shortmess = {
 | 
			
		||||
	I = true,
 | 
			
		||||
	o = true,
 | 
			
		||||
}
 | 
			
		||||
opt.cmdheight = 0
 | 
			
		||||
opt.shortmess:append('I', 'W', 's')
 | 
			
		||||
opt.cmdheight = 1
 | 
			
		||||
opt.scrolloff = 15
 | 
			
		||||
opt.iskeyword:prepend { '-' }
 | 
			
		||||
opt.inccommand = 'nosplit'
 | 
			
		||||
@ -72,3 +69,12 @@ vim.api.nvim_create_autocmd({ 'BufReadPost' }, { pattern = { '*' }, command = 's
 | 
			
		||||
vim.api.nvim_create_autocmd({ 'BufWinLeave' }, { pattern = { '?*' }, command = 'mkview' })
 | 
			
		||||
vim.api.nvim_create_autocmd({ 'BufReadPost' }, { pattern = { '?*' }, command = 'silent! loadview' })
 | 
			
		||||
-- }}}
 | 
			
		||||
function ToggleTroubleAuto()
 | 
			
		||||
	local ok, trouble = pcall(require, 'trouble')
 | 
			
		||||
	if ok then
 | 
			
		||||
		vim.defer_fn(function()
 | 
			
		||||
			vim.cmd 'cclose'
 | 
			
		||||
			trouble.open 'quickfix'
 | 
			
		||||
		end, 0)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user