News for hackers. Stuff that matters.

m2mdas

When Vim is inactive, I can attach a function in a CursorHold autocmd event which would consists of loop that reads from the resource object and sleeps for a small interval after that. As the external program/socket connection is running in separate process, reading from it is not resource sensitive so it should not block Vim entirely.

BTW there is a plugin called CoVim https://github.com/FredKSchott/CoVim that implements pair-programming feature using default built-in Python binding.

Bugs happen in software, you can not avoid. It is specially true for Vim which is used in wide variety of platforms. But still the segfaults bug listing is not that frequent as you described. Also Bram and other members are responding to to bug report in timely manner. Last I heard author of Sublime have stopped responding to bug reports.

Also you have zero knowledge of how Vimproc works. It spawns process or create socket connection in background and clients have access to it as a resource object from which client can read data during CursorMoved and CursorMovedI autocmd events. It is actually psudo-async but it works very well. I am using the plugins that have used Vimproc, even I used it in my PHP autocomplete plugin https://github.com/m2mdas/phpcomplete-extended (shameless plug) and it did not failed me yet. Also if you looked at the s:garbage_collect() method https://github.com/Shougo/vimproc.vim/blob/master/autoload/v... it is trying to release resource handles of the processes exited.

Also why should I need a clock inside vim? There is tmux/Screen status line for that. Please provide another valid use case.

WTF are you talking about? Vim have may have many demerits but segfaults is not on that list. If segfaults are that frequent you described then people would have jumped ship already.

I can't comment on the code structure of Vim but it does not matter to me because end product is working fine for me for 5+ years. Also bad code structure did not stop continuous development of Vim. Just for example there were 1000 patches added to the core before Vim version was changed from 7.3 to 7.4 within 2 years. Important features like more python binding, lua bindings were added during this time. Even if you see the current patch log of 7.4 ftp://ftp.vim.org/pub/vim/patches/7.4/README 68 patches were added since 7.4 release.

Though async future is not built-in there are several plugins for doing async operation, for example vim-dispatch[1] and vimproc. Vimproc is more widely used. See Unite.vim[3] , neocomplete[4], VimShell[5] for demonstration. I would specially point to VimShell because with the help of it you can run REPL inside Vim and pass buffer content to it. Also there is YouCompleteMe[6] which provides FAST autocomplete.

[1](https://github.com/tpope/vim-dispatch/)

[2](https://github.com/Shougo/vimproc.vim/)

[3](https://github.com/Shougo/unite.vim)

[4](https://github.com/Shougo/neocomplete.vim)

[5](https://github.com/Shougo/vimshell.vim)

[6](https://github.com/Valloric/YouCompleteMe/)

Re:Vim is the worst editor, except all the other editors on Thursday September 12, 2013 @05:23AM (#6372999)
Well I made this comment in context of his editing file via pry-rescue which at first observation looked as if he was live editing in server. Upon further inspection it seems that pry-resque is acutlly a good debugging tool. I did not know about it because of my very little ruby development knowledge. Sorry, My bad :)
Re:Vim is the worst editor, except all the other editors on Thursday September 12, 2013 @04:20AM (#6372794)
Pasting the reply I gave in r/vim

Answer to some of the points,

Janus: There are divided opinions in vim community about whether distributions should be used or not. I am on the latter side. But still for just checking out I installed Janus a while ago. Yes it is slow, but it turns out that it is as slow as my then `.vimrc` configuration. I tried to track down the problem. It is because of vim's blocking behaviour during executing external commands. When you write a buffer or switch to a buffer, syntastic, tagbar, powerline statusline, gitgutter, bufexplorer all execute external command. Vim becomes more slow when `.git` repository grow larger or when saving a large file. So how do you solve the problem? Remove those plugins and install Unite.vim[1] with vimproc[2] asynchronous library.

Files that change: If you do external edits more frequently then I think it is time to rethink your work-flow. I think there is a common consensus that you should not run live edit in server.

* Indenting pastes* : There is a plugin for that [3] ?

* Opening files inside my project : Last I checked command-t was damn fast, don't know where slowness comes form. Another alternative is `Unite.vim` `file/async` source. It is fast at finding files but goes slow while doing ignore-pattern checking. Without the checking it is DAMN FAST. The `phpcomplete/files` source I created for my php autocomplete plugin[4] easily list 4000+ files in seconds. If you want to list files obeying the patterns in the '.gitignore' or '.hgignore' files. Checkout my unite-file-vcs[4] plugin. It adds a `file/vcs` source that lists files by issuing `git ls-files` or `hg status -c -m -u` command for `git` or `mercurial` projects respectively.

Navigating inside files*: Checkout unite-outline[6]. It shows live output by parsing the current buffer. Unite.vim required. But it does not support css files right now. Adding support should be easy.

So the summary of the story. Move to `unite.vim` and friends ;)

[1] https://github.com/Shougo/unite.vim/

[2] https://github.com/Shougo/vimproc.vim

[3] https://github.com/sickill/vim-pasta

[4] https://github.com/m2mdas/phpcomplete-extended

[5] https://github.com/m2mdas/unite-file-vcs

[6] https://github.com/Shougo/unite-outline