Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.82 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.82 KB

erb-navigator

A simple nvim plugin to jump around in eruby files.

At the moment there are three (probably buggy) features:

  1. List all ruby comments (<%# … %>) in the current buffer and jump to them by pressing enter.
  2. List all partials/views rendered in the current buffer (This is a jumplist, too)
  3. Go to the partial/view mentioned in the current line.

How to use

No. command lua
1 :Erbnavigator require("erb-navigator.comment_jumplist").nav()
2 :ErbnavigatorViews require("erb-navigator.views_jumplist").nav()
3 :ErbnavigatorGoPartial require("erb-navigator.views_jumplist").go_partial()

default settings

require('erb-navigator').setup({
    comment_jumplist = {
        regex = "<%%# *(.*) *%%>", -- the regex used to extract the comments
        line_numbers = true, -- show the line numbers in the list
        width = 100, -- width of the window
        height = 30, -- height of the window
        borderchars = { "", "", "", "", "", "", "", "" }, -- the borders, nil means no border
        keep_indent = true, -- preserve the indentation of the file (shows the values in a hierarchical manner)
    },
    views_jumplist = {
        line_numbers = true, -- show the line numbers in the list
        width = 100, -- width of the window
        height = 30, -- height of the window
        borderchars = { "", "", "", "", "", "", "", "" }, -- the borders, nil means no border
        filter_path = nil, -- a regex for files to be removed from the list. (e.g. '/?common/?')
        partial_regex = "<%%=%s*render[^\"']*[\"']([a-zA-Z_/]+)", -- regex to extract the partial-names
    },
})  

screenshots

erbnavigator4