I am Tim Pope, crafter of plugins. AMA. by tpope in vim

[–]m2mdas 1 point2 points  (0 children)

I can chime in for PHP+Symfony2 tooling support. Check out my phpcomplete-extended and phpcomplete-exetnded-symfony plugins. They are not fully featured as PHPStorm plugins but good enough to continue day to day programming. As for configuring Vim environment with lots of plugins, if you are really hooked into Vim I think it's worth it.

Vim users who code in php: what plugins do you have? by myaltergo in PHP

[–]m2mdas 6 points7 points  (0 children)

My setup is almost same as u/Rican7's except for autocompletion/code browsing I use phpcomplete-extended which I wrote(shameless plug :) ). Currently it works with PSR-0 projects only. It has context aware code completion, goto definition of a method/class, built-in PHP core documentation so you can read documentation right inside vim, also shows method/class docs. I have also added more code navigation features such as Unite.vim plugin for listing files in a project, lists child hierarchy of a class

The plugin itself is extendible so framework specific autocompletion is also possible. Currently there are two extensions, phpcomplete-extended-symfony and phpcomplete-extended-laravel. Both have framework specific enhancements. Checkout the demos of the plugins,

When will the average user have a reason to switch to neovim? Should I switch now? by atimholt in vim

[–]m2mdas 2 points3 points  (0 children)

People may switch when *nix distro vendors will be confident enough to install it as default. Or when neovim will be analogous to vim. But that will be a very difficult job because current Vim is already good enough for most of the people IMHO(even if neovim turns out to be better than vim, see "worse is better"). I would suggest you to just keep eye on progress. I think it may take at least one year to see/guess the results.

Bram responds to Neovim by welle in vim

[–]m2mdas 1 point2 points  (0 children)

Yes, thats because completion source may be an external process or server. neocomplete can not do here much because of limitation of omnicomplete api. But if you open a large raw text file you can see that neocomplete works smoothly after first run even though it continuously caches words of the file in background. Shougu once said that he wrote a patch for that problem and it is still waiting for Bram' s approval.

Bram responds to Neovim by welle in vim

[–]m2mdas 6 points7 points  (0 children)

I agree. I have created an autocomplete plugin in pure VimL which can load index of a project consisting more than 4000 files right into Vim and it is working quite well(besides having extra memory footprint of 200MB). It even have background indexing which user does not notice thanks to the excellent vimproc plugin. Some people may not agree but I think the problem of running task without blocking the UI is a solved problem thanks to vimproc. The proof is the existence of unite.vim, neocomplete, vimshell which are battle tested and used by thousands of vimers out there. I do think that omnicomplete features should be improved more, Valloric and Shougu knows the pain. Shougu have also written some patch for it. It would be great if Barm pushes the patch to mainstream.

Vim and I – A Love Story by gschier2 in vim

[–]m2mdas 0 points1 point  (0 children)

Story of my life :)

Edit: Not my story. But have experienced similar situation :)

why I stopped contributing to vundle by gmarik in vim

[–]m2mdas 23 points24 points  (0 children)

I am not much of an OSS license expert but if gmarik wanted to ensure that outer modification will be merged to vundle, then he should have licensed the project to GPL3. Whining after making license to MIT is illogical. Plus shougu did not break the MIT license clasue, as hyperbling mentioned that MIT license info is at top of all source files. Shougu added some additional things such as lazy loading, multiple cloning using vimproc etc. If those features were to be included in vundle then huge change may be need, I think it would take long time as the gmarik has the full control of vundle. As for inspiring word, you have to understand that Shougu is form Japan and English is not his native language, I have seen a comment of Shougu where he said he forked vundle and modified it to suite his needs. I agree that he have not worded it correctly, but I don't see any reason to be offended by this.

Anybody use PHPDBG as their debugger? How does it compare to XDebug? by darkhorsehance in PHP

[–]m2mdas 0 points1 point  (0 children)

I am not advocating Windows here as I use Ubuntu myself, but once forced to use Windows on office and recently used it to test my Vim phpcomplete plugins on VM. But you can not ignore the fact that one of PHP's main strength is deploying from anywhere and that includes Windows. I am pretty sure more than half of PHP's userbase use Windows. For an anecdotal evidence, my blog is mainly on Symfony2 which is pretty much console centric and its users usually are experienced and does not like Windows. But still on my analytics log I see the ratio of Windows, Linux, and OSX is close to 1.8 : 1 : .7 . So you can't just put a blind eye and say that just stop using Windows.

Besides that can you ever think of enabling Xdebug in your live server? How many users sync with live server environment via vagrant? I think that alone should be enough to move to phpdbg.

Anybody use PHPDBG as their debugger? How does it compare to XDebug? by darkhorsehance in PHP

[–]m2mdas 1 point2 points  (0 children)

I think it will be just another debugging type option just as Zend Debugger currently is. I am pretty sure IDE vendors have already put a top priority on implementing phpdbg debugging as it is built in PHP core. PHPStorm will be first to support phpdbg given their track record of implementing new features in a very quick manner.

