Doom-emacs: How do I do company-complete?

Created on 21 Apr 2020  ·  5Comments  ·  Source: hlissner/doom-emacs

What are you trying to achieve?
When given a list of options from company mode, I want to select one. Tab does company-complete-common, taking you up to the point where they diverge, but further hitting of tab just cycles through the options.

Obviously, I can redefine the keymap myself (probably adding RET as 'company-complete, but I feel like I must be missing something since surely completing is the whole point of company mode. Seems a bit weird if the flow is to type something further then press complete again, ad nausea.

So I think I just haven't worked out what the workflow is, or what keybinding to press. Any pointers?

System information

emacs   version    26.3
        features   XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
        build      Apr 21, 2020
        buildopts  (--prefix=/nix/store/l0fqjrzdbhhdyh18jnqf34sr4zp6msqh-emacs-26.3 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200)
        windowsys  x
        daemonp    daemon
doom    version    2.0.9
        build      HEAD -> develop 3a5ef316f 2020-04-19 22:04:12 -0400
        dir        ~/.doom.d/
system  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /nix/store/v2d465r8lvdlzl5dnz81b7199lhqngcl-zsh-5.8/bin/zsh
        uname      Linux 5.6.2 #1-NixOS SMP Thu Apr 2 06:02:32 UTC 2020 x86_64
        path       (/usr/local/bin/ /sbin/ ~/bin/ ~/.npm-packages/bin/ ~/ben/bin/ /run/wrappers/bin/ ~/.nix-profile/bin/ /etc/profiles/per-user/ben/bin/ /nix/var/nix/profiles/default/bin/ /run/current-system/sw/bin/ ~/go/bin/ ~/.emacs.d.doom/bin/ /nix/store/l0fqjrzdbhhdyh18jnqf34sr4zp6msqh-emacs-26.3/libexec/emacs/26.3/x86_64-pc-linux-gnu/)
config  envfile    envvar-file
        elc-files  0
        modules    (:completion company (helm +fuzzy) :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash neotree ophints (popup +all +defaults) pretty-code unicode vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold multiple-cursors rotate-text snippets :emacs (dired +icons) electric vc :term eshell :tools debugger direnv eval :checkers syntax spell :tools gist (lookup +docsets) macos magit (pass +auth) rgb upload :lang clojure data emacs-lisp markdown nix (org +dragndrop +ipython +pandoc +present) python racket rest ruby scheme sh web :email (mu4e +gmail) :app calendar (rss +org) :config (default +bindings +smartparens))
        packages   ((org-super-agenda) (org-gcal) (emojify) (org-alert) (google-maps) (helm-spotify-plus) (git-link) (org-superstar))
        unpin      (n/a)
        elpa       (n/a)

:completion company :lang clojure question keybinds unknown

Most helpful comment

I had a similar issue and fixed it by applying https://github.com/hlissner/doom-emacs/issues/1335#issuecomment-605706363
I can know navigate across completion propositions with up/down or ctrl + j/k
Thanks @thiagokokada

All 5 comments

probably adding RET as 'company-complete

Are you implying that RET does not already do this? Because it should, and I can confirm this is the case in vanilla Doom and Emacs. Check your config, in case you've bound your own key to RET on company-active-map.

Huh. It definitely is bound in company-active-map (and I've not changed that). I had assumed it was overridden here due to a quick grep in the code base, but that's only related to company-tng which I'm not using.

On further testing it's only happening in Clojure buffers. RET works fine in emacs lisp buffers. I can't check right now, but I'll poke at it a bit further later.

I am having same issue in clojure buffers. Three days ago I doom up and that's when it all started. Before that, every thing worked as expected.

C-j inserts new line instead of moving.
Ctrl_J

C-n: seems to pick something common and complete it, another press does nothing
Ctrl_n

tab: when pressing multiple times only moves sometimes, and not in any specific way.
tab

I had a similar issue and fixed it by applying https://github.com/hlissner/doom-emacs/issues/1335#issuecomment-605706363
I can know navigate across completion propositions with up/down or ctrl + j/k
Thanks @thiagokokada

Thanks @bcachet and @thiagokokada . That helped.

I added a more inclusive workaround snippet for those interested https://github.com/hlissner/doom-emacs/issues/1335#issuecomment-619022468

Was this page helpful?
0 / 5 - 0 ratings

Related issues

governorgoat picture governorgoat  ·  3Comments

Ptival picture Ptival  ·  3Comments

waymondo picture waymondo  ·  3Comments

gueorgui picture gueorgui  ·  3Comments

rgrinberg picture rgrinberg  ·  3Comments