[vim] Add a DiagnosticFloat autocommand that shows the diagnostic window on CursorHold
Set the hold time to 300 ms.
This commit is contained in:
		
							parent
							
								
									4a35b3a79d
								
							
						
					
					
						commit
						0accf738ed
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		
							
								
								
									
										15
									
								
								config/nvim/lua/autocommands.lua
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								config/nvim/lua/autocommands.lua
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					-- Eryn Wells <eryn@erynwells.me>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vim.opt.updatetime = 300
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- Show diagnostic popup on cursor hover
 | 
				
			||||||
 | 
					local diagnostic_float_group = vim.api.nvim_create_augroup("DiagnosticFloat", { clear = true })
 | 
				
			||||||
 | 
					vim.api.nvim_create_autocmd("CursorHold", {
 | 
				
			||||||
 | 
					    callback = function()
 | 
				
			||||||
 | 
					        vim.diagnostic.open_float {
 | 
				
			||||||
 | 
					            border = "double",
 | 
				
			||||||
 | 
					            focusable = false,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    end,
 | 
				
			||||||
 | 
					    group = diagnostic_float_group,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue