I am using emacs prelude and enable evil mode. Then in the file of /home/oracle/.emacs.d/personal/daniel.el I have the following line
(setq evil-toggle-key "C-q")
But emacs still use C-z as evil toggle-key.
Related
I would like to use Julia with Emacs and have installed julia-mode, julia-repl and lsp-julia. I am using Julia 1.7.3.
I have added the following to my init.el
(require 'lsp-mode)
(add-hook 'julia-mode-hook #'lsp)
(require 'lsp-ui)
(require 'julia-mode)
(require 'julia-repl)
(require 'lsp-julia)
(julia-repl-set-terminal-backend 'vterm)
(add-hook 'julia-mode-hook 'julia-repl-mode) ;; Always use minor mode
(require 'vterm)
However, when I have the (add-hook 'julia-mode-hook #'lsp) line enabled the keyboard shortcuts don't work (e.g., C-Enter is not found). All I want to do is set up julia in Emacs in a similar way using LSP with keyboard shortcuts to how I have it in VSCode.
What have I done wrong in my init.el?
I am finally getting close to a nice emacs environment, based off of this baseline. However, many of the python-emacs tutorials mention things like "C-c C-c to run this in a python shell", or "C-c !" to launch a python shell". For some reason I am not getting this functionality. I am getting C-c C-c is undefined. What does work is M-x run-python.
Why am I not getting the standard behavior? I am running emacs through cygwin, which has both python and ipython installed.
Your sample init.el uses a different python mode than the tutorials you read.
python-mode.el (line 3147/3152) defines:
(define-key map [(control c)(control c)] 'py-execute-buffer)
(define-key map [(control c)(!)] 'py-shell)
but does not define run-python, which is instead defined in python.el, which is distributed with emacs since version 24.3. and is set as the default python mode in your referenced init.el.
See EmacsWiki: Programming With Python Mode Dot El for setup instructions for python-mode.el.
I just upgraded my Ubuntu from 12.04 to 14.04.
When I edited .tex file under 12.04, I have set up my Emacs in such a way that C-c C-c launched automatically Latex, View or BibTex according to the circumstance. Consequently, I just needed to keep pressing C-c C-c to compile and view a simple .tex file. A part of the ~/.emacs file is as follows:
(require 'server)
(or (server-running-p)
(server-start))
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)
(defun pdf-with-okular ()
(add-to-list 'TeX-output-view-style
(quote ("^pdf$" "." "okular %o %(outpage)"))))
(add-hook 'LaTeX-mode-hook 'pdf-with-okular t)
(setq TeX-view-program-list '(("Okular" "okular %o")))
(setq TeX-view-program-selection '((output-pdf "Okular") (output-dvi "Okular")))
(eval-after-load "tex"
'(setcdr (assoc "LaTeX" TeX-command-list)
'("%`%l%(mode) -shell-escape%' %t"
TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")))
(custom-set-variables
'(LaTeX-command "latex -synctex=1")
'(cua-mode t nil (cua-base))
'(show-paren-mode t)
'(tool-bar-mode nil))
After upgrading, this mechanism does not work anymore: C-c C-c launches Command [pdflatex], and if I just press Enter, it could not find the .tex file.
Does anyone know what is wrong?
It sounds like the command you expect to be bound to C-c C-c is not -- some other command is.
C-h m tells you what mode you are in, and some things about it. C-h k C-c C-c tells you what command is bound to C-c C-c, and it gives you a link to the library where that command is defined.
This info, together with your init file and the Lisp source code, will help you find out why C-c C-c is not bound to the command you expect.
And you might want to start your search by bisecting your init file, to narrow it down to the code that causes the problem.
In sum, the answer is to ask Emacs first.
The command that you describe comes from the AUCTeX extension, which replaces the built-in LaTeX mode of Emacs. It appears that AUCTeX was not properly upgraded or removed from your system, so you are back to the built-in mode, which is pretty primitive compared to AUCTeX.
Check whether AUCTeX is still available in your Emacs session (e.g. M-x locate-library RET auctex). Also, check whether the AUCTeX package is still installed, and reinstall it if necessary.
Alternatively, you can obtain AUCTeX from GNU ELPA with Emacs' built-in package manager, which makes your Emacs setup independent from your system.
I have successfully installed hy-mode from https://github.com/hylang/hy-mode. I now can open a .hy file in emacs and have syntax highlighting, and editing with paredit is a joy.
I however, don't know how to start a REPL. At the bottom of the github readme, it says:
When in hy-mode, you can launch a Hy REPL by launching a Lisp inferior
process
M-x lisp-inferior-process
That function, however, is not defined for me. What else do I need to install or check to be able to use the repl for Hy?
I am currently using:
GNU Emacs 24.3.1.
Have you tried to set inferior-lisp-program to "hy" and then doing M-x run-lisp?
This is the standard way (or maybe just the "way I know about") of having an inferior lisp process.
As of version 1.0.4 of hy-mode, you can start a hy repl buffer in Emacs using M-x run-hy or use the default key binding of C-c C-z.
In any Emacs mode, including hy-mode, you can use M-x describe-mode or the default key binding of C-h m to show key bindings for the current mode.
When I start aquamacs with the autocompletion program
installed, http://cx4a.org/software/auto-complete/, with a lisp file that has el as an extension (example.el)
Then all lisp features are loaded into aquamacs including autocompletion.
But when I load a common lisp file (example.lisp) no autocompletion features are loaded.
So my question is, is it possible
to change the autocompletion code so also common lisp files are
recognized?
Thanks
From autocomplete manual:
Enable auto-complete-mode automatically for specific modes
auto-complete-mode won't be enabled automatically for modes that are
not in ac-modes. So you need to set if necessary:
(add-to-list 'ac-modes 'brandnew-mode)
Or in your case
(add-to-list 'ac-modes 'lisp-mode)
Just for info. By default the following modes are included
(defcustom ac-modes
'(emacs-lisp-mode
lisp-interaction-mode
c-mode cc-mode c++-mode
java-mode clojure-mode scala-mode
scheme-mode
ocaml-mode tuareg-mode
perl-mode cperl-mode python-mode ruby-mode
ecmascript-mode javascript-mode js-mode js2-mode php-mode css-mode
makefile-mode sh-mode fortran-mode f90-mode ada-mode
xml-mode sgml-mode)
"Major modes `auto-complete-mode' can run on."
:type '(repeat symbol)
:group 'auto-complete)