Comments (5)
Its a void variable probably because you're attempting to set the key before the mode is loaded. You should double check that lispy is loaded before trying to define the key in the map.
from lispy.
OK, eval-after-load
solved this Debugger entered--Lisp error:
problem.
But the real problem is I cannot disable a key binding defined in lispy
.
I have to quote my real problem.
lispy-newline-and-indent-plain
basically do nothing butnewline-and-indent
, the thing is I made adefun
in my.emacs
to makeRET
more powerful, so the(define-key map (kbd "RET") 'lispy-newline-and-indent-plain)
inlispy.el
is in conflict with myRET
.
and
And there is another function called
lispy-move-end-of-line
, but I got a more powerful customizedC-e
, I really need to disablelispy-move-end-of-line
.I believe there are more examples like these two.
So as I said in #30, since you use a lot of lispy-xx to replace the default bindings, I hope you can
give us the abilities
to disable them if we want, but I tries many ways, I cannot disable a single key binding defined inlispy
.
If there is no way I can disable key binding of lispy
without touching lispy.el
, you should modify lispy package, check out rebox2
from lispy.
The simplest way to redefine bindings is like this:
(require 'lispy)
(define-key lispy-mode-map (kbd "RET") 'newline-and-indent)
Here's the actual approach that I'm using (requires use-package
package):
(use-package lispy
:load-path "~/git/lispy"
:init
(progn
(define-key lispy-mode-map (kbd "φ") 'lispy-parens)
(define-key lispy-mode-map (kbd "σ") 'lispy-braces)
(define-key lispy-mode-map (kbd "ρ") 'lispy-brackets)
(define-key lispy-mode-map (kbd "θ") 'lispy-quotes)
(define-key lispy-mode-map (kbd "C-φ") 'lispy-parens-down)
(define-key lispy-mode-map (kbd "χ") 'lispy-out-forward)
(define-key lispy-mode-map "π" 'lispy-ace-char)
(define-key lispy-mode-map "κ" 'lispy-ace-paren)
(define-key lispy-mode-map (kbd "C-M-a") 'lispy-beginning-of-defun)
(define-key lispy-mode-map (kbd "C-x C-j") 'lispy-debug-step-in)
(define-key lispy-mode-map (kbd "C-8") nil)
(define-key lispy-mode-map (kbd "C-9") nil)))
from lispy.
To disable a binding of lispy-mode
and have the global one take over,
do this:
(define-key lispy-mode-map (kbd "RET") nil)
from lispy.
I know why I failed to disable the RET
in lispy
, because I disable it in
(add-hook 'emacs-lisp-mode-hook
(lambda ()
'(progn
(lispy-mode 1)
(define-key lispy-mode-map (kbd "RET") nil))))
it will fail, or in
(eval-after-load "lispy-mode"
'(define-key lispy-mode-map (kbd "RET") nil))
it should be "lispy" not "lispy-mode".
from lispy.
Related Issues (20)
- `make test` fails
- Repeat self-insert-command does not. HOT 4
- Package specifier is interpreted as start of new symbol in Common lisp. HOT 6
- EOL comment makes ";" comment one more s-exp
- `(#:a->b)` is formatted as `(#:(ly-raw symbol "a->b"))` HOT 2
- lispy unexpectedly expands shorthands in elisp HOT 1
- lispy-toggle-thread-last fails with comments HOT 1
- Consider importing gnureadline instead of readline when necessary
- Consider making native completion optional or consistent with "python-shell-completion-native-enable"
- Feature request: possibility to enable just some of the keybindings.
- `lispy-tab` doesn't respect `indent-tabs-mode`
- Add support for treesit mode
- Add support for Fennel and/or Lua HOT 1
- conflicting key mapping in evilcp theme?
- Error with Clojure evaluation HOT 7
- Port to R?
- Numbered anonymous function arguments are being incorrectly auto-formatted
- Fix warning on Emacs 30 related to deprecated (defadvice) macro
- jedi should not be imported into the active (lispy--python-proc) HOT 2
- org-elements "cannot be used in non-org buffer"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lispy.