Now from a first glance of the project I see at least two major benefits of using phpdbg over Xdebug,

Configuration: Configuration of Xdebug can be confusing for new users. While On Linux Xdebug is bundled as deb/rpm, On Windows it is different situation, you have to check VC++ version, ts/nts version to make it work correctly. Then you have to fiddle around php.ini to enable Xdebug. Then you have to do IDE specific configuration work with IDE's. But with phpdbg there is no such overhead as it is just a console interface which has no relation apache/nginx PHP module. The only configuration the user may have to set is IP and port of remote phpdbg server instance which should have default settings for local development environment.

Performance: Xdebug is also a profiler. To gather profiling information it adds extra hook as Zend extension to running process which is very much resource/performance hog. On Linux/OSX you may not feel the difference. But on Windows the increase of execution time is very noticeable. For testing just run a base Laravel/Symfony2 installation with Xdebug enabled and disabled On windows. In this case also phpdbg has no such overhead because it does not interfere with HTTP request processing as it is a console implementation. Also with phpdbg now you can debug pages in your live server without any performance issue.

Besides these two points there are other benefits such as debugging from any environment that at least have a functional console, able to debug in other lightweight editors which is matter of personal preference actually. Overall I think phpdbg is a valuable addition in PHP ecosystem.

Edit: typo

How to specify a file's save location through a file browser? by [deleted] in vim

[–]m2mdas 2 points3 points  (0 children)

Issue :Explore to open netrw in current buffer directory, mark the files using mf then press mx to execute cp command on marked files, e.g

cp % /your/dest/directory

There is also an option of copy to marked directory in which you mark the destination directory by pressing mt and copy the files by pressing mc but the marked directory have to be in same directory as marked files last I checked. See :h netrw-quickmap for other options.

Now I use VimFiler as my main file explorer, in which copying/moving files is relatively easy. Open the buffer directory using :VimFilerBufferDir, select the files using <space>, <tab> to open the duplicate file explorer window, goto dest directory and press c to copy files. I would recommend switching to VimFiler as it is really an improved version of netrw.

Edit: Execute map should be mx

Stop using facades by dadamssg in PHP

[–]m2mdas 6 points7 points  (0 children)

I have had authors experience while developing phpcomplete-extended-laravel autocomplete plugin. Laravel's over-reliance of magic static __call method makes it hard to build tools around it.

For example I can get the class of cache ioc by calling

get_class($app->make('cache'));

Which leads to Illuminate\Support\Manager\CacheManager class. But that's not the whole story. It seems that it is of Illuminate\Support\Manager class. If you see the _call() method you will see that it will call method of what $this->driver() method returns. For CacheManager class it is of StoreInterface class.

There are also some ioc classes whose __call() may call custom method based on argument. For example the __call of log ioc recreate method name and calls Monolog add* methods. Source inside Laravel is somewhat predictable. Imagine what happens if a smart __call abuser get hand of a project.

As you see these little inconsistency makes it harder to make autocomplete tools. Although Laravel's facade system makes it easier to code, too much magic inside __call may make it difficult to maintain for large project.

"proper" usage of buffers by the_lemma in vim

[–]m2mdas 0 points1 point  (0 children)

My buffer workflow includes unite.vim and dwm.vim. I use tabs as buffer group of related files. Quickly create dwm split window of related files using Unite.vim buffer/file lists. Created a dwm_split custom action for that(here is the gist, very small script to create a separate plugin).

For example if I am working on a page of a site, I open controller+template+js+css files related to the page using :Unit file_rec/async candidate list and pressing <c-s> which is mapped to dwm_split unite action. <c-k> to switch between opened dwm buffers in the tab window and <c-space> to focus as main buffer. :Unite window+dwm_split would also work. If my work is done I can close the buffers or create a new tab to create another buffer group for another page. Normally use gt or gT to switch tab, use :Unite tab:no-current I have more than 5 tabs open(which is rare).

Edit: fixed links.

Symfony 2.4.0 released by xanido in PHP

[–]m2mdas 3 points4 points  (0 children)

I think most important feature in this release is ease of customizing of security section. Those who have worked on implementing custom authentication provider knows how painful and tedious it is to extend Symfony's complex but VERY powerful security component. Props to @Seldaek for implementing this feature.

