Giter VIP home page Giter VIP logo

riv.vim's Introduction

Riv: Notes and wiki in rst

Last Update

2018-01-21

Version

0.793

New Changes

0.793: fix the RivInstruction, add RivDoc

0.792: fix the python/rst syntax file

0.791: Add a conceal syntax for *.rst filelink

0.79: As The clickable is not stable, and with many voting to disable it, revert to 0.77.

Intro

Riv is a vim plugin for taking notes with reStructuredText.

riv.vim (vim) + InstantRst (web server) + rhythm.css (theme)

riv.vim (vim) + InstantRst (web server) + rhythm.css (theme)

Comparison =========

First things first.

There are some other note plugins in Vim, like vimwiki, vim-notes, VOoM, etc.

Also org-mode if you are an Emacs fan.

Why use this plugin?

In comparison, the biggest advantage of Riv.vim is reStructuredText support.

reStructuredText is a markup language.

Its syntax is similar to markdown, but more powerful and extensible. Tables, LaTex, etc. are supported.

It's widely used in the Python community, and has many relevant plugins. Sphinx (www.readthedocs.org) Pygments, Nikola, etc.

Here is a post comparing reStructuredText and Markdown: https://gist.github.com/dupuy/1855764

Features

Wiki

Write wiki with project and file link support. TODO syntax is added.

Editing

Faster typing, easier navigation, clear indenting, auto formatting etc.

Reading

Improved syntax highlighting and folding support for reading document clearly.

Publish

Convert RST files to a number of different formats: PDF, HTML, XML, Latex and ODT, etc. A new theme rhythm.css is added for better performance.

Plugins

Support many plugins like Sphinx syntax support. Other RST plugins:

Contribution to this list are welcome.

Installation

Using Vundle

Recommended Add this line to your .vimrc (after you have properly set up Vundle):

Bundle 'Rykka/riv.vim'

Downloaded zip/tar.gz file

Extract the contents of the archive to your .vim directory.

Config

You can add projects with g:riv_projects:

let proj1 = { 'path': '~/Dropbox/rst', }
let g:riv_projects = [proj1]

More options see the :RivInstruction

Make sure your .vim directory is before $VIMRUNTIME in runtimepath. By default it is present before $VIMRUNTIME.

Also make sure filetype plugin indent on and syntax on options are present in your .vimrc.

Tutorials

You can have a quick start with :RivQuickStart.

Here is the Screencast:

New To Vim

  • If you are new to Vim, you can get a basic overview of Vim using vimtutor. To use it simply type vimtutor in your shell.
  • To view the quick reference of Vim, use :h quickref.

New To RST

New To Riv

  • For getting started with Riv, read "QuickStart With Riv". You can also view it using :RivQuickStart in Vim.
  • Detailed instructions for Riv are available at "Instructions". Use :RivInstruction to read the same in Vim.

Issues

The bug tracker for Riv is at https://github.com/Rykka/riv.vim/issues. You can use it to report bugs and open feature requests. Discussions related to Riv are welcome too.

You can follow my twitter @rykkaf and tweet me there too.

