vim

VIM php omni completion

Hey, I'm trying to get php autocompletion right in VIM. Right now when I do a $blog = new Blog(); $blog-> and then hit CTRL+X CTRL+O I'd expect omnicompletion to return all the functions in the class Blog. Instead, it returns all functions for the entire project. I've built ctags for my project like so: ctags -R * Is there any way to...

Substituting zero-width match in vim script

I have written this script that replaces many spaces around the cursor with one space. This however doesn't work when I use it with no spaces around the cursor. It seems to me that Vim doesn't replace on a zero-width match. function JustOneSpace() let save_cursor = getpos(".") let pos = searchpos(' \+', 'bc') s/\s*\%#\s*/ /e...

Vim cursor shape question

I currently use MacVim for a lot of my editor needs but occasionally I need to edit files remotely over ssh. In MacVim the shape of the cursor varies depending on your current mode, i.e. command mode -> block cursor, insert mode -> vertical bar cursor, which I find very helpful. Is there a way to replicate this behavior in a .vimrc fil...

reformat in vim for a nice column layout

Hello, I have this dataset in a csv file 1.33570301776, 3.61194e-06, 7.24503e-06, -9.91572e-06, 1.25098e-05, 0.0102828, 0.010352, 0.0102677, 0.0103789, 0.00161604, 0.00167978, 0.00159998, 0.00182596, 0.0019804, 0.0133687, 0.010329, 0.00163437, 0.00191202, 0.0134425 1.34538754675, 3.3689e-06, 9.86066e-06, -9.12075e-06, 1.18058e-05, 0.0...

Vim highlight characters/words/line for Copy to clipboard

I am fairly new to vim. I am trying to practice (been reading a couple of tutorials lately) but I found out I couldn't live without highlighting characters/words/lines for Copy-paste. In Textmate, I usually SHIFT+CTRL+LeftArrowKey to highlight words and then Copy. How do I do that in VIM? NOTE: I have NERDTree plugin installed and map...

SuperTab Plugin doesn't work together with the omnicomplete feature (<C-X><C-O>)

I am using VIM to code PHP. I also have indexed my project folder with ctags. It works pretty well with omnicompletion, so when I type for example $someObject-><C-X><C-O> it shows all methods of the object. I am working with the SuperTab plugin too though, and when this plugin is active, I cannot hit anymore. Nothing happens, only bel...

Selecting resulting files from grep in vim

After I run a grep search in vim with :grep, I get a list of files. Is there a way to select one of those files and open it in a new tab at that particular line? ...

How to run a terminal inside of vim?

I am used to emacs but I am trying out vim to see which one I like better. One thing that I like about emacs is the ability to run a terminal inside emacs. Is this possible inside of vim? I know that you can execute commands from vim, but I would like to be able to run a terminal inside of a tab. ...

Vim FTP Plugin for IDE-like behavior

Hello, I have gVim (with: NERDTree, minibufexpl). Right now, I can edit files locally with IDE-like feel with NERDTree for a file explorer and minibuf for tabs. However, I am used to editing files on dummy server I have set up at home. I use Zend Studio to edit files through FTP. Is this feature available in Vim? If so, does it "integ...

vim: execute shell command without filtering

I want to select a block of text (eg. V%) and use the text as input to a shell command (eg. wc or pbcopy) - but I DON'T want to alter the current buffer - I just want to see the output of the command (if any) the continue editting without any changes. Typing V%!wc translates to :'<,'>!wc and switches the block of text for the output of ...

what is the difference between :.! and :r! ?

Hello vimmers, reading up on some vim tips, I came across :r!{command} and :.!{command}, both of which take the output of the shell <command> and put it in the current buffer. I imagine the 'r' to stand for 'read', but how am I to 'translate' the dot in the command above? And: do they have the exact same function? Thanks a lot for you...

VIM comma is missing in insert mode

Hi folks, I'm a VIM beginner, and I have a weird problem. I started using vim in a terminal emulator, but today I moved to gVim. Then I realized that I cannot write a comma in Insert mode! I tried :map ,, :imap , both said no mapping found. THen I tried :nomap , and :inomap , both without any luck. As writing the commands, I am able to ...

In VIM: How to highlight "local variables" in a "C" file

I have highlighted all Symbols by using tags file & highlight option. But I could not able to highlight my local variables. I have an idea, that is, VIM already supports autocompletion of keywords for a current file, it does autocompletion of my local variable, so, if I get a list of keywords for my current file then I will highlight t...

To vimdiff changed files at Dropbox by Vim

I often get a notification to my Vim that my file has been changed elsewhere, since I use Dropbox. I then need to press L because it is my only way to get to see the file changed by my friend. This forces me to use his version and then just try to remember the changes which I did. This procedure however is becoming difficult for me...

MiniBufExplorer and NERD_Tree closing buffers unexpected behavior

I have MiniBufExplorer and NERDTree installed. With a NERDTree window open at the same time as MiniBufExplorer with >2 editable buffers, closing one of the buffers with :bd causes the buffer to empty but the window to show the empty buffer and not one of the next or previous buffers. Also, the buffer just closed still shows up as selecte...

In vim, how can I delete all lines in a file except the last 100 lines?

In vim when my cursor is on the first line I can press: 100dd to delete the first 100 lines. But how do I delete all lines except the last 100 lines? ...

Emacs-style Regex in Info-reader?

I am a Vim-user lost in the Emacs-style Regex of Info-reader. I want to match: $ info find ?How-in-Info-reader? :%s#\(\\;.*\\+\)\|\(\\+.*\\;\)#WORKS!#g INFO: "C-X n" to go through the matches I am looking for the Emacs-counterpart for the Vim-command marked with "?How-in-Info-reader?". How can you find the matche...

What are the easiest/best methods for managing your ctags tag file(s)?

I just started using ctags and greatly appreciate the tool but the way I manage my tag file is somewhat cumbersome in my opinion and very inflexible. How I currently manage my tag file: I have one monolithic tag file stored in my home folder at ~/.vim/tags When I update my code or change projects I run a script that deletes the old ta...

How do I get omnicompletion for Python external libraries?

I've setup my gVim to have omnicompletion, but only for the standard library atm.. How do I include other libraries (Django, Pygame, etc...)? Thanks! ...

"Minimizing" vertical VIM window splits

I use horizontal and vertical window splits in religiously in VIM and up until recently, I enjoyed the comfort of two commands to effectively hide (or minimize) my horizontal splits. I set them up adding the following lines to my .vimrc file: set winminheight=0 map <C-J> <C-W>j<C-W>_ map <C-K> <C-W>k<C-W>_ Hitting Control-j or Control...