Vim Fuzzy Finder like for Emacs? - emacs

I'm trying Emacs again, after saw the combination of company+alchemist. And again I'm struggling to find alternatives to some Vim plugins. One of the biggest difficulties is file navigation. With fuzzy finder(https://github.com/junegunn/fzf) I can find a file in any place, only search by his name. I searched hard but can't find anything similar to fuzzy finder/ctrlp in Emacs. There is a good replacement of fuzzy finder for Emacs ?

I have combined the two from #tjbruno answer. https://github.com/ibmandura/helm-fzf/blob/master/helm-fzf.el
Here you can use fzf with helm as frontend :)

There's an Emacs frontend for fzf as well. You can install it from ELPA (M-x list-packages, navigate to fzf, press i then x to install). You need to download the fzf program separately, if you don't already have it.
Alternatively, try out Helm (also available from ELPA). Read this tutorial. It provides the same services as fzf and much more (because it isn't limited to finding files), in its own way.

Related

Emacs django-mode does not detect virtualenv

I am new to emacs, but I know how to navigate the basics.
I simply want Django integration with emacs 24 on ubuntu.
Django-mode seems to be the only game in town, but is there a tutorial that is written with more complete steps? A typical use case would be someone who is not an expert in emacs, but wants to add Django support to emacs.
I have virtualenv and virtualenvwrapper all set up properly. But django-mode is not detecting my virtualenv no matter what I do.
I have a great deal of trouble with the quoted paragraph below on Directory local variables as the documentation is poorly written.
Is this file .dir-locals.el optional? Many of his explanations are confusing. Do I need iPython? I would think not, but I'm guessing the python-shell-interpreter is not optional.
I have made a .dir-locals.el file and added my virtualenv path, but django-mode is not detecting my virtualenv. In emacs it says: virtualenv none.
There are also screenshots of a menu bar that allows alot of neat stuff like running ./manage.py collectstatic, etc....but no mention of how to activate the menu. Maybe this is a basic emacs command but I don't know it and would appreciate it if someone could show me how to set up emacs with django.
Are there any other alternatives or is django mode the way to go? Did I miss a huge chunk of documentation (like is it hiding inside emacs)
Thanks!
Directory Local variables Now we have all set there's a really
important topic to talk about and that's Directory Local Variables.
python.el is directory local variables aware and is in favor of
directory based configurations, that's why understanding this topic is
that important. So I suggest you to read the relevant part of the
manual with M-: (info "(emacs)Directory Variables").
The .dir-locals.el is a file which contains an Association List, but
don't let the name scare you, the following is a quite complete
example of what I'm using to open the current project.
((python-mode (python-shell-interpreter . "python")
(python-shell-interpreter-args .
"/home/fgallina/Code/Projects/anue-site/anue/manage.py shell")
(python-shell-prompt-regexp . "In \[[0-9]+\]: ")
(python-shell-prompt-output-regexp . "Out\[[0-9]+\]: ")
(python-shell-completion-setup-code . "from IPython.core.completerlib
import module_completion")
(python-shell-completion-module-string-code .
"';'.join(module_completion('''%s'''))\n")
(python-shell-completion-string-code .
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
(python-shell-extra-pythonpaths
"/home/fgallina/Code/Projects/anue-site/anue/apps/")
(python-shell-virtualenv-path . "/home/fgallina/.virtualenvs/anue")))
http://from-the-cloud.com/en/emacs/2013/01/28_emacs-as-a-django-ide-with-python-djangoel.html
There was recent a question at Help-gnu-emacs#gnu.org whose answers pertains to your case also
http://lists.gnu.org/archive/html/help-gnu-emacs/2013-06/msg00425.html
WRT this answer only replace Pymacs by django-mode.
For the moment, just use Emacs as editor. Otherwise see some risk to end up in frustration.
IPython is great to learn Python itself, basically it provides an enhanced interactive shell. On IPython is built Enthought -- a Python Distribution providing scientists with a comprehensive set of tools to perform rigorous data analysis and visualization.
Don't see it related to Django so far.

Emacs config script for Lisp

What are some of the choices for pre-made Emacs config scripts? e.g. Lisp-centric keybindings, auto-complete / "intellisense", bracket matching, code formattting, etc.
So far I've only found:
emacs-starter-kit
redshank
There is also Prelude, which I can recommend. It has clean structure and code, and is regularly updated to include new interesting and useful packages or settings.
Do not use configurations from EmacsWiki. Most of what is posted there is very old, has never been updated since, and is hence rather out-dated now. Many of them will not work in modern GNU Emacs versions.
Instead, also look at the Github accounts of people who write Emacs packages, and you'll find many Emacs configurations. Some of these are created to be re-used by other people, for instance https://github.com/purcell/emacs.d.
See http://emacswiki.org/emacs/CategoryDotEmacs, especially under "Some complete InitFiles" and below.
This is my configuration script:
https://github.com/huseyinyilmaz/emacs-config

Automatically opening a file in emacs by specifying the file name

I created a TAGS file for emacs in my django project using the following command on my Linux machine
ctags -eR *
I can now jump to a symbol definition using M-. and specifying the symbol name.In my project i have py,html and css files so is there also a way i can make emacs automatically open a file, if i specify the file name ?.
Thank You
I think you are looking for project management. There are few packages to manage project directory in emacs. The best one may be ede. but Its not easy to setup. It does have some learning curve and its limitations.
Thankfully there are many easy ones. like eproject. https://github.com/jrockway/eproject/wiki
anyway you can also check out emacswiki page for more details. http://www.emacswiki.org/ProjectSettings
http://www.emacswiki.org/emacs/find-file-in-tags.el
IDO (Interactive Do) mode does this. If you activate it, C-x C-f searches for files matching what you are typing, interactively. Beware though, it may take some time to get used to it.
[edit] The search is based on files or directories you've recently visited, and you can use M-s to force a search.
From the comments, I figured that you are looking for has nothing to do with tags, you just want a better find-file that makes good automatic guesses for the path given only the file name.
For this, I use the entirely awesome ido-mode: http://emacswiki.org/emacs/InteractivelyDoThings

Emacs inside of gedit?

After years of experimentation with editors, the fact is I prefer them as minimal as possible. I never use fancy features and the full-feature IDE's become bloated, heavy, and slow. Of course, when I do something that pretty much requires a specific IDE (like Android dev and Eclipse) I have no problems using it. But most of the time, I use gedit for programming.
However, I like many Emacs commands, and I want to use them occasionally. Is there a way to embed Emacs inside of gedit? For instance, I envision pressing alt-q (or whatever combo) and Emacs mode is enabled, and from then on all my key presses in the current tab do Emacs commands. I press alt-q again, and it turns off. This would allow me the best of both worlds. Anything like this exist, or do I need to write this plugin myself?
No.
I've seen discussion of embedding of Emacs in other applications in the past, and the consensus is that even that's not feasible, let alone what you're suggesting.
You'd be better off identifying what gedit does that makes you want to use it instead of Emacs, and extending Emacs to make it do that, too. (There can't be that much --- gedit doesn't do much.) The extra features can just sit there and wait for you, and you'll find it easier to locate and use them if you're comfortable in Emacs-mode already.
(On top of all the other advantages of Emacs, you gain the ability to use the same editor you use in a windowed environment on the terminal --- a huge advantage.)
Or maybe yes . . .
You can use the External Tools plugin of gedit (look for it in Preferences). Add a new command, bind it to the key you want, and use this script:
#!/bin/sh
FILE_NAME=$GEDIT_CURRENT_DOCUMENT_PATH
emacs $FILE_NAME
If you want it to open in the currently-running Emacs, replace emacs with emacsclient, and add the following to your .emacs:
(server-start)
This is kind of backward. Why don't you just use Emacs and stay away from all the extra bells and whistles? It'd probably be easier to coax emacs to emulate gedit than the other way around.
If gedit (a) can be scripted to launch another application with the current file as an argument, and (b) will notice if the file is modified on disk and offer to reload it, then you would have a workaround.

How to Make Eclipse More Like Emacs

I am very familiar with emacs--and I realize that there is nothing that it cannot do--but there are some things that it does not do well or efficiently. So, being between projects I am open to the idea of switching to a full-featured IDE such as Eclipse.
With muscle-memory being what it is, I would like to make Eclipse as emacs-like as possible. I have already discovered the excellent Emacs+ plugin which gets me about halfway there. However, I am still missing the following features of emacs which I routinely rely upon:
shell: It's not just a shell, it's also a buffer.
occur: Search->File... is close to what I want, but I just want it to search the current file--which might be a text file, a logfile, or a shell buffer, or whatever.
align-regexp: This awesome little command in emacs helps me make files more readable, and alignment helps with keyboard macros.
What plugins would you recommend to solve these issues? Are there any other emacs features you miss in Eclipse or plugins you would recommend?
Please, no emacs/vi zealots asking why on Earth I would do such a thing.
For the shell you have WickedShell
Ctrl+F is enough to trigger a Search within the current file. (does not create a new buffer with matched lines)
Only Mark Occurrences is about highlighting occurrences, but that is not as advanced as the Emacs function.
Formatter options can emulate "align-regex" function, as described here.
Preferences -> Java -> Code Style -> Formatter.
Click 'Edit' on the profile (you may need to make a new one since you can't edit the default).
In the indentation section select 'Align fields with columns'.
Then, in your code Ctrl+Shift+F will run that formatter.
I can confirm Brian's suggestion (Emacs key-bindings). What I do to resolve this dilemma is to use both Emacs and Eclipse simultaneously. They are both very good at reporting external changes to files so there is minimal chance of tromping on edits (but it can happen). More to the point, you can leverage the strengths of both tools without having to give up either one. The combination of using both tools and Eclipse having Emacs key-bindings makes this quite satisfactory for me.
IIRC (It's been a while since I've used eclipse) eclipse has a "use Emacs key-bindings" mode. I believe that there's also the option to tell eclipse to use emacs as its own editor...