Giter Club home page Giter Club logo

Comments (4)

alphapapa avatar alphapapa commented on July 28, 2024 2

Hi,

The default keymap for helm-org-rifle is a copy of helm-map, so you can press C-w to use helm-yank-text-at-point to yank the word after point into the minibuffer.

I think that's probably better than having it automatically use the word at point, because if that's not what the user wants, it would cause a delay while searching for that word, and then the user would have to clear the word before typing.

However, if you would prefer to do it automatically, you can add :input (thing-at-point 'word) to the call to helm in the helm-org-rifle-define-command macro, then re-eval the buffer, and all of the commands will do so automatically.

(cl-defmacro helm-org-rifle-define-command (name args docstring &key sources (let nil) (transformer nil))
  "Define interactive helm-org-rifle command, which will run the appropriate hooks.
Helm will be called with vars in LET bound."
  `(cl-defun ,(intern (concat "helm-org-rifle" (when (s-present? name) (concat "-" name)))) ,args
     ,docstring
     (interactive)
     (unwind-protect
         (progn
           (run-hooks 'helm-org-rifle-before-command-hook)
           (let* ((helm-candidate-separator " ")
                  ,(if transformer
                       ;; I wish there were a cleaner way to do this,
                       ;; because if this `if' evaluates to nil, `let' will
                       ;; try to set `nil', which causes an error.  The
                       ;; choices seem to be to a) evaluate to a list and
                       ;; unsplice it (since unsplicing `nil' evaluates to
                       ;; nothing), or b) return an ignored symbol when not
                       ;; true.  Option B is less ugly.
                       `(helm-org-rifle-transformer ,transformer)
                     'ignore)
                  ,@let)
             (helm :sources ,sources
                   :input (thing-at-point 'word))))  ; <--
       (run-hooks 'helm-org-rifle-after-command-hook))))

from org-rifle.

alphapapa avatar alphapapa commented on July 28, 2024

Closing now, but feel free to continue discussion. Thanks.

from org-rifle.

georgewsinger avatar georgewsinger commented on July 28, 2024

Similar to above, is there a way to make a command to just jump to the first match that helm-org-rifle finds for the word at point?

from org-rifle.

alphapapa avatar alphapapa commented on July 28, 2024

You could make such a command, but the matches are not sorted by relevance, so it might not be very useful.

from org-rifle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.