Comments (4)
^[[3~
is the escape code for the delete key. In zsh, this key doesn't delete-forward as I would expect. Instead, it acts as if I've pressed ~e
in command mode (or g~e
in vim), which flips the case of the word after the cursor.
Not sure if that's a quirk of zsh's vi mode, but I manually bound delete to delete-char
to fix it.
^[3;5~
is actually a typo. It's supposed to be ^[[3;5~
, which is the escape code for ctrl + delete. There's also ^[[3;2~
for shift-delete. I don't think either is necessary though. I'll likely remove that.
If you're wondering how I got those codes, I ran cat
, then pressed the key I wanted, and it prints out the escape code, e.g.
$ cat
^[[3~
Hope that helps!
from dotfiles.
So much thanks! You and man {terminfo,infocmp,zshzle}
(those were not just for this topic) helped me a lot. Here is what I learned. As I understand, there is no quirk here. ZLE applies everything it receives. In this case it's ^[[3~
:
^[
It's escape character, so switches to normal mode.[
Since it'sundefined-key
, so ZLE doesn't know what to do with.3~
Flips the next 3 letters.
I tested it with other undefined-key
s like FN + RightArrow. cat
outputs ^[[4~
for that key sequences. It exactly flips the next 4 letters like I said above.
I ran cat, then pressed the key I wanted, and it prints out the escape code, e.g.
cat
trick is nice but I assume we can achieve the same result with pressing C-v
and hitting a key, or sed -n l
.
Thanks again. <3
from dotfiles.
That makes perfect sense! It hadn't occurred to me that the escape code was being evaluated literally. The sed
trick was new to me too.
In any case, thank you for sharing and I'm happy it helped!
from dotfiles.
Yeah, Tha's why iTerm2 map key cmd+←
to hex code: 0x1B 0x08
or 0x17
$ echo -n '^[^H' | xxd
00000000: 1b08 ..
$ echo -n '^W' | xxd
00000000: 17 ..
from dotfiles.
Related Issues (20)
- Help needed...installation instructions possibly outdated HOT 4
- How to user personal package in the config? HOT 2
- nix-darwin
- Suggestion: kvantum theme HOT 3
- multi arch management (RPI ? ) HOT 1
- fup? fup!
- unnecessary type definition either str path HOT 1
- How are you managing doom-emacs? HOT 5
- Make bin/hey a separate flake HOT 1
- Dwm on nix HOT 2
- Suggestion: Update quickstart section in README HOT 3
- Shiro external monitor HOT 1
- mkEnableOption expects string instead of bool HOT 1
- HEYYEYAAEYAAAEYAEYAA links do not match HOT 1
- `countAttrs` doesn't work as expected HOT 1
- error: ipython-8.4.0 not supported for interpreter python3.7 HOT 1
- Request Starter Config Template
- Absolute paths in `xdg.configFile` HOT 2
- After upgrade home-manager to 23.11 doesn't build HOT 1
- NixOS Wiki move HOT 1
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 dotfiles.