Skip to content

kkiyama117/zenn-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zenn-vim

plugin for zenn.dev

Requirements

  • Neovim or Vim8

  • Npm(with npx)

    • zenn official doesn't specify nodejs version number, but I recommend using its latest lts version.
    • (neo)vim node js support is not needed because it is called as system command.

Be careful to set 'zenn' as name of this plugin if you use plugin manager. After downloading to your vim runtimepath, configure your vimrc to call functions. (See examples).

Examples

  " same prefix from command in monaqa's article
  const g:zenn#article#slug = {
    \ "use_template": v:true,
    \ "format": "%F"
    \}

  " open the new article after 'zenn#new_article' with the command
  const g:zenn#article#edit_new_cmd = "new"

  " npm install zenn-cli@latest
  command! -nargs=0 ZennUpdate call zenn#update()
  
  " Run npx zenn preview
  " call |:ZennPreview| or |:ZennPreview {port} |
  command! -nargs=* ZennPreview call zenn#preview(<f-args>)

  " Stop zenn preview process 
  command! -nargs=0 ZennStopPreview call zenn#stop_preview()

  " Create zenn new article
  " call |:ZennPreview [{slug},{title},{type}, {emoji}] |
  command! -nargs=* ZennNewArticle call zenn#new_article(<f-args>)

  " Create zenn new book
  " call |:ZennPreview [{slug}] |
  command! -nargs=* ZennNewBook call zenn#new_book(<f-args>)

Features

  • Add functions like zenn#preview(), zenn#new_article(), ...

For details, see doc/zenn.txt or call :help zenn_vim on vim

Install

Install as vim plugin same as others. (Tell me how to install with each plugin manager.)

LICENSE

I use GPLv3 now but give all rights if zenn official requires. Contact kkiyama117 or make issues on this repository if there are rights side plobrems.

TODO

See issues.