vim

VIM: Delete+Paste in one "command"?

I'm doing a lot of text manipulation between multiple files that requires a lot of yy, dd and ping. This may sound crazy but is there some shorter way of doing dd and p in one go? Maybe even with a plugin? ...

What constitutes a 'word' in vim ?

Let's say we have the following in vim atm: int main () { printf("hello"); return 0; } In vim, w moves a word to the right, but what exactly constitutes a 'word'? For example, if I have the cursor on p of printf, pressing w takes u to ( and pressing another w skips the " and puts the cursor on the h of hello. Why was the "...

VIM: Mappable (unused) shortcut letters?

I'm trying to create two mappings which are efficient for myself: map X ddp Which I'd use to delete and paste in one go. map X "_dw Which would delete a word without yanking into a register. However I don't want to break any existing, useful shortcuts so I'm wondering what keys I could use - any suggestions? Am I being too uptidy?...

Multiple vim configurations?

All, I work in several groups, each of which has its own tab/indentation/spacing standards in C. I'm wondering if there's a way to have separate selectable vim configurations for each? So when I edit a file, I do something like "set group=1" or perhaps local .vimrc's that live in the working directories. Is there support for anything ...

Change syntax color in vim?

I have syntax highlighting on, but comments are set to dark blue. This hard for me to read against a black terminal. How do I change it so that the comments are colored green instead? ...

Can I force gVim to open dragged-in files in a new tab?

I'd like gVim to open files dragged into it to open in a new tab, instead of replacing the current file. This question is on the right track, but I'd like to be able to run multiple instances of gVim, just able to drag files to the window I want. I'm running on Windows 7. ...

What is your favorite/most productive macro that you have used in Vim ?

I'm trying to know how vim experts use macro's in vim for day-to-day coding - I have a lot of custom shortcuts/mappings that I use frequently , but haven't come across any good ideas of macros. It may have been a macro which you had used before , to simplify a task tremendously - I just need ideas as to how to productively use this fea...

Can anyone tell me where to get Vim 7.2 with cscope support ?

I wanted to use cscope enabled vim - unfortuantely , the binaries at work are not compiled with cscope support , and when I tried building from src , I'm getting a lot of errors due to proper dev packages not being installed. So , does anyone have a link where I can a precompiled binary with cscope support ? Btw , I'm using linux. ...

VIM: FuzzyFinder usage, tips, gotchas - how can one make use of this plugin?

http://www.vim.org/scripts/script.php?script%5Fid=1984 You can launch FuzzyFinder by following commands: Command Mode ~ |:FufBuffer| - Buffer mode (|fuf-buffer-mode|) |:FufFile| - File mode (|fuf-file-mode|) |:FufDir| - Directory mode (|fuf-dir-mode|) |:FufMruFile| - MRU-File mode...

Remove Duplicate Line in Vim?

I'm trying to use VIM to remove a duplicate line in an XML file I created. (I can't recreate the file because the ID numbers will change.) The file looks something like this: <tag k="natural" v="water"/> <tag k="nhd:fcode" v="39004"/> <tag k="natural" v="water"/> I'm trying to remove one of the duplicate k="natural" v="wat...

Autocomplete with Vim and Rails Datamapper

Is there a way that I can have auto completion in Vim after I load a model from the database? So for example if I have a model of type Foo with an instance method of type bar and do the following foo = Foo.first(:param=>'x') foo.b should show me bar as a possible auto complete value. I think that this is somewhat hard to accomplish wi...

How to exclude file patterns in vimgrep?

In vim, I do search with vimgrep frequently. I have mapping like below: map <leader>s :execute "noautocmd vimgrep /\\<" . expand("<cword>") . "\\>/gj **/*.*" <Bar> cw<CR> 5 The problem is that there are some temporary subfolders (like obj, objd) that I don't want to search for. How can I exclude subfolders matching given patterns. Fo...

Vim: snipMate plug-in does not trigger snippet completion

Vim is installed at /usr/share/vim. All snipMate's folders were added to this category in existing folders (after, autoload, plugin, snippets, etc.) accordingly. From the documentation file: For instance, to change the trigger key to CTRL-J, just change this: ino <tab> <c-r>=TriggerSnippet()<cr> snor <tab> <esc>i<right><c-r>=Trigger...

vim and python scripts debugging

Good day! Are there any ways to debug python scripts not leaving vim in *nix systems (executing the script, setting up breakpoints, showing variables in watch-list, etc)? Thanks for feedback. ...

Vim + Snippets isn't working

Hi guys, I'm not sure if this question should be done in the superusers, but anyway, lets give it a try. Here is my problem.. I'm running ubuntu 9.10 and I'm tying to create a development environment with Vim and it's plugins. I've done everything that I needed, but I'm having some issues with the snippets: When I'm in a model and I p...

Vim finds incorrect matching bracket when using %

I am trying to learn VIM, buy I noticed when I try using the % command to go to a matching bracket, VIM sometimes finds the correct matching bracket and is sometimes way off. Has anyone ever come across this with a solution? ...

messy css indentation in vim

When editing an html file in vim, the indentation for css inside style tags is messy. For instance, this is how it would indent this sample css code without any manual intervention to fix the indentation on my part: div.class { color: white; backgroung-color: black; } Why is this happening? how can I fix it? ...

How do I join two lines in vi?

This might be a small one! I have a two lines in a text file like below: S<Switch_ID>_F<File type> _ID<ID number>_T<date+time>_O<Original File name>.DAT I want to append the two lines in vi like below S<Switch_ID>_F<File type>_ID<ID number>_T<date+time>_O<Original File name>.DAT What happened here is that the second line got delet...

Speedup writing C programs using a subset of the Python syntax

I am constantly trying to optimize my time. Writing a C code takes a lot of time and requires much more keyboard touches than say writing a Python program. However, in order to speed up the time required to create a C program, one can automatize many things. I'd like to write my programs using smth. like Python but with C semantics. I...

Searching for a specified word in the file opened in VI editor

Please tell me how to search for a specifig word if the file is opened in VI Editor. I know we can do it by using /word_to_be_search but it will not do the exact search for the word. Example /sachin will searches for sachin_server, sachin_client and not only sachin ...