https://github.com/vic/mrt
Inverse of shell command, find file first and act accordingly on it. A fast file finder with curses interface.
https://github.com/vic/mrt
Last synced: about 1 year ago
JSON representation
Inverse of shell command, find file first and act accordingly on it. A fast file finder with curses interface.
- Host: GitHub
- URL: https://github.com/vic/mrt
- Owner: vic
- License: bsd-3-clause
- Created: 2011-03-17T10:07:38.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-22T18:17:40.000Z (almost 15 years ago)
- Last Synced: 2025-02-09T21:11:57.844Z (over 1 year ago)
- Language: Ruby
- Homepage: http://vic.github.com/mrT
- Size: 1.87 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Mr T
====

What is it.
-----------
MrT is a curses based file finder. If you're familiar with Textmate's cmd-t,
Vim's [Command-T](http://wincent.com/products/command-t) plugin, or Emacs'
[Anything](http://www.emacswiki.org/emacs/Anything), you'll feel right at home.
MrT allows you to have fast, file completion from your shell prompt. You can
use it as-is by invoking the _mrt_ command, or use it as your default file
completion strategy for some unix commands.
Requirements
------------
MrT requires ruby version 1.8.7 or greater, it has been tested with 1.9.2.
It requires your ruby to have been compiled with the standard _curses_ and
_readline_ libraries. If you are building your own ruby or are using _rvm_
make sure you have needed development libraries before compiling ruby.
We use the [Command-T gem](http://github.com/vic/Command-T/tree/gem), we
expect our changes can be integrated into Command-T's main repo.
Installation
------------
rake install
You might want to add the *pity* alias to your ~/.bashrc to easilly
kill a fool process.
alias pity="ps -eopid,cmd | mrt - 3>&1 1>&2 2>&3 | awk '{print\$1}' | xargs kill"
Usage
-----
After installation, you might be able to use the _mrt_ binary, right now it
takes an optional directory as only argument.
MrT not only allows you to find files, if you hit the TAB key upon
a selected file, MrT will present a set of actions to execute on it.
Even though MrT was created for fast file finding from the shell prompt, it
is not restricted to work only on files. Actually, because of MrT's addon
design you can easily configure it to complete on anything you want.
As with vim, you can use the _backslash_ key (we call it _Leader_) to change
from one selector to another using _Leader_ + _someKey_.
Use _Leader_ + _space_ to show available selectors.
Configuration
-------------
A YAML file ~/.mrtrc with a Hash content can be used for
configuration.
Default values are:
# used to determine which files should be excluded from listings.
# this is a list of glob patterns.
ignore_patterns: []
# if true and no directory is specified, mrT tries to guess git project root.
find_git_root: true
# max depth of directories to find files in.
max_depth: 15
# max number of matches to display.
max_files: 10_000
# if you're inside a Git repo, should Mr T use your ignore patterns?
# by default Mr T will only use gitignore
patterns_in_git_repo: false
# should hidden directories be scanned?
scan_dot_directories: false
# should hidden files be shown?
show_dot_files: false
# if you're inside a Git repo, should Mr T ignore the same files as Git?
use_git_ignore: true
Customization
-------------
If a .mrtrc.rb file is found at your $HOME directory
it will be automatically loaded. On a git repo you can place it at the root dir.
Future
------
Use Command-T caching features, expose Command-T options as command line flags.
Contribute
----------
Feel free to adapt mrT to your needs, report any issue or send pull requests
to the github repository:
http://github.com/vic/mrT
Authors
-------
- [Victor Hugo Borja](http://github.com/vic)
- [Eduardo Lopez](http://github.com/tapichu)