diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:44:22 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:44:22 +0300 |
| commit | 934382c8a1ce738589dee9ee0f14e1cec812770e (patch) | |
| tree | f13715762efd06518f8aec3a2bf39ac8a615987f /uvim/src/po/tojavascript.vim | |
| parent | 0b24459ac12b6cf9fd5a401d647796ca254a8fa8 (diff) | |
| parent | 7088926316d8d4a7572a242d0765e99adfc8b083 (diff) | |
| download | Project-Tick-934382c8a1ce738589dee9ee0f14e1cec812770e.tar.gz Project-Tick-934382c8a1ce738589dee9ee0f14e1cec812770e.zip | |
Add 'uvim/' from commit '7088926316d8d4a7572a242d0765e99adfc8b083'
git-subtree-dir: uvim
git-subtree-mainline: 0b24459ac12b6cf9fd5a401d647796ca254a8fa8
git-subtree-split: 7088926316d8d4a7572a242d0765e99adfc8b083
Diffstat (limited to 'uvim/src/po/tojavascript.vim')
| -rw-r--r-- | uvim/src/po/tojavascript.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/uvim/src/po/tojavascript.vim b/uvim/src/po/tojavascript.vim new file mode 100644 index 0000000000..4671a472fa --- /dev/null +++ b/uvim/src/po/tojavascript.vim @@ -0,0 +1,24 @@ +" Invoked with the name "vim.pot" and a list of Vim script names. +" Converts them to a .js file, stripping comments, so that xgettext works. +" Javascript is used because, like Vim, it accepts both single and double +" quoted strings. + +set shortmess+=A + +let s:namenum = 0 +let s:fls = [] +for s:name in argv()[1:] + exe 'edit ' .. fnameescape(s:name) + + " Strip comments, also after :set commands. + g/^\s*"/s/.*// + g/^\s*set .*"/s/.*// + + " Write as .js file, xgettext recognizes them + let s:fl = fnamemodify(s:name, ":t:r") .. s:namenum .. ".js" + exe 'w! ' .. s:fl + call add(s:fls, s:fl) + let s:namenum += 1 +endfor +call writefile(s:fls, "vim_to_js") +quit |
