Skip to content

A simple nvim plugin to jump to a specific eruby comments

Notifications You must be signed in to change notification settings

Thomas485/erb-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A simple nvim plugin to jump to a specific eruby comments

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published