Skip to content

Instantly share code, notes, and snippets.

@saevarb
Created June 27, 2015 14:56
Show Gist options
  • Save saevarb/dcc3a740ca9e70892e30 to your computer and use it in GitHub Desktop.
Save saevarb/dcc3a740ca9e70892e30 to your computer and use it in GitHub Desktop.
(defun get-comint-candidates ()
(let ((start (car comint-input-ring))
(end (car (cdr comint-input-ring)))
(completed (append (nthcdr 2 comint-input-ring) nil))
))
(butlast (nthcdr start baz) (- (length baz) end))
)
(defun comint-completion-source ()
(interactive)
(helm :sources '((name . "helm comint-mode")
(candidates . get-comint-candidates)
(action . (lambda (cand) (insert cand)))
)
:input (thing-at-point 'word)
)
)
(add-hook 'comint-mode-hook (lambda () (setq completion-at-point-functions 'comint-completion-source)))
(setq tab-always-indent 'complete)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment