neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

tojavascript.vim (459B)


      1 " Invoked with the name "vim.pot" and a list of Vim script names.
      2 " Converts them to a .js file, stripping comments, so that xgettext works.
      3 " Javascript is used because, like Vim, it accepts both single and double
      4 " quoted strings.
      5 
      6 set shortmess+=A
      7 
      8 for name in argv()[1:]
      9  exe 'edit ' .. fnameescape(name)
     10 
     11  " Strip comments
     12  g/^\s*"/s/.*//
     13 
     14  " Write as .js file, xgettext recognizes them
     15  exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js"
     16 endfor
     17 
     18 quit