mirror of
				https://github.com/tiyn/dotfiles.git
				synced 2025-11-03 22:11:16 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			739 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			739 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
vim.api.nvim_create_autocmd({ 'VimEnter' },
 | 
						|
  {
 | 
						|
    callback = function()
 | 
						|
      require("tidy").opts.enabled_on_save = false
 | 
						|
      require("knap").toggle_autopreviewing()
 | 
						|
    end
 | 
						|
  })
 | 
						|
 | 
						|
vim.api.nvim_create_autocmd({ 'BufLeave' },
 | 
						|
  {
 | 
						|
    callback = function()
 | 
						|
      if vim.o.ma then
 | 
						|
        require("tidy").run()
 | 
						|
      end
 | 
						|
    end
 | 
						|
  }
 | 
						|
)
 | 
						|
 | 
						|
vim.api.nvim_create_autocmd({ 'VimLeave' },
 | 
						|
  {
 | 
						|
    callback = function()
 | 
						|
      os.execute('texclear ' .. vim.fn.expand('%'))
 | 
						|
    end
 | 
						|
  })
 | 
						|
 | 
						|
vim.o.shiftwidth = 2
 | 
						|
vim.o.softtabstop = 2
 | 
						|
vim.o.textwidth = 80
 | 
						|
 | 
						|
-- frabjous/knap
 | 
						|
vim.keymap.set('n', '<leader>p', require("knap").toggle_autopreviewing, { noremap = true })
 | 
						|
vim.keymap.set({ 'n', 'v', 'i' },'<F7>', function() require("knap").forward_jump() end)
 |