Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt + . in insert mode doesn't substitute to last argument! #287

Open
d9k opened this issue Jul 16, 2024 · 5 comments
Open

alt + . in insert mode doesn't substitute to last argument! #287

d9k opened this issue Jul 16, 2024 · 5 comments
Assignees

Comments

@d9k
Copy link

d9k commented Jul 16, 2024

General information

> zvm_system_report
- Terminal program: tmux 3.2a (screen-256color)
- Operating system: Linux (5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 GNU/Linux)
- ZSH framework: none
- ZSH version: zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
- ZVM version: zsh-vi-mode 0.11.0 (c69df2c, 2023-03-07 16:52:25 -0500)

Problem description

alt + . in insert mode doesn't substitute to last argument! Very inconvenient.

> ls Backup
> ls
# I press <Alt+.>
> lsls  Bac//sls`
@jeffreytse jeffreytse self-assigned this Jul 18, 2024
@jeffreytse
Copy link
Owner

Hi @d9k

Thanks for your information. May I know if the feature alt + . is from aother third-party plugin?

Thanks & Regards

@d9k
Copy link
Author

d9k commented Jul 20, 2024

No, I think it's built-in zsh / bash feature

@qadzek
Copy link

qadzek commented Aug 25, 2024

Try adding this to your zshrc:

# Normal mode
function append-last-word { ((++CURSOR)); zle insert-last-word; }
zle -N append-last-word
bindkey -M vicmd '\e.' append-last-word

# Insert mode
bindkey -M viins '\e.' insert-last-word

See also https://unix.stackexchange.com/questions/685008/how-to-use-alt-in-zsh-with-vim-bindings

@joeynguyen
Copy link

Try adding this to your zshrc:

# Normal mode
function append-last-word { ((++CURSOR)); zle insert-last-word; }
zle -N append-last-word
bindkey -M vicmd '\e.' append-last-word

# Insert mode
bindkey -M viins '\e.' insert-last-word

See also https://unix.stackexchange.com/questions/685008/how-to-use-alt-in-zsh-with-vim-bindings

I was having this problem as well and this worked for me. Thanks!

@d9k
Copy link
Author

d9k commented Nov 18, 2024

# Normal mode
function append-last-word { ((++CURSOR)); zle insert-last-word; }
zle -N append-last-word
bindkey -M vicmd '\e.' append-last-word

# Insert mode
bindkey -M viins '\e.' insert-last-word

@jeffreytse, I think this should be added to README and then issue can be closed 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants