4 ms·
Show HN: completeme, 't' in Github for Bash
- GhotiFish 14y agoYou opted for JSON for configuring your project. I've seen other people do that, but the problem is most interpreters don't support comments (because comments arn't part of json) and even if you have really_verbose_names_with_underlines_for_spaces, sometimes you just can't get away without comments. YAML, I think, is better suited for configuration files. Disclaimer: This is a minor criticism.
- glenjamin 14y agoDepending on how strict the interpreter of the JSON is, you can often get away with using unexpected keys - something like: { "//comment": "default = 0", "godMode": 1 }
- mattspitz 14y agoThanks for the thought. I wanted to use something like YAML but I didn't want to introduce an unnecessary dependency. Upon further review, I probably could have used a vanilla .ini file and ConfigParser (http://docs.python.org/2/library/configparser.html http://docs.python.org/2/library/configparser.html) It's a built-in module and .ini supports comments.
- notaddicted 14y ago(not OP) I personally like using regular python for python project config files (like django does.) If you want to keep it simple, it will be simple, if you want to do something fancy you have the whole language.
- calinet6 14y agoEh, SublimeText does this already. Cool to have it in Bash though.
- mattspitz 14y agoThat may be where GitHub got it from. I don't use SublimeText because it's not installed on all the machines I login to. Also, GUI windows are a pain.
- kzrdude 14y agoAnd TextMate did it before Sublime :)
- calopetreep 14y agoI find tiling window managers to alleviate the pain of GUI windows. I use XMonad, and I love it!
- briandoll 14y agoYep, this was inspired by TextMate. Here's the blog post when this was announced: https://github.com/blog/793-introducing-the-file-finder https://github.com/blog/793-introducing-the-file-finder Hard to believe that shipped two years ago
- mrcoles 14y agoVery cool, I love using this feature on github. Looks like it looks for github repos, and will search up the tree and back down from there. However, this seems to mess up for me. If I go into a sub-directory in a repo and then try to open a file in the parent directory via `ctl+t`, then it tries to open that filename in the current directory, not from the parent (I'm using emacs as $EDITOR). One other little thing, is there a way to get curses to cleanup better after itself? My terminal ends up with a relatively large blank spot after finding something, viewing it, and then closing emacs.
- mrcoles 14y agoA little more info—I'm using iTerm2 on Mac OS 10.8.2 Also, it'd be really nice if the open action ended up in my bash history, e.g., open something via `completeme`, close it, and then use ctrl+r or the up arrow to get back to it and open it again. One more—running the escape command (ctrl+g) seems to exit emacs? (using emacs 24.2.1)
- mattspitz 14y agoReplying to everything: - Good catch on the subdirectories within a git repository. Currently, we'll open the file you end up on with $EDITOR, which isn't necessarily correct relative to your cwd. I'll fix that. - Re: curses cleaning up after itself, I haven't seen that in xterm or terminator. Are you sure that's completeme's fault? Perhaps it's iTerm or emacs? I've never used iTerm and don't have access to a Mac. It could have something to do with this function not getting called: https://github.com/mattspitz/completeme/blob/80328799a000180bdc1bf64ddfb188161f217914/completeme/__init__.py#L49 https://github.com/mattspitz/completeme/blob/80328799a000180... - I originally had this writing to your bash history but removed it because it wasn't really executed by the user. This may end up being obviated by: https://github.com/mattspitz/completeme/pull/1 https://github.com/mattspitz/completeme/pull/1 I'd like to have Return open your editor (with history) and something else (Tab?) dump back into your prompt. - I don't know what could cause your misbehavior in emacs with Ctrl+G. I'm using 24.3.1 and can't reproduce it.
- smokestack 14y agoThis removes a major bash painpoint for me. Wicked awesome.
- mattspitz 14y agoThanks!
- marksteve 14y agoWishlist #1 in a pull request :)
- mattspitz 14y agoYou are awesome.
- goldfeld 14y agoI've no idea how I'm supposed to install it. Didn't find instructions anywhere.
- mattspitz 14y agoUse pip, http://www.pip-installer.org/en/1.3.X/ http://www.pip-installer.org/en/1.3.X/. Sorry for my assumption.