in reply to Re^3: Professional Toolkits <=> vim + shell
in thread Professional Toolkits <=> vim + shell

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Autocomplete ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defadvice cperl-indent-command (around cperl-indent-or-complete) "Changes \\[cperl-indent-command] so it autocompletes when at the en +d of a word." (if (looking-at "\\>") (dabbrev-expand nil) ad-do-it)) (defun cperl-dabbrev-installer () (set (make-local-variable 'dabbrev-case-fold-search) nil) (set (make-local-variable 'dabbrev-case-replace) nil)) (eval-after-load "cperl-mode" '(progn (require 'dabbrev) (ad-activate 'cperl-indent-command) (add-hook 'cperl-mode-hook #'cperl-dabbrev-installer)))

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^5: Professional Toolkits <=> vim + shell
by educated_foo (Vicar) on Apr 13, 2006 at 19:54 UTC
    Okay. The Eclipse fanboys will say that doesn't complete methods and such since it's just textual, but dabbrev works well in practice, and is a wonderful thing for all kinds of documents. btw, one nice trick I use for indent-or-complete commands is to complete on the second "TAB" when the line hasn't moved, rather than when at end-of-word, like so (pseudocode):
    (defun my-indent-or-complete () (interactive) (let ((pos (point))) (indent-command) (when (and (= pos (point)) (eq last-command 'my-indent-or-complete)) (complete-command))))
        Well, I'd have to drop $30 to read it, but I think I understand what it's doing. I actually use my Sepia for perl-with-completion, so I'll look at putting something similar in that. I've remved the dependency on EPL in my local copy, and just need to gather the tuits to make a release...