Skip to content

Commit

Permalink
Remove '/' from iskeyword so that 'w' doesn't skip over entire paths.
Browse files Browse the repository at this point in the history
I didn't remove the iskeyword definition entirely because I believe including
'_' and '.' is still useful.

Also, fix syntax definitions to include '/' as well wherever they use '\k' so
that / is still highlighted.

cc: dag#44
  • Loading branch information
blank_name committed Mar 22, 2020
1 parent fc758c6 commit 1af585c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ftplugin/fish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ setlocal foldexpr=fish#Fold()
setlocal formatoptions+=ron1
setlocal formatoptions-=t
setlocal include=\\v^\\s*\\.>
setlocal iskeyword=@,48-57,-,_,.,/
setlocal iskeyword=@,48-57,-,_,.
setlocal suffixesadd^=.fish

" Use the 'j' format option when available.
Expand Down
6 changes: 3 additions & 3 deletions syntax/fish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ syntax match fishIdentifier /\$[[:alnum:]_]\+/
syntax region fishString start=/'/ skip=/\v(\\{2})|(\\)'/ end=/'/
syntax region fishString start=/"/ skip=/\v(\\{2})|(\\)"/ end=/"/ contains=fishIdentifier
syntax match fishCharacter /\v\\[abefnrtv *?~%#(){}\[\]<>&;"']|\\[xX][0-9a-f]{1,2}|\\o[0-7]{1,2}|\\u[0-9a-f]{1,4}|\\U[0-9a-f]{1,8}|\\c[a-z]/
syntax match fishStatement /\v;\s*\zs\k+>/
syntax match fishCommandSub /\v\(\s*\zs\k+>/
syntax match fishStatement /\v;\s*\zs(\k|[/])+>/
syntax match fishCommandSub /\v\(\s*\zs(\k|[/])+>/

syntax region fishLineContinuation matchgroup=fishStatement
\ start='\v^\s*\zs\k+>' skip='\\$' end='$'
\ start='\v^\s*\zs(\k|[/])+>' skip='\\$' end='$'
\ contains=fishSpecial,fishIdentifier,fishString,fishCharacter,fishStatement,fishCommandSub,fishComment

highlight default link fishKeyword Keyword
Expand Down

0 comments on commit 1af585c

Please sign in to comment.