Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vimwiki Command-Line Interface

License

NotificationsYou must be signed in to change notification settings

sstallion/vimwiki-cli

Repository files navigation

vimwiki-cli is a command-line interface toVimwiki, a plugin for theVim text editor. It provides a front-end for interactive editor commandsand can be used to automate repetitive tasks such as rebuilding tag metadata andgenerating links, all from the command line.

Installation

vimwiki-cli is available onPyPI and can be installed locally using thePython Package Installer:

$ python -m pip install --user vimwiki-cli

Once installed, issuevimwiki --help to see usage.

Configuration

For most installations no configuration is needed, however several environmentvariables are available to modify default behavior without the need to passglobal options on the command line:

Environment VariableGlobal OptionDescription
VIMWIKI_EDITOR--editorEditor to launch, defaults to$EDITOR orvim.
VIMWIKI_COUNT--countIndex of wiki to open.
VIMWIKI_SELECT--selectSelect wiki from interactive list.
VIMWIKI_OPEN_MATCHES--open-matchesOpen search results by default.
VIMWIKI_OPEN_TABS--open-tabsOpen pages in a new tab by default.

Advanced

Supported Commands

Each CLI command corresponds to one or more Ex commands executed in the editor.The following table details the mapping between these commands:

CLI CommandEx Commands
vimwiki:VimwikiIndex
vimwiki all-html:VimwikiIndex | VimwikiAll2HTML
vimwiki check-links:VimwikiIndex | VimwikiCheckLinks
vimwiki diary:VimwikiDiaryIndex
vimwiki diary generate-links:VimwikiDiaryIndex | VimwikiDiaryGenerateLinks
vimwiki diary today:VimwikiMakeDiaryNote
vimwiki diary tomorrow:VimwikiMakeTomorrowDiaryNote
vimwiki diary yesterday:VimwikiMakeYesterdayDiaryNote
vimwiki generate-links PAGE PATTERN:VimwikiIndex | VimwikiGoto PAGE | VimwikiGenerateLinks PATTERN
vimwiki goto PAGE:VimwikiIndex | VimwikiGoto PAGE
vimwiki help:help vimwiki.txt | only
vimwiki search PATTERN:VimwikiIndex | VimwikiSearch PATTERN
vimwiki tags generate-links PAGE TAGS:VimwikiIndex | VimwikiGoto PAGE | VimwikiGenerateTagLinks TAGS
vimwiki tags rebuild:VimwikiIndex | VimwikiRebuildTags
vimwiki tags search PATTERN:VimwikiIndex | VimwikiSearchTags PATTERN

Shell Completion

Shell completion is available forbash,fish, andzsh shells. To generatean activation script, issue:

$ env _VIMWIKI_COMPLETE=source_$(basename $SHELL) vimwiki >/path/to/vimwiki-complete.sh

Once generated, the activation script may be sourced directly or from the shellstartup file to provide completion:

$ . /path/to/vimwiki-complete.sh

Git Integration

For wikis managed with Git, a pre-commit hook script is available that executesnon-interactive commands to rebuild tag metadata and generate links beforecommit.

The pre-commit hook relies on the following configuration options:

Configuration OptionDescription
vimwiki.optionsExtra options to pass to thevimwiki command
vimwiki.linkspagePage which contains generated links
vimwiki.taglinkspagePage which contains generated tag links
vimwiki.generatelinksGenerate links before commit (bool)
vimwiki.generatediarylinksGenerate diary links before commit (bool)
vimwiki.generatetaglinksGenerate tag links before commit (bool)
vimwiki.rebuildtagsRebuild tag metadata before commit (bool)
vimwiki.allhtmlConvert wiki to HTML before commit (bool)

For example, to configure the hook to rebuild tag metadata and generate taglinks in theTags page before commit, issue:

$ git config vimwiki.taglinkspage Tags$ git config vimwiki.generatetaglinks true$ git config vimwiki.rebuildtags true

To enable the hook, copy or linkpre-commit.sh to.git/hooks/pre-commitin the wiki directory. Alternatively, ifpre-commit is installed, add apre-commit configuration file,.pre-commit-config.yaml and runpre-commit autoupdate to enable the latest version of the hook.

# See https://pre-commit.com for more information# See https://pre-commit.com/hooks.html for more hooksrepos:  -repo:https://github.com/sstallion/vimwiki-clirev:v1.1.0hooks:      -id:vimwiki-cli

Contributing

Pull requests are welcome! SeeCONTRIBUTING.md for more details.

License

Source code in this repository is licensed under a Simplified BSD License. SeeLICENSE for more details.

About

Vimwiki Command-Line Interface

Topics

Resources

License

Stars

Watchers

Forks

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp