Spacemacs uses evil-mode which is a VI emulation layer. Evil-mode adds VI modal editing to spacemacs. In a nutshell modal editing has different modes where keybindings do different things. This is partly so that keybindings can remain short and easy to remember.
In essence, the answer to your question is that you enter the space character by switching to ...
It's not documented well enough, and possibly poorly named, but the hideshow function hs-hide-level will collapse all the blocks within the current block. That is, if your cursor is on the class ... line (or below it) in your example input, it will give you something very similar to your desired output. Since hideshow works with indentation I've found that ...
M-| (M-x shell-command-on-region) runs a shell command using the region as stdin, display the output in the echo area, with a prefix arg, replace the region with the output.
Unlike your shell in a terminal, each use of M-! or M-|: start a shell such as bash, run the shell command, then kill the shell. And the region is data passed to the shell command, the ...
I noticed the d key deleting a line on a single press as well. I am using Spacemacs email@example.com on the develop branch. I do not know if this is your case, but I had an incomplete search in progress.
Steps to reproduce:
In command mode, initiate a search by pressing the / key
With the mouse, click on any text in your buffer
Press the d key a single time ...
I have something like this in my config,
inspired by spacemacs:
:commands (evil-leader-mode global-evil-leader-mode)
I believe the method given in the question, although not efficient, is sufficient. Let me explain it in greater detail. Assuming you have evil-mode enabled:
Toggle hs-minor-mode to enable folding
Place your cursor at the first column of a def statement line. This can be done by pressing 0
Record a macro which folds the current section and then moves to ...
On the emacs wiki for evil there is a section about this: Managing keymaps > Overriding and intercept keymaps:
Overriding and intercept keymaps
There are Emacs modes that provide their own single letter key bindings, independent of Evil. BufferMenu, Ediff, and Edebug are a few examples. By default, Evil allows these modes’ keymaps to override Evil’...
If there's no such command in Vim, there won't be one in Evil either. If there is one, but it doesn't work right, consider reporting a bug. :wbd isn't a thing in my Vim, but it's not hard to recreate it with a bit of Emacs Lisp:
(evil-define-command evil-write-and-kill-buffer (path)
"Save and kill buffer."
This works as expected:
(evil-define-key 'normal 'global (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal 'global (kbd "SPC TAB") #'ivy-switch-buffer)
(evil-define-key 'normal Info-mode-map (kbd "SPC") (make-sparse-keymap))
(evil-define-key 'normal Info-mode-map (kbd "SPC SPC") #'Info-scroll-up)
Notice that Info-mode-map is not quoted like it was ...
If I understood correctly, you want to press * to highlight the matches while keeping the cursor in the same place, and afterwards pressing n or N to move to next or previous match, right? You can do that with the following code:
(defun my/star-keep-position ()
There is no such variable in the version of Emacs that you are using. Perhaps you are using a version of Evil that expects a different version of Emacs, where that variable is defined.
In any case, please remove everything from the code you show that is not relevant to reproducing the problem. E.g., I'm guessing that the key-binding code is not relevant to ...
The following function should meet your goal:
(defun my-insert-new-sibling-after-current (&optional force-heading)
(if force-heading ; is set to t
(org-speed-move-safe (quote ...
This will call the underlying command of C-x C-s. You can also call evil-write if you prefer the :w command behaviour
This is impossible with Evil's current design. Here's roughly what happens for a normal Emacs command:
Emacs waits for a complete keybinding
You press a key
Emacs looks it up in the currently active keymaps
It finds a match for a prefix
It waits for another key in that prefix map
It looks it up again
This repeats until a full keybinding has been read
All you need to do is assign your keybinding of choice to
evil-window-map, whose docstring is:
Prefix command (definition is a keymap associating keystrokes with commands).
In your case, the following should work:
(global-set-key (kbd "\C-c w") #'evil-window-map)
After using < or > to indent a selection in visual mode, you can use gv to restore the previous selection and do some other action. If you wish to selection to be restored automatically, you can create your own functions for that and rebind your keys, like this:
(defun my/evil-shift-right ()
(evil-shift-right evil-visual-beginning ...
Generally, I recommend to avoid key translating in emacs. I know it's common in vim but in emacs I think it's better to map your actions using modes and commands. That's because, in contrast to vim, everything in emacs is a command, so you don't really need to rely on key translation. You can check which command a key stroke is bound to with F1 k [key]. If ...
Same way you do it in Vim, by typing the amount of lines you want to scroll, then the command. Alternatively you can provide the numeric argument by typing any of C-1..C-9 or M-1..M-9 or using whatever Spacemacs has mapped the universal argument to, followed by numbers.
Edit, this is now a package which can be used for undo/redo with evil-mode - undo-fu.
Adding answer to own question since I've been using evil w/o undo-tree for some time now.
This works surprisingly well to undo/redo which wraps emacs undo without anything heavy like undo-tree or redo+.
(defun simple-redo ()
Beside describe-keymap function which-key-dump-bindings can be useful what key-bindings my modes provides.
which-key-dump-bindings answers the question Which key bindings I can use in this buffer?. Function will allow you understand which minor, major modes keys and global key bindings are active and can be used.
Function will ask for prefix:
I've submitted a pull request to fix this in the evil-tabs repo just now, so hopefully it will be applied soon. But in case it isn't or you don't want to wait (anyone coming here just now as I did) you can change evil-tab-sensitive-quit to be:
(evil-define-command evil-tab-sensitive-quit (&optional bang)