Add a keymap space-f to format buffer using conform (#817)
This works also for visual range selection Copied from conform recipe: https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md
This commit is contained in:
		
							parent
							
								
									b73b77e51c
								
							
						
					
					
						commit
						6abc143c16
					
				
							
								
								
									
										10
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										10
									
								
								init.lua
								
								
								
								
							| 
						 | 
				
			
			@ -644,6 +644,16 @@ require('lazy').setup({
 | 
			
		|||
 | 
			
		||||
  { -- Autoformat
 | 
			
		||||
    'stevearc/conform.nvim',
 | 
			
		||||
    keys = {
 | 
			
		||||
      {
 | 
			
		||||
        '<leader>f',
 | 
			
		||||
        function()
 | 
			
		||||
          require('conform').format { async = true, lsp_fallback = true }
 | 
			
		||||
        end,
 | 
			
		||||
        mode = '',
 | 
			
		||||
        desc = '[F]ormat buffer',
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    opts = {
 | 
			
		||||
      notify_on_error = false,
 | 
			
		||||
      format_on_save = function(bufnr)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue