You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-15Lines changed: 23 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Installation
10
10
11
11
If you don't have a preferred installation method, [vim-plug] is quick and simple. With [vim-plug installed], add the following to your `vimrc` (if you are a NeoVim user, see the [FAQ page][neovim-faq] for help):
12
12
13
-
```vimscript
13
+
```vim
14
14
Plug 'StanAngeloff/php.vim'
15
15
```
16
16
@@ -59,16 +59,16 @@ Configuration
59
59
60
60
### Overriding highlighting
61
61
62
-
Syntax highlighting can be controlled at a fine-grained level allowing you to distinguish groups by overriding defaults. For example, all code in PHP comments is highlighted as `phpComment` by default, however there are groups you can tweak, e.g., how PHPDoc `@tags` appear. There are [several groups you can choose from](syntax-groups).
62
+
Syntax highlighting can be controlled at a fine-grained level. For example, all text in PHP comments is highlighted as `phpComment` by default, however there are smaller syntax groups you can tweak, e.g., how PHPDoc `@tags` appear. There are [several syntax groups you can choose from](syntax-groups).
63
63
64
64
Example: Overriding PHP `@tags` and `$parameters` in comments to appear as a different highlighting group, giving them distinct colouring:
65
65
66
-
```vimscript
67
-
" Put this snippet at the very end of your vimrc file.
66
+
```vim
67
+
" Put this function at the very end of your vimrc file.
68
68
69
69
function! PhpSyntaxOverride()
70
-
" Put overrides in this function.
71
-
hi! link phpDocTags phpDefine
70
+
" Put snippet overrides in this function.
71
+
hi! link phpDocTags phpDefine
72
72
hi! link phpDocParam phpType
73
73
endfunction
74
74
@@ -78,18 +78,26 @@ augroup phpSyntaxOverride
78
78
augroup END
79
79
```
80
80
81
-
You may optionally assign specific colouring to groups in the `PhpSyntaxOverride` function:
81
+
#### Snippets
82
82
83
-
```vimscript
84
-
" […]
83
+
You may add the code snippets below to your `PhpSyntaxOverride` function (see above for instructions on how to create this function).
85
84
86
-
function! PhpSyntaxOverride()
87
-
" Highlight the backslash in use, extends and implements in grey.
88
-
hi phpUseNamespaceSeparator guifg=#808080 guibg=NONE gui=NONE
89
-
hi phpClassNamespaceSeparator guifg=#808080 guibg=NONE gui=NONE
90
-
endfunction
85
+
##### Colourising namespace separator in `use`, `extends` and `implements`
86
+
87
+
If you wish to highlight the namespace separator `\` differently ([original request](https://github.com/StanAngeloff/php.vim/issues/63)):
88
+
89
+
```vim
90
+
hi phpUseNamespaceSeparator guifg=#808080 guibg=NONE gui=NONE
91
+
hi phpClassNamespaceSeparator guifg=#808080 guibg=NONE gui=NONE
92
+
```
93
+
94
+
##### Colourising parentheses
95
+
96
+
If you wish to highlight `(` and `)` differently ([original request](https://github.com/StanAngeloff/php.vim/issues/31#issuecomment-52879108)):
91
97
92
-
" […]
98
+
```vim
99
+
syn match phpParentOnly "[()]" contained containedin=phpParent
100
+
hi phpParentOnly guifg=#f08080 guibg=NONE gui=NONE
0 commit comments