sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

D1589-DumpAirlineThemes.vim (985B)


      1 " -*- mode: vimrc -*-
      2 
      3 function DumpAirlineTheme(name)
      4   execute "AirlineTheme " . a:name
      5   execute "let palette = g:airline#themes#" . a:name . "#palette"
      6   let lines = []
      7   for mode in keys(palette)
      8     for face in keys(palette[mode])
      9       let fg = palette[mode][face][0]
     10       let bg = palette[mode][face][1]
     11       let cfg = palette[mode][face][2]
     12       let cbg = palette[mode][face][3]
     13       " let style = palette[mode][face][4]
     14       call add(lines, 'face ' . mode . " " . face . " '" . fg . "' '" . bg . "' '" . cfg . "' '" . cbg . "'")
     15     endfor
     16   endfor
     17   call writefile(lines, "tmp/airline/" . a:name . ".bash")
     18 endfunction
     19 
     20 function DumpAirlineThemeAll()
     21   " vim-airline/vim-airline-themes
     22   let filelist = glob("~/.vim/plugged/vim-airline-themes/autoload/airline/themes/*.vim")
     23   for name in split(filelist, "\n")
     24     let name = fnamemodify(name, ":t:r")
     25     call DumpAirlineTheme(name)
     26   endfor
     27 
     28   " itchyny/landscape.vim
     29   call DumpAirlineTheme("landscape")
     30 endfunction