Coder Social home page Coder Social logo

vim-zettel's Introduction

The vim-zettel package

This is a Vim plugin that implements ideas of the Zettelkasten method using Vimwiki. This is a work in progress and it has just a basic features ATM. It supports both Vimwiki and Markdown syntaxes.

Install

Using Vundle:

Plugin 'vimwiki/vimwiki'
Plugin 'junegunn/fzf.vim'
Plugin 'michal-h21/vim-zettel'

Configuration

Sample configuration:

" Filename format. The filename is created using strftime() function
let g:zettel_format = "%y%m%d-%H%M"
" Disable default keymappings
let g:zettel_default_mappings = 0 
" This is basically the same as the default configuration
augroup filetype_vimwiki
  autocmd!
  autocmd FileType vimwiki imap <silent> [[ [[<esc><Plug>ZettelSearchMap
  autocmd FileType vimwiki nmap T <Plug>ZettelYankNameMap
  autocmd FileType vimwiki xmap z <Plug>ZettelNewSelectedMap
  autocmd FileType vimwiki nmap gZ <Plug>ZettelReplaceFileWithLink
augroup END

" Settings for Vimwiki
let g:vimwiki_list = [{'path':'~/scratchbox/vimwiki/markdown/','ext':'.md','syntax':'markdown', 'zettel_template': "~/mytemplate.tpl"}, {"path":"~/scratchbox/vimwiki/wiki/"}]
" Set template and custom header variable for the second Wiki
let g:zettel_options = [{},{"front_matter" : {"tags" : ""}, "template" :  "~/mytemplate.tpl"}]

Usage

It adds some commands and mappings on top of Vimwiki. See it's documentation on how to set up a basic wiki and navigate it.

Create new Zetteln

  • :ZettelNew command - it will create a new wiki file named as %y%m%d-%H%M.wiki (it is possible to change the file name format using g:zettel_format variable). The file uses basic template in the form

    %title Note title
    %date current date
    
  • z command in the visual mode - create a new wiki file using selected text for the note title

  • [[ command in the insert mode - create a link to a note. It uses FZF for the note searching.

  • T command in the normal mode - yank the current note filename and title as a Vimwiki link

  • gZ command in the normal mode - replace file path under cursor with Wiki link

  • :ZettelCapture - create a new Zettel from a file. Useful for scripting. It can be used in this way

    vim -c ZettelCapture filename
    

    It will replace the original file contents with a path to the new wiki file, so it should be used with temporary files!

Related

The following packages may be useful in conjunction with Vimwiki and Vim-zettel:

  • Notational FZF - fast searching notes with preview window.
  • Vimwiki-sync - automatically commit changes in wiki and synchronize them with external Git repository.

vim-zettel's People

Contributors

michal-h21 avatar

Watchers

James Cloos avatar Patrick Cho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.