meow-edit / meow Goto Github PK
View Code? Open in Web Editor NEWYet another modal editing on Emacs / 猫态编辑
License: GNU General Public License v3.0
Yet another modal editing on Emacs / 猫态编辑
License: GNU General Public License v3.0
Emacs's "Easy Customization" mode supports the ability to enter a comment about a variable setting. This is one "special mode," where the user would enter text with spaces. This might be a concern for other special modes, but I'm not sure.
Example:
M-x customize-variable RET tool-bar-mode RET
Click "State" button, and select "Add Comment".
Then click on (or TAB over to) the "Comment:" field to enter a comment.
Since it is a special Emacs mode, Meow sets MOTION as the default state in Custom-mode.
But this prevents entry of spaces in "Comment:" fields, because the MOTION state uses space bar as a leader key.
One has to do "M-x meow-insert RET" before entering the comment. It's only a minor annoyance.
---end of issue, beginning of praise---
:-D
I've only just started using this package, but I'm very impressed with how it handles modal editing.
I especially like how the suggested Dvorak layout mirrors bindings that are commonly-used in Emacs's special modes (dired, ibuffer, et cetera). This is very smart. It avoids both context-switching and having to rebind every single major-mode to match the modal editing layout. I had thought of trying to configure something similar to this. Your package already does it, plus so much more.
I wasn't familiar with Kakoune, so the selection-combined-with-movement paradigm is also quite interesting. It seems like it will be even more efficient than evil-mode, but I'm just getting used to it.
One other suggestion: I think it might attract more interest if you referred to the "suggested" layouts as "default" layouts and included them in the package (rather than requiring cut-and-paste from the readme). Instead of saying that the user must define their own layout, you could simply advise that it's trivial to change the layout as the user sees fit.
I think the layouts you've devised make great sense and are worthy of being "defaults."
If you don't introduce multiple-cursors, iedit, etc, basically you have two Emacs built-in ways to edit multiple places at the same time: query-replace and kmacro. Kmacro is a little hard for beginners but it can be considered as a 100% use cases covered solution and it's built-in. Meow will embrace kmacro since Meow is designed to have tight integration with vanilla Emacs.
Meow provides two commands work with kmacro: meow-kmacro-lines
and meow-kmacro-matches
. They respect the important design principle:
A kmacro could be defined at any position, and can apply to here and there. That means we have to leave kmacro what it is, there's no "kmacro+", no addition states, no magic Do-What-I-Mean commands.
These two commands simplify how kmacro is called, instead of you define a kmacro call it N times, you call kmacro for lines in a region or matches with regexp. However, the functionality of these two commands are pretty limited.
meow-kmacro-matches
need to work with narrow-to-region
, if you want to specify a rangeTBD
TBD
Hello!
First, I want to say this package is awesome! I am using it a couple of weeks, and I think its concept is amazing. Complex and a bit intricate, but it has an understandable logic behind it. The possibilities of customization are huge but not insurmountable.
Now, I want to ask: is it possible to choose another LEADER key besides SPC?
It would be interesting for me to use INSERT as a key for that LEADER role, instead of SPC.
This is mostly a matter of personal taste, but I would like to explain my rationale anyway:
The INSERT key is not very useful: when it is pressed, Emacs changes to a very annoying overwrite mode, a rarely needed functionality nowadays. On the other hand, Emacs opens the possibility of customization for this key (and for any key, for that matter).
I have made a quick&dirty search in the code, but I have not found how to customize this LEADER key. That being said,
Thanks in advance!
I really like having the option to have quick access to a "cheatsheet" that shows me what commands that are bound. Looking at how this is currently implemented in meow-cheatsheet.el there are some limitations in the approach you picked:
The bottom-line is that the above things combined very quickly become very hard or even impossible to manage if one for every variation would need to add a customized variant to meow-cheatsheet.el
.
To avoid this issue to an extend I think it would be worth basing the generation of cheatsheets on XKB key-codes (look mainly at this figure) instead. Using these keycodes in your templates instead of the letters/symbols
would avoid a lot of unnecessary duplication as these key-codes will be the same for iso, ansi, etc. Effectively you would just have one of these for each of the layouts you want to support from iso, ansi, etc. if you replace the characters with the corresponding level for the key-code on that key.
As this explanation is probably difficult to follow: my thinking is that you can use the same approach as done used by XKB and have arrays in the form (adapted for emacs lisp)
xkb_symbols "qwerty" {
...
key <AD01> { [ q, Q ] };
key <AD02> { [ w, W ] };
key <AD03> { [ e, E ] };
key <AD04> { [ r, R ] };
key <AD05> { [ t, T ] };
key <AD06> { [ y, Y ] };
....
}
The first would be the unshifted character, the second the shifted character.... basing things on these types of arrays would make it easier to support different layouts as this array tells you the physical position as well as the characters that are on the key. Moreover tackling this in this way has the added benefit that you could expose the above array (adapted to emacs) to the users in case they run a different keyboard layout. Just defining the array would allow that user to have their dedicated cheatsheet without having to add layouts to meow itself.
btw) if you think think this is worth implementing it is probably worth keeping in mind that XKB can have more than two levels that can be used. Essentially the symbols typed with AltGr are on level3.
meow-change-save
doesn't change when on a char but meow-change
does. It seems like you do an extra region-active-p
check on meon-change-save
.
and I have some questions,
meow-end-of-thing
.Thanks for meow!
This might just be one of the cases of needing to get used to the most efficient way to work with meow
, but I find it surprising that the commands relating to meow-find
and meow-till
do not respect meow-reverse
in the same way as happens for meow-block
and meow-line
. Effectively I'm missing what in vim are the f/F
and t/T
pairs of bindings.
I see that some of the backwards operations for meow-find
and meow-till
are in the code, but adding those would take additional bindings.
Would it be a good idea to have the meow-till
and meow-find
operations (and the expand variants) respect meow-reverse
binding so that one can also search for characters backward without needing to bind additional keys?
i probably know how to change the face in emacs, but how can i change the cursor type in insert mode??? i know i can add a hook to change the cursor type, but there's a face:
(describe-face meow-insert-cursor) ;; Change type like (setq-default cursor-type '(bar . 2))
(describe-face meow-motion-cursor) ;; Change color like (set-cursor-color "blue")
例如: M- C-M- 等按键。 在 M- 等待后续按键时,按 是光标移动,而不是触发命令。
@DogLooksGood Just wanted to experiment with this one as it seems like a better option than kakoune.el. Thanks for creating something.
Trying to install as described in the Readme using melpa in scimax, but the upstream reports the archive was not available:
Error (use-package): Failed to install meow: https://melpa.org/packages/meow-20200626.1804.tar: Not found
A nice usage guideline with the keybinding list would be a great addition, imho. Thanks.
Cheers, and stay safe,
/z
find 向前寻找时光标会在目标字符后,till则在目标字符上,但是按;后进行反向寻找时则反过来了,find会在目标字符上,till 则在目标字符后。这是有意设置的吗?
在我使用meow-end-of-thing
且选择l时,会选中下一行行首字符,这是为何呢?
例如,我在org-mode中,想用" o s" 来绑定一个org-mode的专有指令,
而当我在java-mode中,我依旧用" o s" 来绑定一个java-mode的指令。
我现在的解决方法在meow-leader-define-key中定义不冲突的全局快捷键。
所以造成的结果是,即使我在java-mode中,在用meow-leader时,依旧会出现org的引导
接触emacs主要用来记日程,所以很多细节不清楚,给您添麻烦了,希望可以指点一下。
看了下源码,很多地方看不懂,但是有一些简单的流程能明白,在meow-helpers中,发现
但是找不到相关的定义。
麻烦您了,谢谢谢谢~~~
Currently, the inputs in KEYPAD mode are handled by keypad-self-insert
which is a command. There are two disadvantages:
kmacro-end-macro
C-x ) by press SPC x ) in KEYPAD, because there will be two inputs: SPC x(map to keypad-start
) and )(map to keypad-self-insert
).We can implement KEYPAD state as an input method in Emacs. An input method won't produce any key events until you finish your input. This will improve the compatibility of KEYPAD mode, make it work better with other packages. It may have some limitations, need some time to figure it out.
TBD
@DogLooksGood I am encountering the following practical issues:
A. In n/vim/kakoune or evil-mode
there is a mode as follows in normal mode (SOLVED)
Go to top: gg
(UPDATE: <
in meow
)
Go to bottom G
(UPDATE: >
in meow
)
Go to the beginning of line: 0
(UPDATE: s
in meow
)
Go to the end of line: $
(UPDATE: t
in meow
)
B. Emacs configuration I use is scimax which has by default C-+
(though I prefer C-=
) to increase font size and C--
to decrease the font size, but it stops working once I activate meow-mode
. How can one increase and decrease font size in meow
?
C. In addition, there is a visual mode which allows you to select a block and make modifications with the following sequence:
C-v
for visual modeI
for block insert
modeEsc
to manifest in all lines selected in above 2.I could not figure out the above possibilities in meow-mode
. Did I miss something that can be done the other way round in this mode? I am on qwerty keyboard, fyi.
作者你好,我在emacs china上面看到你的这个插件,被里面kmacro的部分吸引了就想试一试,我照着你给出来的gif图试了一下,但是始终不能做出你的编辑效果。
我的场景和你的foo的多行编辑例子类似,有若干行文本,我需要在这几行文本前后各增加一些新的文本,比如从下面
foo
foo
foo
变成
checking foo, done
checking foo, done
checking foo, done
我操作的流程是先用行选选中了三行foo(这里用的是meow-line
),然后调用meow-kmacro-lines
,这个时候我的光标回到了第一行,并且我看到minibuffer提示正在定义kmacro,我在把第一行从foo
变成checking foo, done
之后,不管是用C-x )
结束kmacro定义还是调用meow-end-or-call-kmacro
,都不能让后面两行也变成checking foo, done
。我看了好几次meow
的readme,但是都没有找到具体的操作教程,所以想问一下我是不是对meow-kmacro-lines
的使用方式理解不对以及这个功能应该怎么用呢?
下图是我的keybinding。
另外如果这个问题不是特别蠢的话,我可能可以帮忙补充一下kmacro部分的readme?
我使用时感觉meow-line-expand和meow-line没什么区别。
对比meow-left-expand之类的,可以用光标的移动上下左右来扩大和减少选区,改变选区的方向。
看看能不能支持这种方式,降低心智负担编辑更加高效。
When SPC x
is pressed, which-key
does not show keybindings even though which-key
is enabled.
Do you have any plan to integrate with which-key
?
如题
Environment: emacs28.0, terminal, linuxmint
use -q to startup, setup code:
(add-to-list 'load-path "/home/somacs/packages/dash")
(add-to-list 'load-path "/home/somacs/packages/meow")
(require 'cl-lib)
(require 'meow)
(meow-global-mode 1)
(meow-layout 'dvorak)
eval-buffer will got a error:
Symbol’s function definition is void: meow-layout
Hi,
I have updated the meow config with:
(meow-leader-define-key
'("k" . kill-buffer)
'("l" . goto-line)
'("h" . other-window)
'("o" . delete-other-windows)
'("-" . split-window-below)
'("/" . swiper)
'("\\" . split-window-right)
'("m" . magit-status)
'("f" . find-file)
'("F" . find-file-literally))
(meow-leader-define-mode-key
'emacs-lisp-mode
'("RET" . eval-buffer)
'("SPC" . eval-defun))
but when in the emacs-tutorial, meow mode appears to be deactivated.
HOW TO REPRODUCE?
To reproduce, just C-h t
and check the mode, you would only find a squared box in the modeline (in scimax), in my case).
Looking for something else I spotted that since commit ecf5147 the meow--on-post-command-hook function is a noop.
As it doesn't seem to be used at all in the rest of the code it looks like the function should be deleted?
Meow has 84 variables and 153 functions now, but I don't want to look at the use of these variables one by one. So can write a detailed document for this package?
I'm just curious.
A querty-related readme would be appreciated.
Like in kakoune, how can one change the cursor look from pipe |
in insert mode to bar in command mode?
Cheers,
First, thanks for writing meow! I'm really enjoying how powerful and streamlined it is.
I've created a few top-level items using meow-leader-define-key
, some of which I've built with a letter prefix to group similar commands together, e.g.:
'("w w" . ace-window)
'("w u" . winner-undo)
'("w r" . winner-redo)
'("w h" . split-window-below)
'("w v" . split-window-right)
'("w c" . delete-window)
'("w o" . delete-other-windows)
This works well, enabling me to press SPC w u
for winner undo for example, but at the top level menu, the 'w' prefix is just labelled +prefix
.
Is there some way I am missing to provide a more descriptive label like "windows"? I know that you can do that with which-key, but I'm not sure how to do that when meow is providing the items.
Thanks for any help you can provide!
Emacs has built-in search-ring
, could be used for meow-search
, meow-pop-search
. We can get tighter integration with built-in incremental search.
Disabling meow-global-mode should also disable the setup-indicator.
Now it just remains visible, showing NORMAL in the mode line.
Can this package use with Lispy?
First, thank you guys for developing such a brilliant operation mode for editing. It boosts my daily editing!
I have some questions about using meow, and any suggestions is appreciated.
space x c
, and will press f
, here a popup menu appears at the bottom showing the available command. How to disable this popup menu?tn
quickly in INSERT mode, I will return to NORMAL mode.类是与下面这种两行字符宽度不一致时,不停的上下移动光标,会导致光标往前移动。
你好,世界
Hello world
evil 和 emacs 的 C-n / C-p 都没这个问题。
刚使用meow,对于KEYPAD的理解可能不全面,也还没有看代码,但使用中体会是采用了Fallback机制,当SPC+x 进入KEYPAD模式时后继按键如x 是先找Ctrl-x ,没有的话再Fallback到x。使用中觉得有点不太合理,提个建议供参考:
觉得KEYPAD模式的Fallbak 机制 当按 SPC-x 进入KP模式时,再按 x 时应当 首先匹配 C-x x,没有再匹配 C-x C-x,C-x M-x 。。。,如果要直接匹配C-x C-x 采取 SPC-x-SPC-x 进行操作。
考虑的理由是实际的键绑定 C-x x 类型比C-x C-x这种好像要多些,现有模式下要直接匹配 C-x x按键序列需要按 SPC-x SPC-x ,一是复杂,比直接按的键数要多,二是不便于记忆,有点反直觉,相对于明确SPC直接替代一个控制键要更清晰明了一点
SPC-x x 匹配 C-x x,没有的话再匹配C-x C-x, SPC-x SPC-x 直接匹配 C-x C-x
狗哥用了一段时间meow了。提些自己的想法和发现的问题。
(setq meow-selection-command-fallback
'((meow-save . meow-keypad-start)
(meow-change . meow-keypad-start)
(meow-keyboard-quit . meow-keypad-start)))
.
repeat 一些重复的连续重复操作的功能,就太好了。a-b-c
符号 search 偶尔出现搜索对象是a
的情况。原因和触发条件,我还不知道。暂时,只发现这么多,其他还有待发现。感谢狗哥的工作,我才可以有这么好的Emacs交互体验。
之前用 evil 过于沉重,卡顿,思维敏捷时,感觉手指按不过来了。用 xah-fly-keys 灵活性不够。用emacs默认按键,小拇指受罪。
Less is more
您好,我看了变量meow-normal-state-mode-list中已经添加了 text-mode,但是我使用的color-rg-mode属于text-mode 的衍生mode,尽管我添加了
(use-package color-rg
:hook (color-rg-mode-hook . meow-motion-mode))
但是进入color-rg-mode后,仍然处于meow-normal-mode,不知如何解决?
If in a selection, then cancel all selection, if not then switch to last buffer, Do you think it's better than before?
Instead of introducing an new idea, using the existing register functionality looks more elegant. May need more ideas for implementation details.
Hi - I just learned about this package, and so trying it out.
I use vertico, consult and embark for completion functionality, and have a variety of bound consult commands, including C-x b
for consult-buffer
, as you can see here:
But when I use keypad mode, and do SPC x
to get the pop-up, it shows the C-x b
binding as list-buffer
.
Is there something I'm missing?
hi I started to use your package today and I'm having a few issues
I use the qwerty layout and in normal mode the <{> seems to be acting like the <M-{> in vanilla emacs and for <[> / <}> they do nothing and the <? k }>, for example, is not descriptive enough for me to understand what it is supposed to do (it only talk about barfing witch I don't know what it means in the context of emacs because otherwise ew).
do you have any idea this is happening? what are those key bindings supposed to do?
otherwise great package!
I noticed that in commit dd39e17 meow-delete
is removed and aliased to meow-C-d
. However, I think they don't perform the same. I use meow-delete
pretty often and just found out I could no longer use it after I updated my meow
package. Just would like to know if this is intentional and do we have any alternative function to it.
key-chord 版本:20201222.2030 配置:
(use-package key-chord
:ensure t
:config
(key-chord-mode 1)
(key-chord-define-global ",." [escape])
meow 版本:20210601.156 配置为readme中的qwerty键盘的默认配置
在 insert 模式下按键 ,.
后,normal模式下的按键已经生效了,但是 modeline 上显示的模式还是 INSERT
期望结果:modeline 显示 NORMAL
Looking for some helper functions, I have found a typo:
I try to:
(global-set-key (kbd "c-c d") 'counsel-descbinds)
error: Key sequence c - c d starts with non-prefix key c.
Why this occurs?
How do i disable meow-mode when i'm in an ansi-term or eshell, since i cannot use space on those modes.
I'm really liking your package so far, I was wondering if it is posible to implement this behaviour (make meow-block work in curly braces) or maybe provide a way to configure the pairs to match with, it would be useful if people were working with tags or other kind of surrounding patterns, maybe the pairs could also be regexes to allow more powerful customizations, I don't know if it goes out of the scope of the project, but I was just wondering, thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.