Questions tagged [filetype-php]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
56 views

Missing doc comment errors

Just started to look into VIM for my coding. I managed to set up some functionality with pathogen and want to make a slow start to learn VIM. the problem is that when I open a PHP document, I get ...
0
votes
1answer
19 views

How to have the cursor at the right indentation when editing PHP/HTML

When I'm working with HTML in a PHP file and I press enter while in INSERT mode, my cursor goes to the start of the next line instead of going at the right positive therefore I have to press tab to ...
1
vote
1answer
43 views

How can I format a function declaration to force curly brace at the end of the line?

I have big portions of code where functions are formatted with the opening curly brace on the next line, like this : function foo() { } I'm trying to figure out how to search / replace in order to ...
0
votes
1answer
38 views

How do I stop vim from higlighting uncessary words in PHP

I have this issue with my vim setup, where some words get highlighted unnecessarily. The image below shows an example. The words not and to where highlighted but there's no reason for them to be. How ...
0
votes
1answer
230 views

cannot generate ctags for php traits [closed]

I'm using vim, and I have used ctags and placed this in the ctags config file as per this post: --regex-php=/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i the problem is that I still can't find the ...
0
votes
1answer
30 views

Why is my XML filetype configuration overridding my PHP filetype configuration?

I'm using Vundle and have othree/xml.vim installed, as well as my own bundle for working with PHP. My PHP bundle has the following code: if exists('b:did_ftplugin') && 1 == b:did_ftplugin ...
0
votes
0answers
594 views

vim doesn't auto indent php files with html in it

In relation to this question: Auto indent turns off itself automatically on php files Vim has a php auto indent script; it behaves in following way: When autoindent is ON - if you open a php script, ...
2
votes
2answers
473 views

Auto indent turns off itself automatically on php files

I don't get it, my vimrc has set ai, but when editing project files (php), :set ai? always returns noautoindent inside .vimrc :set ai? returns true. my rc: " vim-plug (https://github.com/junegunn/...
0
votes
1answer
155 views

Copy current php file classname with namespace?

Currently I have this binding to copy current file name, path, or dir. " Copy current buffer path relative to root of VIM session to system clipboard nnoremap <Leader>yp :let @*=expand("%")<...
6
votes
0answers
610 views

Mixed PHP and HTML indenting

Is there a way to have mixed indenting more like Sublime Text (left) than Vim does it? I would like the nested UL to follow the (line 10) to follow along the (main indentation).
19
votes
1answer
463 views

How do I enable language-specific syntax inside a heredoc?

When I edit a PHP file and I define a string in a heredoc, syntax highlighting will be enabled inside the heredoc if it is JavaScript syntax or HTML syntax or SQL syntax. However it will not work for ...
3
votes
1answer
539 views

How do I run Cakephp's tests (PHPUnit) and output it to QuickRun or other window?

Is there a way to run tests of the current opened file and get output in other window like vim-QuickRun does? Right now I'm running tests by the command in command line: /vagrant/my_project/app/...
6
votes
0answers
223 views

.php file makes html text same color as html attributes - how to fix?

The text inside of <p> tags is the same color as the html attributes, so it's hard to distinguish between them. The html inside this .php file is colored (line one of this image) almost ...
6
votes
1answer
1k views

Why doesn't Vim recognize HTML inside PHP?

The HTML that's being returned by this PHP function doesn't have any syntax highlighting. If I delete the ' on line 13 the HTML highlighting works (but the PHP function breaks), with it the HTML ...
4
votes
1answer
259 views

How can I navigate to a class interface?

I've been using PHP Storm IDE for some time and I want to try out Vim. PHP Storm automatically allowed me to jump to classess/interfaces defined somewhere in my code (by use and implements statements, ...
2
votes
1answer
112 views

Configuring include-search for PHP

I just learned of the existence of include-search, but even after reading :help include-searchand :help includeexpr I'm not sure what I need to do to have [I find included and required files. How do ...
9
votes
2answers
3k views

Folding fails: vim can't find any fold

I'm trying to fold some PHP code, and I have included a cut-down version of some of the code I'm trying to fold at the end of the post. I've tried the following vim commands, but only the ex commands ...