Skip to content

Proposal: Symbol at point as default search pattern for counsel-*g and counsel-git-grep and all other search tools #1867

@Alexander-Shukaev

Description

@Alexander-Shukaev

Would it be possible to input symbol-at-point by default whenever a counsel-based search tool is invoked? That is try the stock grep-recursive. I think it's very cleverly implemented in that it displays symbol-at-point in parentheses as a default pattern, so if you hit RET without typing anything, this will become your pattern. Similar feature could be implemented for counsel-based search tools. That is by default the input field remains empty as it is now but there would be symbol-at-point in parentheses displayed in a similar manner to grep-recursive and the invoked search tool would immediately search for that default pattern already. In other words, you could immediately trigger ivy-occur without even typing anything because there are (probably) matches already for that default pattern. However, if you start typing anything, then your pattern of course overtakes, while as soon as you delete your input completely, again the default pattern should kick in. To be reasonable, a defcustom to enable this behavior should be introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions