I am trying run a test (RSpec) in Emacs using the compile command, but there is a problem with the output; see this screenshot.
I tried to put this in my init.el:
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
And I use ttt-format too.
Can someone help me resolve this issue?
Thanks
Related
I've been using nvim for a while and recently thought about checking emacs out after learning about evil mode. I made init.el in .config/emacs, installed evil mode and figured i would try to enable it whenever i start up emacs.
So i wrote this bit of code in init.el:
(defun evil-mode-on ()
(require evil)
(evil-mode 1))
(add-hook 'after-init-hook 'evil-mode-on)
But unfortunately it doesn't seem to work and i'm not sure what i'm doing wrong. Any help would be very much appreciated and thanks in advance.
You seems to be missing apostrophe(') in require. It should be (require 'evil)
Enabling evil mode at startup could be as simple as specifying
(require 'evil)
(evil-mode 1)
in your init.el file as long as package is already installed and/loaded.
Github page has in detailed instruction to install it automatically with the help of use-package.
I want irony-mode be turned on automatically in c-mode. But I have tried two ways, both fail. Can someone teach me? I don't like to type M-x irony-mode always.
1:
(require 'irony)
(defun my:irony-init ()
(irony-mode 1))
(add-hook 'c++-mode-hook 'my:irony-init)
(add-hook 'c-mode-hook 'my:irony-init)
OR 2:
(require 'irony)
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
I find not only irony-mode, but also ggtags and flycheck can't load through add-hook. I have (add-hook 'c-mode-hook 'flycheck-mode), but it doesn't work. Can someone help me? My .emacs.d has uploaded to github:https://github.com/cfampc/emacs.d。 My irony-mode is configured in .emacs.d/custom/c-settings.el and flycheck ggtags is in .emacs.d//custom/edit-settings.el. Before I can have ggtags-mode auto-load in C. Now, If I add (add-hook 'c-mode-common-hook 'irony-mode) after (load ...) all of my config file, it does work. But if I add it in .emacs.d/custom/c-settings.el , It doesn't work. why?
That should work fine, so you should recursively bisect your config to find the source of the problem.
I just followed this site to install auto-complete on Emacs. I installed it with "M-x load-file RETURN ~/path/to/etc/install.el".
The output of my installation was: http://paste.ubuntu.com/6184523/
After that, I added the recommended code to my ~/.emacs file and restarted Emacs. Typing "M-x auto-complete-mode" says "No match". I also tried to fix it by replacing flet with c-flet etc. but it hasn't changed anything too.
Version: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
Emacs has a package manager now. So just install the package from the list and you're done.
Here's the configuration that adds the two most popular repositories:
(package-initialize)
(add-to-list
'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list
'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))
After this, M-x package-list-packages. The rest is pretty intuitive.
UPD: A simple auto-complete setup for C++
(add-hook 'c++-mode-hook
(lambda()
(semantic-mode 1)
(define-key c++-mode-map (kbd "C-z") 'c++-auto-complete)))
(defun c++-auto-complete ()
(interactive)
(let ((ac-sources
`(ac-source-semantic
,#ac-sources)))
(auto-complete)))
I tried some solutions that worked for other people, but it didn't quite work out.
Try setting the environment variable(s) to ~/emacs.d/ in both .profile and .bashrc
If that doesn't work out, try exporting the environment variable(s) with su root (won't work with sudo).
At least that worked for me while trying to install auto-complete-mode with golangs auto-complete-mode
Today I tried to configure python development in emacs.
I installed pymacs, pycomplete+ , python-mode, python-pep8 with el-get.
When i tried to install rope I got this error
el-get-executable-find: The command named 'hg' can not be found with `executable-find'
then,when I delete the config about "el-get"
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)`
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(el-get 'sync)
the error disappear.
Anyone could help me to fix it?
As already commented, the mercurial dvc command,"hg", was not found in path.
Once noticed Emacs didn't load all executables in emacs variable "exec-path" as in $PATH. This happened when started from a windows-system button. Maybe when started from console it's gone.
Check exec-path, if it includes the directory displayed by "type hg".
Adding it to exec-path via init-file might be an option in this case.
I obtained a git clone of vimpulse and followed the instructions for installation. It basically says to put (require 'vimpulse) in my .emacs file - but this will start viper/vimpulse upon startup, so I tried to have vimpulse load only if I invoke viper-mode with (add-hook 'viper-mode-hook (lambda () (require 'vimpuse)). But when I do this visual mode does not work (tries to open file instead), so instead I now have something like (defun vimpulse-on () (interactive) (require 'vimpulse)). After that to toggle on and off I use C-z. Does that about sound right? So once vimpulse is loaded there's no equivalent of M-x viper-go-away and instead it's suspended until I hit C-z again... Also, any general tips with using viper/vimpulse would be appreciated! Thanks much in advance.
Edit: syntax error corrected. What I had tried was (add-hook 'viper-mode-hook (lambda () (require 'vimpulse)), which does not enable visual mode when viper-mode is started. v in normal-mode appears to be mapped to find-file (or ido-find-file).
(add-hook 'viper-load-hook
(lambda () (require 'vimpulse))
Just load vimpulse in the viper-load-hook.