Exception or error: I find the documents frustrating. What are the basic lines I need to add to my config file to get it working? How to solve: Technically, nothing. If you’ve extracted Syntastic into your .vim directory, try using the :SyntasticEnable command within Vim to enable it for the filetype of the currently open …
Tag: vim
VIM for PHP: List if()'s and include()'s in Taglist-ThrowExceptions
Exception or error: I use Taglist in VIM, but one particular PHP application which I have inherited is coded with if()’s and elseif()’s and include()’s extensively. Not a single method or function in almost 5000 lines of code per file (and tens or hundreds of files). Is there any way to use Taglist or another …
php – How can I track a click event of an embedded video (youtube, vimeo, etc.)? (to track play count)-ThrowExceptions
Exception or error: Is there a way to track play counts for embedded videos? Ideally without resorting to a thumbnail linked to launch the embed / iframe code. Example (try it yourself on jsFiddle): <!doctype html> <html lang=”en”> <head> <meta charset=”utf-8″> <title>Example</title> <script src=”//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js” type=”text/javascript”></script> </head> <body> <div id=”log”></div> <ul> <li class=”video” id=”video1″><iframe width=”480″ height=”390″ …
Real SQL syntax highlighting in PHP scripts with Vim-ThrowExceptions
Exception or error: I know it’s possible to enable SQL syntax highlighting in PHP scripts using the option let php_sql_query=1 But this just enables highlighting of all SQL keywords in every string. Even in a normal sentence like this one. Is there a way to only enable this for strings starting with “Select”, “update” or …
php – Auto insert text into vim-ThrowExceptions
Exception or error: When debugging some php scripts it would be very handy if I had a shortcut that would insert a piece of text like an echo with the current linenumber and filename. echo “Hello at filename.php at linenumber”; Even auto inserting some text like a comment with a static echo would be sweet. …
php – Any preg_match to check if a url is a youtube/vimeo/dailymotion video link?-ThrowExceptions
Exception or error: What’s the best preg_match syntax to check if a url is a video link of youtube/vimeo/ or dailymotion? maybe if it’s hard, then just to check the domain name. Thanks How to solve: I wouldn’t use preg_match() for this. I think parse_url() is probably a better choice. You can pass a URL …
php – How do I get the Video Id from the URL? (Vimeo)-ThrowExceptions
Exception or error: PHP <?php $url = ‘http://vimeo.com/25451551’; /* http://www.vimeo.com/25451551 … www.vimeo.com/25451551 */ $url = preg_match(‘???’, $url); echo $url; ?> Output 25451551 Any help with this would be appreciated. Thanks. How to solve: If video IDs are allowed to start with a 0, you may need to tune the following code a bit: $url = …
php – Vim inoremap for specific filetypes-ThrowExceptions
Exception or error: I’ve added some simple inoremap commands to my .vimrc to help with parens and brackets completion, but I only want them to apply to php files. inoremap ( ()<Esc>i inoremap { {<CR>}<Esc>ko inoremap <? <?php ?><Esc><Left>i How to I set these commands to be active only when I’m editing a .php file? …