grizzl / fiplr

[DEPRECATED] An Emacs Fuzzy Find in Project Package
187 stars 14 forks source link

Allow favourite/quick move between perdefined dirs #13

Open zeltak opened 11 years ago

zeltak commented 11 years ago

Hya Fiplr works great thx alot for it. i was wonderinf 2 things:

a.im intrested to launch files not just from the current dir but from favourite dirs as well. is it possible to have a command/hotkey/easy switch keyword etc to have fiplr also cache/look at user specific dirs?

b.is it possible to make fiplr start at defined position in files (and remember that position for each file)

thx alot

Z

dgutov commented 11 years ago

a:

(defun fiplr-downloads ()
  (interactive)
  (let (buffer-file-name
        (default-directory "~/Downloads"))
    (fiplr-find-file)))

Not sure about looking in several directories at once.

b:

(defun esk-turn-on-save-place-mode ()
  (require 'saveplace)
  (setq save-place t))

(add-hook 'prog-mode-hook 'esk-turn-on-save-place-mode)
zeltak commented 11 years ago

Thx Dgutov, appriciate the help!

the first function dosent seem to work, unless im missing something (and it may very well be since im a neewb) after evaluating that block shouldnt i only see files from ~/Downloads? when i issue fiplr-downloads i get this:

https://paste.xinu.at/HKC/

Ie files from my .emacs.d dir

what am i mising here?

also for the second function will that take me to the last postion viisted in the file? i was wondering if there was a way to go to a specifc place in the file (line number or bettrer yet and org headline).

thx and all the best

z

dgutov commented 11 years ago

the first function dosent seem to work, unless im missing something

Yes, sorry, try the updated code. For some reason, fiplr looks at buffer-file-name first, so I'm binding it to nil now.

for the second function will that take me to the last postion viisted in the file?

For newly opened files, it will take you where point was before you closed them last time. See (describe-package 'saveplace) for longer description. If you want more than that, I have no idea how you would input the desired line numbers, et cetera.

Note that the above code only enables saving place in major modes inheriting from prog-mode.

d11wtq commented 11 years ago

This probably isn't a solution you're interested in, but fiplr pays attention to the file you're currently editing when choosing which project it will index for. So if you have two projects A and B, you can open fiplr from a file inside A and see only files belonging to A. Now if you use C-x C-f to navigate to a file in project B (such as a README or LICENSE), then run fiplr-find-file, it will show you files from project B. If you switch buffers between files in different projects, fiplr will follow you around and know which project that file came from. This is how I work, but I agree it could be improved by adding a specific feature to move between projects. I've considered adding a key-binding to bring up a prompt for "Choose project root: " while fiplr is open, but it's not a high priority as it's not hugely better than the C-x C-f solution.