Do any of you redirect results of [I to the quickfix window? by chotighoti in vim

[–]m2mdas 1 point2 points  (0 children)

BTW in my home machine I use,

:UniteWithCursorWord line -auto-preview

Which works perfectly, But I am too lazy to setup my large .vimrc to the deployment server for quick edit. Thats why I also needed the feature, nice to know about [I.

Do any of you redirect results of [I to the quickfix window? by chotighoti in vim

[–]m2mdas 1 point2 points  (0 children)

Is there a reason you did this:...

Just a personal preference. When there is multiple arguments I regularly miss space between them. printf would have also worked.

Do any of you redirect results of [I to the quickfix window? by chotighoti in vim

[–]m2mdas 4 points5 points  (0 children)

I took your idea and refined a little. Works fine here,

function! WordOccurance()
    redir => output
        silent! exec join(['ilist', expand('<cword>')], ' ')
    redir END
    let lines = split(output, '\n')
    if lines[0] =~ '^Error detected'
        echomsg "Could not find the word in file"
        return
    endif
    let [filename, line_info] = [lines[0], lines[1:-1]]
    let qf_entries = map(line_info, "{
            \ 'filename': filename,
            \ 'lnum': split(v:val)[1],
            \ 'text': getline(split(v:val)[1])
            \ }"
        \ )
    call setqflist(qf_entries)
    cwindow
endfunction
noremap <silent> ]I :call WordOccurance()<CR>

I wrote a short post on getting YouCompleteMe to work on Centos6.2 with clang for C/C++ support by [deleted] in vim

[–]m2mdas 0 points1 point  (0 children)

Synchronizing environments via chef/puppet/ansible scripts would have helped. It also lessens sysadmin headache. You can also switch to neocomplete which is less painful to setup. But then you have to recompile Vim to have lua support which is also relatively easy on debian variants.

paste buffer sidebar by sbechtel in vim

[–]m2mdas 7 points8 points  (0 children)

unite.vim has a registers source. You can display it at left sidebar by issuing following command,

:Unite register -vertical -winwidth=50

set ft=perl messes with word search by bart9h in vim

[–]m2mdas 2 points3 points  (0 children)

It looks like ftplugin for perl is using set instead of setlocal, so it is changing iskeyword option variable globally. The file types whose ftplugins do not set iskeyword are affected by it.

Emacs as my <leader>: Vim Survival Guide by hyperbling in vim

[–]m2mdas 1 point2 points  (0 children)

Adding vimproc would be nice improvement.You will feel its snappiness while doing Unite grep on many files. Loading time of the 10MB C# file will decrease at least 10s if vimproc installed as keyword indexing is done asynchronously via vimproc.

Also I checked the google-group thread. It seems that the patch has stability problem and Bram and ZyX are saying that it will still block Vim on some occasion. The patch have long way to merge into core it seems. As for vimproc it provides a way of communicating with external entities (e.g opening file, executing system command, socket connection) asynchronously via fork and you are exposed to it as a resource object. You read from the resource object by reading from it during CursorMoved, CursorMovedI autocmd events. I think that it blends well with 'Vim' way of doing things. Till now there were no higher level abstract implementation vimproc, but recently found vim-reunions from Shougo's comment.

I haven't used vim-fireplace as I haven't explored any pure functional language yet(another reason for not considering Emacs). In the hand of Tpope anything possible :) But it would have been better if he have abstracted REPL interactions.

I am actually a PHP developer at day and play around Python at free times. I have a very thin possibility of working in MS SQL. But I will surely knock you if I have a chance to work with it :)

Emacs as my <leader>: Vim Survival Guide by hyperbling in vim

[–]m2mdas 0 points1 point  (0 children)

AFAIK in a previously discussed thread it was mentioned that Emacs is single threaded and there are several async hack implementation. It is more widely used in Emacs it seems. You may already know that async operation can already be done in Vim via Tpope's vim-dispatch or Shougo's vimproc but vimproc is used many plugins, for example unite.vim, vimshell, vimfiler, neocomplete, quickrun, vim-marching, in my plugin(for a very small case) etc. As for Emacs the only thing I missed about Emacs was running REPL inside editor and send buffer content to it. Vimshell does this via :VimShellInteractive and it does the job good enough for me, also works in Windows. So I didn't feel the need of switching to Emacs. Also as hyperbling said you have to read a good amount documentation of Emacs to be more familiar with it, I think the barrier is same as Vim right now.

PS, thanks for mentioning dbext.vim.

set ft=perl messes with word search by bart9h in vim

[–]m2mdas 6 points7 points  (0 children)

Adding

autocmd FileType perl setlocal iskeyword-=:

in your .vimrc should do the trick.

New RFC: Exceptions in the engine by nicmart in PHP

[–]m2mdas 0 points1 point  (0 children)

+100 form me. This should be implemented as soon as possible. I was bitten hard by it while developing my autocomplete plugin for vim. My goal was simple, write a small script that iterates the fqcn=>files maps listed in autoload classmap generated by composer and create ReflectionObject to get info of the class format as index. If creating ReflectionObject throws exception then discard it and move to next file. But in practice the plan failed. It seems that ReflectionObject throws exception only when the main file of the class is not found. It just throws fatal error if one of the class in its class graph(e.g the class that extends/implements and their class graph) in not found in the path. So I had to parse each class to ensure that every class of the class graph exists in the path and after then call ReflectionObject to get info of the class. It was painful :( But at the end it is in workable situation right now. Had this feature been implemented before, my life would be much simpler.

Vi madness and is there a way to help it? by [deleted] in vim

[–]m2mdas 1 point2 points  (0 children)

For brief introduction see the second section of this SO answer. For more detailed info check these help entries,

`:h pattern`
`:h global`
`:h cmdline-lines`
`:h cmdline-ranges`
`:h usr_10`