Giter Site home page Giter Site logo

terminator-editor-plugin's Introduction

Terminator Editor Plugin

Terminator plugin to open a file uri, including line number, in an editor. When the configured regex is matched, you can click the link and open the file in a previously configured editor. See the demo at https://github.com/mchelem/terminator-editor-plugin/wiki.

Installing the Plugin

  • Create the plugins folder if it doesn't exist. On linux: mkdir -p ~/.config/terminator/plugins
  • Copy the plugin file to the plugins folder.
  • In Terminator go to Preferences >> Plugins and enable EditorPlugin.
  • Restart Terminator.

Using the Plugin

  • Use the grep command (e.g. grep -rn import *.py)
  • Use <ctrl>+click to open the file.
  • Right click to copy the link.

Configuration

The configuration file is located at ~/.config/terminator/config. Update the command under the [[EditorPlugin]] section to suit your needs. A few examples are below:

command = gvim --remote-silent +{line} {filepath} 
command = "gvim --remote-silent +"call cursor({line}, {column})" {filepath}"

command = gedit +{line} {filepath} 

command = sublime {filepath}:{line}

command = emacsclient -n +{line} {filepath}

You can specify the regex to match filenames to your liking.

Regex examples

The inputs to the editor may be specified using the groups parameter. By default the first group matched is the filename and the second is the line number (groups = "file line").

File paths with a specified line number (ex: some/file/path.txt:12) (default):

match = ([^ \t\n\r\f\v:]+?):([0-9]+)

File paths followed by line number and column:

match = "([^ \t\n\r\f\v:]+?):([0-9]+):([0-9]+)"
groups = "file line column"

Specific file types with or without a line number specified:

match = ([^ \t\n\r\f\v:]+?\.(html|py|css|js|txt|xml|json))[ \n:](([0-9]+)*)

File paths with or without line numbers and Python stack traces:

match = ([^ \t\n\r\f\v:"]+[\.\/][^ \t\n\r\f\v:"]+)?(". line |:)([0-9]+)*
groups = "file separator line"

Warning: Use quotes in your parameters if you want to include a comma.

terminator-editor-plugin's People

Contributors

mchelem avatar pkkid avatar hugomaiavieira avatar fotanus avatar amigrave avatar nofxx avatar

Watchers

James Cloos avatar Rolandas avatar  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.