Skip to content

Instantly share code, notes, and snippets.

@djosix
Last active November 8, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djosix/8e30d6755352da782476d66d73cb3006 to your computer and use it in GitHub Desktop.
Save djosix/8e30d6755352da782476d66d73cb3006 to your computer and use it in GitHub Desktop.
  1. vim ~/.zshrc, add history-substring-search to the plugin array.

     66 # Which plugins would you like to load?
     67 # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
     68 # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
     69 # Example format: plugins=(rails git textmate ruby lighthouse)
     70 # Add wisely, as too many plugins slow down shell startup.
     71 plugins=(zsh-autosuggestions zsh-completions history-substring-search)
    
  2. Find the source code

    $ cd /path/to/oh-my-zsh
    $ grep -rn 'moving the cursor to the end of the result buffer' .
    ./plugins/history-substring-search/history-substring-search.zsh:248:  # existing highlights and moving the cursor to the end of the result buffer
    $ vim -c 'edit +248 ./plugins/history-substring-search/history-substring-search.zsh'

    edit

    247   # the search was successful so display the result properly by clearing away
    248   # existing highlights and moving the cursor to the end of the result buffer
    249   if [[ $_history_substring_search_refresh_display -eq 1 ]]; then
    250     region_highlight=()
    251     # CURSOR=${#BUFFER} # comment out this line!!!
    252   fi
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment