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

c-w should delete word backwards in insert mode even if autocomplete is open. #4243

Open
jordwalke opened this issue Dec 20, 2015 · 16 comments
Labels
Key Bindings stale marked as a stale issue/pr (usually by a bot)

Comments

@jordwalke
Copy link

When the autocomplete window is open, c-w no longer deletes backwards. This seems like a pretty big bug, though it's likely the result of some conflict of packages/layers (again, I'm new to Emacs).

This is my entire config:

  (load-theme 'spacemacs-light t)
  (set-face-attribute 'mode-line nil :box nil)
  (set-face-attribute 'mode-line-inactive nil :box nil)
  ;; Don't highlight line
  (global-hl-line-mode -1) ; Disable current line highlight
  (setq evil-want-fine-undo nil)
  (setq evil-move-cursor-back nil)
  (global-set-key (kbd "s-p") 'helm-M-x)
  ; (setq powerline-default-separator 'utf-8)
  (setq powerline-default-separator nil)
  (global-vi-tilde-fringe-mode -1)

These are my enabled layers:

     company
     ;; To toggle autocompletion on:
     ;; space t a 
     auto-completion
     ;; better-defaults
     emacs-lisp
     themes-megapack
     ;; Basic mac keybindings. (Cmd is super, alt is meta)
     osx

The version of spacemacs I'm using is master as of today.

@jordwalke
Copy link
Author

I noticed the same issue with Helm as well.

@nixmaniack
Copy link
Contributor

Yes, that's quite annoying! 😄 I have this in my config now.

(define-key company-active-map (kbd "C-w") 'evil-delete-backward-word)
(define-key helm-map (kbd "C-w") 'evil-delete-backward-word)

I'm not aware of any consequences of this.

@nixmaniack
Copy link
Contributor

Okay, the C-w binding in helm-map has some consequences which I remember now. By default, emacs copies the thing(symbol) at point in input area if you hit C-w so you're essentially overriding that behaviour.

@jordwalke
Copy link
Author

I wonder if it makes sense to at least have a spacemacs config option for this. Since you're already giving up that emacs style consistency in Vim insert mode, you would likely want the same in other input areas.

@jordwalke
Copy link
Author

BTW: When I try that mapping in my user config (for company-active-map) I get an error:

Error in dotspacemacs/user-config: Symbol's value as variable is void: company-active-map

Edit: On develop branch today.

@jordwalke
Copy link
Author

For the record, I had to put this in my user config:

  (with-eval-after-load 'company
    (define-key company-active-map (kbd "C-w") 'evil-delete-backward-word)
  )
  (with-eval-after-load 'helm
    (define-key helm-map (kbd "C-w") 'evil-delete-backward-word)
  )

@nixmaniack
Copy link
Contributor

@jordwalke 👍 That's correct way.

@jeaye
Copy link

jeaye commented May 14, 2016

I'm experiencing this issue now as well and @jordwalke's config did the trick. I agree that this should be provided as an option within spacemacs.

@Profpatsch
Copy link
Contributor

Same issue here, that is a pretty major dealbreaker especially in latex mode, where ispell tries to complete nearly every word.

@gdkrmr
Copy link
Contributor

gdkrmr commented Oct 10, 2017

FYI: C-w in the company-active-map is bound to company-show-location and in d helm-map it shows some weird strings of bytes.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
@Profpatsch
Copy link
Contributor

yeah

@nixmaniack
Copy link
Contributor

As gdkrmr mentioned above, if users use the C-w to temporarily show the code then it would break that workflow. We might need to find a different binding for company-show-location in that scenario before binding C-w to delete backward.

@duianto duianto removed the stale marked as a stale issue/pr (usually by a bot) label Mar 15, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Mar 15, 2021
@Profpatsch
Copy link
Contributor

I think this is still relevant

Copy link

github-actions bot commented May 1, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Key Bindings stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

9 participants