Vi

Vim gf-command improved

Hacker News

Vim gf-command improved

Since a week ago I remembered myself of the awesome gf-command in Vim, which allows you to open the current filepath under the cursor in a new buffer. I thought to myself: Why am I never using this? Oh yeah, because this only works for filepaths relative to the buffer . As a javascript developer most of my time, that won’t help since I have webpack-configured projects which allows me to do some super cool absolute imports, but throws away the complete usage of the awesome gf-command. So I started a Vim plugin called gfi (goto file improved). The goal for me was to create a plugin that is plug ’n play, zero-configuration required for you to enjoy this simple but efficient plugin. So how does it work? When using this plugin your regular gf will be remapped and when pressing gf it always tries to resolve the file under the cursor using atleast the following logic: - relative to the current buffer - relative to Vim's current working directory - based on the git directory it is located in Implementing these 3 checks for every filetype made sense to me. Just having these 3 checks already makes gf already much more efficient want useful. If these 3 fail to retrieve a path then some filetypes may have additional checks. Javascript-like projects can be webpack-configured and thus may use absolute imports. These are done by checking the package.json in the root of the project. Golang path resolving for the import-statement is also taken into account. Since these imports are directories, the directory will be opened rather than a file, but it’s still more efficient, since gf does not open directories by default. A goal I have is hoping for contributions for as many languages as possible so that the gf command will be more useful for many more developers. If you have feedback or like to contribute, send me a mail or do your contribution via https://github.com/kkoomen/gfi.vim

Share card

Actual performance

4points
4comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: cursor, new, using · Missing: mac, agents, macos
74%74% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: started · Missing: supports, reddit linkedin, podcasting
67%67% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: io · Missing: https docs, excited, just released
40%40% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
37%37% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: efficient · Missing: plus, platform, intuitive
30%30% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
13%13% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Find By
Find By

Craigslist improved with geolocation

BetaList
Im
Improved rails strong_parameter implementation41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Improved rails strong_parameter implementation

Hacker News2
Mi
Mithril Improved with AI32%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mithril Improved with AI

Hacker News1
Co
Command at Sea48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Command at Sea

Hacker News1
Co
Cowsay Command for 202149%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cowsay Command for 2021

Hacker News12
gr
grpcmd – The "grpc" command54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

grpcmd – The "grpc" command

Hacker News1
Re
Retry a command with exponential backoff and jitter (+ Starlark exprs)48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Retry a command with exponential backoff and jitter (+ Starlark exprs)

Hacker News83
En
Envoy – Command Logger41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Envoy – Command Logger

Hacker News11
Ch
Chatroom with curl command (requires IPv6)49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Chatroom with curl command (requires IPv6)

Hacker News2
pr
provision redis with one command54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

provision redis with one command

Hacker News3