Common Issues

  • If you get errors with folding in documents, you can try to force reload using :RivReload or <C-E>t`.

    Or just :w as it will auto-refold after saving.

  • Windows:
    • Converting to other formats may fail.

      This could happen due to Docutils not working correctly with vimrun.exe.

  • Mac OS:
    • Lists don't act as expected.

      This could happen if the <C-Enter> key could not be mapped. Try some other mapping instead.

License

MIT

riv.vim's People

Contributors

cpkio avatar davidjb avatar derweh avatar dhabyx avatar eronhennessey avatar firecat53 avatar gitter-badger avatar gremat avatar gu-fan avatar indelog avatar jean avatar kevinboyette avatar ldhughes avatar lotabout avatar mdrohmann avatar medjo avatar mizuchi avatar mt3 avatar mxlian avatar numshub avatar proteansec avatar rykka avatar s0undt3ch avatar tony avatar ukos-git avatar waywardmonkeys avatar winged avatar yaegassy avatar yuex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

riv.vim's Issues

'endif' missing in s:convert()

Hi.

When i try to :Riv2(Whatever) i always get error message:

Обнаружена ошибка при обработке function riv#publish#file2..156_single2..156_convert:
строка 27:
E171: Отсутствует команда :endif

(a bit of Russian, it means Error found when processing ..., line 27, command :endif is missing)

The function s:convert() really misses endif. Here is a small patch that fixes the issue:

--- autoload/riv/publish.vim    2012-11-19 13:26:55.945512257 +0400
+++ autoload/riv/publish.vim.new    2012-11-19 13:32:01.449795094 +0400
@@ -116,6 +116,7 @@
             if !executable(exe)
                 call riv#error('Could not find '.exe)
                 return -1
+            endif
         endif
     endif
     let args = a:0 ? a:1 : ''

Cheers, Alexey.

how to use folding?

I git clone'd and copied the files to my ~/.vim/ folder. I vim test.rst, receive no errors and seeg:_riv_loadedis 1.
:RivQuickStart works, but I fail to use the keys.

I tried zx, zC, zM and such in various combinations (mostly
with foldmethod=syntax), but I see no effect - nothing is folded,
I sometimes (zC) get E490: No fold found.

Also for example list shifting with >> and << uses my normal
indent shift. When I call :RivShiftLeft it works. I could :map << :RivShiftLeft<CR>, but I don't think I should need to do so,
because it should happen automatically when opening a .rst file
(filetype=rst)?

BTW, :RivFoldUpdate gives E492: Not an editor command: RivFoldUpdate (there are no command starting with :RivFold at
all, but many starting with :Riv )

As riv.vim looks so promising, I really would like to give it a
try. Could you help me, please?

Thanks for reading and all the great work with the plugin!

vim:set ft=markdown:

Problem with <C-E>

I have a problem that I haven't been able to track down yet. I can enter 1 section title but then any further attempts to enter a section title result in a frozen vim. i have to press to get control back. However, after that s1...s6 always produce a frozen vim.

Hopefully someone can point me in the right direction as to what I am doing wrong.

Option to disable folding update on write

As far as I can work out, there's no option to disable calling riv#fold#update() on BufWritePost. I prefer to leave folds as they are on writing the buffer. This patch seems to work for me:

diff --git a/doc/riv.rst b/doc/riv.rst
index 7ed056b..b8306ef 100644
--- a/doc/riv.rst
+++ b/doc/riv.rst
@@ -348,6 +348,11 @@ And extra infos are provided.

       default is 3000.

+    - '_`g:riv_no_fold_on_write`', disable updating folds on buffer write.
+
+      1. when set to non-zero, folds are not updated
+      2. default is 0.
+
   + To open some of the fold when entering a file .
     You can use ``:set fdls=1`` or use ``modeline`` for some files::

diff --git a/ftplugin/rst/riv.vim b/ftplugin/rst/riv.vim
index c61cbb5..088d8c6 100644
--- a/ftplugin/rst/riv.vim
+++ b/ftplugin/rst/riv.vim
@@ -91,7 +91,9 @@ aug RIV_BUFFER "{{{
         au! WinLeave,BufWinLeave     <buffer>  2match none
     endif "}}}
     au  WinLeave,BufWinLeave     <buffer>  call riv#file#update()
-    au! BufWritePost <buffer>  call riv#fold#update() 
+    if exists("g:riv_no_fold_on_write") == 0 "{{{
+        au! BufWritePost <buffer>  call riv#fold#update()
+    endif "}}}
     au  BufWritePost <buffer>  call riv#todo#update()
     au! BufWritePre  <buffer>  call riv#create#auto_mkdir()
 aug END "}}}

What do you think?

Vim Colorscheme

Can you add some information on the Vim Color Schemes that you have found to work well when working with Restructured text files and riv.vim?

Problem with section helper

Thanks for the great plugin - it's very useful. I'm just having some problems with the Section Helper. The new section helper window always shows only

=== No Match ===

for any buffer. How can I debug this?

< supports neither count nor motion

In situation like

text
  |text
  text
  text

(| denotes cursor)
I could use <2j or 3<< in order to unindent three last lines. But not with Riv.

I propose to make working at least one of the approaches or hide mapping behind the leader (<C-E><). Or there is another way to achieve multiline (un)indenting with Riv?

Yes, I've seen visual mode solution. Not interested in, since it is longer.

Publishing not finding rst2XXX.py

Installing python-docutils package on ubuntu 12.04, install the rst2XXX scripts without the .py extension.

So the previosly rst2html.py is now rst2html.

:RivTitle# doesn't work

Trying to modify a line into a title gives the following error:

Error detected while processing function riv#section#title..<SNR>69_sect_lines:
line    4:
E117: Unknown function: strdisplaywidth
E116: Invalid arguments for function repeat(punc, strdisplaywidth(a:title))
E15: Invalid expression: repeat(punc, strdisplaywidth(a:title))
line    5:
E121: Undefined variable: sline
E15: Invalid expression: rows == 2 ? [a:title, sline] : [sline, a:title,sline]

Add support for rst formatting

It would be very nice to add support for formatting rst files. Actually I installed RiV in the hopes it would help me on this point.

What happens, with and without RiV:

My Title
=======

Paragraph
test...

Then I do a visual selection on the file or a part of it and use gq to reformat it. It will correctly rewrap the pagraph, but the title will be broken:

My Title =======

Paragraph test...

I would like the Title underline to not be joined.

(Not sure if possible)

Thanks anyway for the great plugin.

list behavior

I'm not finding the behavior described in the docs. For example if i start a bullet list and then I get::

 * item
   next item

My understanding was that this behavior should have led to::

* item
* next item

Am I missing something, or have I interpreted the docs incorrectly?

Errors when using tables in rst

Everytime I try to edit a grid table in an rst file, I get the following error:

Error detected while processing function riv#table#format_pos..riv#table#format..2:
line   10:
E684: list index out of range: 0
Press ENTER or type command to continue
Error detected while processing function riv#table#format_pos..riv#table#format..2:
line   10:
E15: Invalid expression: getline(i) != lines[0]

Do you have any ideas what could be causing these errors?

Edit: More testing shows that this only happens when I edit cells in the first column and start inserting text in the first whitespace of the cell instead of leaving empty the first space.

g:riv_default.buf_imaps does not exist?

I get these errors when I load vim now that riv.vim is installed:

Error detected while processing function riv#init..riv#load_conf:
line  128:
E716: Key not present in Dictionary: buf_imaps, key)
E116: Invalid arguments for function remove

I think it's because I have declared ignored imaps:

let g:riv_ignored_imaps = "<BS>,"

but riv_default.buf_imaps does not exist:

    for key in split(g:riv_ignored_imaps,',')
        call remove(g:riv_default.buf_imaps, key)
    endfor

Spelling error

Just a small spelling mistake:

diff --git a/autoload/riv.vim b/autoload/riv.vim
index edf39bd..5e84d23 100644
--- a/autoload/riv.vim
+++ b/autoload/riv.vim
@@ -29,7 +29,7 @@ fun! riv#error(msg) "{{{
 endfun "}}}
 fun! riv#warning(msg) "{{{
     echohl WarningMsg
-    echo '[Warnging]'
+    echo '[Warning]'
     echon a:msg
     echohl Normal
 endfun "}}}

Toolbar support

Add toolbar support for vim.

normal document editing action will be added . like bold list section table link image .

maybe some more icons are needed.

Block Indicator?

highlight the first column or more to indicate it's a block.

This may be overheading.

Avoid overriding <F2>

Is it me or RiV did override my own binding to some folding action?

I think this should be optional, and opt-in.

More work with Sphinx

There are some more work with Spinx:

  1. Auto detect whether it's a sphinx project by finding the conf.py?
    And create a temp project to work with it.

  2. The syntax highlighting for rolelike :doc: :ref: should be defined in syntax file.
    And the Cursor Highlighting could be used only in sphinx project.
    As loading file with au FileType is BEFORE loading rst syntax file,

    And highlighting [[xxx]] will be global too. As I think there will rarely conflicts using
    both syntax in one document

  3. Wrap the sphinx make command.
    Also refine the command of Riv make series.

  4. Support the Spinx toctree.
    Using syntax file to add toctree directives , and highlight file in
    toctree context.

  5. support Sphinx :ref:. the toctree and pickle object created
    by sphinx can be used.

missing ~/Documents/Riv

g:_riv_c assumes that ~/Documents/Riv exists for some of the paths its stores. I believe creating that direcotyr should be part of the install process or mentioned somewhere in the docs.

how to set the g:riv_global_leader variables

hi,
I want to try riv.vim plugin, and the problem is that I don't know how to set the g:riv_global_leader variable. Because the key is used by other plugins
I tried
let g:riv_gloabl_leader = # syntax error
and
let g:riv_gloabl_leader =”“ # seems not work

I have few knowledge for vim scripts , please tell me how to set it in right way

Highlight Error in ..code directive

.. code:: bash

   wget --reject-regex='/path1/|/path2/...'

All highlight get mess after the |.

Have any idea to fix it? I can not change any character in ..code:: directive, because it's code...

Anyway, thx!

Auto-enumerated lists are converted to explicit enumeration on indent change

I'm using the latest version of your plugin - it's really useful, thanks - and I'm finding that if I have a list like:

#. Milk
#. Bread
#. Cheese

and I try and indent/de-indent this using Visual selection, then the #. (auto enumeration) is converted to explicit enumeration. Whilst I could prefix my usage of > with the leader (eg <C-E>), the auto-enumeration shouldn't be affected (at least not by default). In this situation, could it be that the list is simply re-indented?

Another potential list type like:

A. Milk
#. Bread
#. Cheese

which sets the auto-enumeration explicitly, sees each auto-enumerated list item change when indented/de-indented. In this situation, it would be perfect if the first item were changed for the different indent level, but the others left as automatic.

Let table support column span.

To support spaning column for table.

We should know and control the state of the border of each row.
when one row has changed, both the above and below border should be changed.

first find the changed column of the row, then other rows and borders related column should be
changed.

An action to span column could be added. maybe :RivTableSpanColumn

Row span will not be added currently.

Path '~/Documents' is hardcoded

Hi.

Path ~/Documents is hardcoded in two files: autoload/riv.vim and autoload/riv/action.vim. I do not have path ~/Documents in my russian locale, so i am getting error messages every time i want to write .rst file (claiming about inability to write some .todo file). Also it some time did create directory ~/Documents on my computer and put there some .rst file, which is not good as it duplicates the directory with russian name.
Currently i use following patches:

--- autoload/riv/action.vim.new 2012-11-15 18:37:12.000000000 +0400
+++ autoload/riv/action.vim 2012-11-29 16:06:13.438286726 +0400
@@ -12,7 +12,7 @@
 fun! riv#action#tutor(name) "{{{
     let file = g:_riv_c.doc_pat . a:name . '.rst'
     let lines = readfile(file)
-    exe 'noa keepa bot new ~/Documents/'.a:name.'.rst'
+    exe 'noa keepa bot new '.g:riv_tutor_path.'/'.a:name.'.rst'
    setl noswf nolist nospell nocuc wfh
    " setl bt=nofile bh=unload
     set ft=rst

and

--- autoload/riv.vim.new    2012-11-15 18:37:12.000000000 +0400
+++ autoload/riv.vim    2012-11-29 15:59:10.297214115 +0400
@@ -200,7 +200,7 @@

     " Project: "{{{
     let s:c.p_basic = {
-        \'path'               : '~/Documents/Riv' ,
+        \'path'               : g:riv_root_path ,
         \'build_path'         : g:riv_build_path ,
         \'scratch_path'       : g:riv_scratch_path ,
         \'source_suffix'      : g:riv_source_suffix ,

but they does not look good because i do not know how to set default value for these 2 variables and have to specify them in my .vimrc explicitly.

Cheers, Alexey.

Can't disable folding

Hi

I tried to disable folding by putting

let g:riv_fold_level = 0
and
let g:riv_fold_auto_update = 0
to my .vimrc

This seems to work with most of the files, but some files are still using folds no matter what I do.

I am using vim 7.3.1287 on Arch Linux, and riv is managed using vundle.

Compatibility with snippet engines

I don't know whether it "assumed" bug or not and I cannot figure out what exactly led to this behaviour, but snippet engines are stop working when riv is enabled.
I tried UltiSnips and SnipMate. Both have same problem.

To clarify: of course it concert only .rst files. Any other files work fine with any snippet engine.

section highlight bug

This highlight OK:

===================
|L4| title l4

But the flowwing does not be highlighted

|L4| title l4

Switching off automatic table formatting (and possibly other options) doesn't work

So, the first thing was to jumping into documentation (pity, that i have to look into the rst instead of simple vim help file, but anyway), and set:

let g:riv_auto_format_table = 0

which didn't work… because:

fun! riv#buf_load_aug() "{{{
    aug RIV_BUFFER "{{{
        if exists("g:riv_auto_format_table") "{{{

Checking for variable existence is not enough. Maybe it can be implemented that way:

diff --git a/autoload/riv.vim b/autoload/riv.vim
index 41d4e4f..c5ae4c2 100644
--- a/autoload/riv.vim
+++ b/autoload/riv.vim
@@ -345,7 +345,7 @@ endfun "}}}

 fun! riv#buf_load_aug() "{{{
     aug RIV_BUFFER "{{{
-        if exists("g:riv_auto_format_table") "{{{
+        if exists("g:riv_auto_format_table") && g:riv_auto_format_table == 1
             au! InsertLeave <buffer> call riv#table#format_pos()
         endif "}}}
         if exists("g:riv_link_cursor_hl") "{{{

There are several other places where only checking for variable existence instead of its value.

Spelling doest not work + howto circumvent it

(First of all, congratulations for your great work.)

Spelling does not work in my system when using riv (when
editing rst files). If I try set spell it does not
highlight any errors and commands like ]s do not work
either.

However, I have found that if I comment line 50 in file
.vim/bundle/riv.vim/after/syntax/rst.vim,

exe "syn include @rst_".code." ".s:{code}path

then spelling works like a charm again.

Versions:

- Vim 7.3
- rst.vim syntax file  2012-09-19

missing strwidth in Vim 7.2

It has no function, "strwidth" in Vim 7.2 in CentOS, so some features will not work. Such as RivTableCreate.

May you fix it?

backspace in insert mode at beginning of line acts as delete key

When this plugin is enabled and I'm in Insert mode and I press backspace while at the beginning of a line it acts like a delete key is pressed instead of removing the preceding newline. When I comment this package out in vundle config the backspace behavior returns to normal. I'm using Vim 7.3 on OS X 10.8.3.

error detected with todo update

I use vundle install the riv.vim,but there are some errors while using it.

when I save a file like test.rst, it will tell me this:

Error detected while processing function riv#todo#update:
line   18:
E482: Can't create file /$Home/Riv/.todo_cache 

I didn't modified any files in dir riv.vim. And I use MacVim on OS X 10.8.3.

Thinks a lot!

Avoid rebinding <Tab> in normal mode

...since it breaks < C-I > as a synonym. So there is no more possibility to go forward through :jumps history.

The problem has the same nature with #49. Maybe the plugin should not bind any mapping except ones with plugin-leader?

Option to disable some features / change mappings

I'd be nice to have an option to disable some features or change mappings. I've run into a problem using riv.vim and Snipmate - both want my <Tab> key. I use SnipMate Snipmate to expand stuff like :m<Tab> to :math: `` in insert mode, but that doesn't work anymore when using riv.vim.

I've tried to make it behave a bit better with

unlet g:riv_default.buf_imaps["<Tab>"]
unlet g:riv_default.buf_imaps["<S-Tab>"]

but somehow it's still not working.

Anyway, this might be a somewhat common problem, as there are many things that could possibly be bound on the tab key. Some way of configuring it would be appreciated. Or telling me how to fix my specific case =)

Riv2"XXX" convert command error

Hi,
I installed Riv by pathogen under Windows 7.
Everything works fine except the Riv2"XXX" error:

Error detected while processing function riv#publish#file2..<SNR>89_single2..<SNR>89_sys:
Line 2:
E371: Command not found

But the Riv2"XXX" function works under command line.
Any information would be appreciated. Thanks for your time

External file links in vim

Hello,

I would like to know if there is a way to use xdg-open to open external file links when editing a rst document. For example, each time I try to open a pdf file, it automatically opens with vim, which is not readable. Am I doing something wrong ? Otherwise I think that would be an improvement to your very useful extension !! ^^

Error Unknown function: riv#degbug when saving

I just installed RiV using Vundle. Anytime I try to save, I get the error:

Error detected while processing function riv#todo#update:
line   24:
E117: Unknown function: riv#degbug

I imagine the error is on line 433 of the file autolaod/riv/todo.vim and it should call riv#debug

[RIV] Update todo cache failed

Whenever I tried to write/save the rst file, it always show up a error message

[RIV]Update todo cache failed

I tried to change the path as below, then run :RivTodoUpdateCache, it looks ok, but it still shows that error message whenever writing file.

" riv
let g:riv_default_path='~/.vim/tmp/Riv'
let g:riv_tmp_path='~/.vim/tmp'

How do you Move text to the next line in a cell?

I am inside a table and my curser is positioned at the _ (underscore). I wish to move all the text after my curser to then next line in a cell

+-----------------------+
| Hello Ry, _I am stuck |
+-----------------------+

Some keystrokes in insert mode changes the cell to the following

+------------+
| Hello Ry, |
| I am stuck |
+------------+

What is the keystroke(s), I should use?

Support indented directives.

Though it's not suggested to use indented directives. And it's already partly supported now.

Sometimes you need one like use a code directive in a list.

The directives now did not stop correctly with indented directive.

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.