Skip to content

Commit

Permalink
Change gx regex to omit ending periods and similar characters
Browse files Browse the repository at this point in the history
  • Loading branch information
cespare committed Apr 15, 2021
1 parent 5014edb commit a7cd5b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vimrc
Expand Up @@ -243,7 +243,7 @@ function! OpenURLUnderCursor()
" TODO: We want the url under the cursor, but that's not easy to do.
" For now, just find the first URL on the line. Few lines have multiple URLs.
" TODO: Improve regex.
let url = matchstr(getline("."), 'https\?:\/\/[^ >,;)]*')
let url = matchstr(getline("."), 'https\?:\/\/[^ <>"\\^`{|}]*[^ <>"\\^`{|}.):;]\+')
call OpenURL(url)
endfunction
nnoremap gx :call OpenURLUnderCursor()<CR>
Expand Down

0 comments on commit a7cd5b2

Please sign in to comment.