dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | README | LICENSE

visrc.lua (741B)


      1 require('vis')
      2 
      3 vis.events.subscribe(vis.events.INIT, function()
      4 	vis:command('set ignorecase')
      5 	vis:command('set autoindent')
      6 	vis:command('set theme monochrome')
      7 end)
      8 
      9 vis.events.subscribe(vis.events.WIN_OPEN, function(win)
     10 	if win.syntax == 'html' then
     11 		win:map(vis.modes.INSERT, ';a', '<a href=""></a><Escape>F"')
     12 		win:map(vis.modes.INSERT, ';>', '><Escape>b"rybi<<Escape>f>a</<C-r>r><Escape>F<i')
     13 	end
     14 
     15 	vis:command('set relativenumber')
     16 	vis:command('set showeof no')
     17 	vis:command('set breakat " !;:,.?"')
     18 end)
     19 
     20 vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, _)
     21 	local lines = file.lines
     22 	for i=1, #lines do
     23 		local trimmed = lines[i]:match('^(.-)%s+$')
     24 		if trimmed then lines[i] = trimmed end
     25 	end
     26 	return true
     27 end)