Giter Club home page Giter Club logo

vim-markdown-wiki's Introduction

vim-markdown-wiki

vim-markdown-wiki is a Vim plugin which eases the navigation between files in a personnal wiki based on markdown

Installation

Add the line Bundle 'mmai/vim-markdown-wiki' in your .vimrc if you use Vundle or a similar plugin manager Or copy the after/ftplugin/markdown.vim file into the $HOME/.vim/after/ftplugin/ directory

Usage

With the default key mappings :

Link creation:

  • Hit the ENTER key when the cursor is on a text between brackets : [a title]
  • The link will be created [a title](a-title.md) and the corresponding file will be loaded in the buffer.

Navigation:

  • Hit the ENTER key when the cursor is on a wiki link
  • The corresponding link file is loaded in the current buffer.
  • Hit Leader key + ENTER to go back

You can set a shortcut to open links in a new split, see below

Change key mappings in your vim config file

Create or go to link : nnoremap <CR> :MdwiGotoLink

Open link in a new split with SPACE + ENTER : nnoremap <Space><CR> <C-w>v:MdwiGotoLink<CR>

Return to previous page : nnoremap <Leader><CR> :MdwiReturn

Customize new pages titles

You can override the default format of the titles by defining a function MdwiWriteTitle in your vim config file.

The default is :

function! MdwiWriteTitle(word)
  return 'normal!\ a'.escape(a:word, ' \').'\<esc>yypv$r=o\<cr>'
endfunction

which write the titles like this :

New page
========

Here is an example of a custom function which uses the # style instead of underlining, and adds a timestamp before the title :

 function! MdwiWriteTitle(word)
   return 'normal!\ a# '.strftime('%c').' - '.escape(a:word, ' \').'\<esc>'
 endfunction

the result is something like this, depending on your locale :

# Thu 10 Dec 2018 08:44:37 CET - New page

vim-markdown-wiki's People

Contributors

mmai 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.