Skip to content

Conversation

Copy link

Copilot AI commented Nov 11, 2025

The F script was hardcoded to open files in vim. Now respects the $EDITOR environment variable to support neovim, nano, pico, emacs, and VS Code.

Changes:

  • Modified create_shortcut_cmd() to detect editor from $EDITOR with vim as fallback
  • Added case statement handling editor-specific syntax:
    • vim/vi/nvim/neovim/nano/pico/emacs: +line filename
    • code: --goto filename:line
  • Updated README to reflect multi-editor support

Example:

# Uses neovim
export EDITOR=nvim
./srg "search term"
F 1  # Opens match in neovim at correct line

# Uses VS Code
export EDITOR=code
./srg "search term"
F 1  # Opens match in VS Code with --goto syntax
Original prompt

Generalize the F script to work with more command line editors:

  • neovim
  • nano
  • pico
  • emacs
  • code (Visual Studio Code)

Have the F script choose the editor based on the EDITOR environment variable.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ericsuh <382805+ericsuh@users.noreply.github.com>
Copilot AI changed the title [WIP] Generalize F script to support multiple command line editors Support EDITOR environment variable for multiple editors in F script Nov 11, 2025
Copilot AI requested a review from ericsuh November 11, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants