Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Similar to 'gf' there's 'gx' that opens a URL in your browser. I use this every day.

https://github.com/tyru/open-browser.vim

Here's my config from the vimrc:

" Disable netrw's gx mapping

let g:netrw_nogx = 1

" If the current word is a URL, open it in the browser. Else, pass it to a search engine

nmap gx <Plug>(openbrowser-smart-search)

vmap gx <Plug>(openbrowser-smart-search)

let g:openbrowser_default_search="duckduckgo"




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: