vim

Vim errorformat

I read the docs, but got even more confused. I have the following error generated by the compiler: rot; ^ "cpp\c1.cpp", line 13: error(114): identifier "rot" is undefined 1 error detected in the compilation of "c1.cpp". I know how to detect the line where the error line is given, but I get loads of extr...

How to Emulate TextMate's Command-Return Feature in Vim

TextMate has a feature where pressing Command-Return at any point inserts a new line below the current line placing your cursor at the beginning of the new line. This works much (exactly?) like pressing 'o' while in command mode in Vim. Is there a way to emulate this TextMate feature while in insert mode in Vim? The same question phrase...

How can I replace intraline tabs with spaces, maintaining alignment?

I like to use spaces for indentation rather than tabs; replacing tabs at the beginning of a line is easy in sed or vim: s/^I/ /g But if there are tabs within a line (pretend the spaces are the width of the tab char): 'foo'^I ^I => 'bar', 'bazzle'^I => 'qux', Each tab doesn't correspond to a set number of spaces to maintain the...

What is and how to turn off vim recording?

OK, here is the thing -- I keep on seeing Recording message at the bottom of my gvim 7.2 windows. Sort of annoying! What is it? how to turn it off? what is it used for? explains. explanation, directions are appreciated! thanks ...

Vim: how do I swap two characters?

Is there a fast command to change Cnotrol to Control ...

gVIM on Windows: execute buffer and paths with spaces

Hello. In gVim for windows it's possible to execute current buffer via :!% command. But, unfortunately, the buffer file name is supplied to cmd.exe without quotes, so if file path has spaces gVim will not be able to execute it. Is it any easy way to fix it in order to be able execute .bat, .py etc from within gVim? ...

How to yank entire block in vim?

Is it possible to yank an entire block of python code in vim? be it a def, for, if, etc. block.. ...

Finding repetition by Vim's Regex and globbing

How can you find the repetiting sequences of at least 30 numbers? Sample of the data 2.3758542141230068337129840546697038724373576309794988610478359908883826879271070615034168564920273348519362186788154897494305239179954441913439635535307517084282460136674259681093394077448747152619589977220956719817767653758542141230068337129840546697...

How to get visually selected text in VimScript

I'm able to get the cursor position with getpos(), but I want to retrieve the selected text within a line, that is '<,'>. How's this done? UPDATE I think I edited out the part where I explained that I want to get this text from a Vim script... ...

Vim: paste after last space?

I often want to paste some text after the last space in line. If I have sometext <cursor> and press Ctr+O, P, I got sometext<pasted_text> instead sometext <pasted_text> How do I achieve the latter in vim? ...

How do I close all buffers that aren't shown in a window in vim?

I have a horde of buffers open in vim, with only a few of them open in split windows or on other tabs. Is there a way to close all but the ones that are currently visible in one of those splits or tabs? ...

make gvim 7.2 background black

I am sick and tired of the white background when I edit c/c++/etc code. I want the black backround. that is what I currently have in my .vimrc file in regard to coloring. Please help me change it: if !has('gui_running') set t_Co=8 t_md= highlight NORMAL ctermbg=black ctermfg=white thanks ...

what is the good gvim guifont for C/C++ programming

I am trying to find an optimal font for gvim to program in C/C++. I currently have the following in ~/.gvimrc and I don't like it: if has("gui_gtk2") set guifont=MiscFixed\ 11 else set guifont=-misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1 endif set columns=80 lines=50 set guioptions-=T "hide toolbar "Try to load h...

vim highlighting to right edge of screen

Hello, Is it possible to define a syntax group where highlighting would extend to the right edge of the screen (and not just to the last character in the line) ? This group could potentially match several lines. I am not trying to highlight the current cursor line, but rather whole comment blocks. ...

Using css_color plugin for vim causes omni completion not to work

I am using the css_color.vim script with gvim 7.2 on vista. Because of this script I am not able to use omni-completion for css that came with the gvim I installed, which works perfectly fine if I rename the css.vim file to css.vim.bak or something. I usually open omni-completion drop down using <C-x><C-o>, but with the css.vim, when I ...

How can I create a folder, if it doesn't exist, from .vimrc?

I don't like how vim clutters up my folders with backup files, so I have the following line in my .vimrc file: set backupdir=~/.vim_backup However, sometimes this folder doesn't exist because of new machines where I am copying my user files over. How can I create this folder automatically, if it doesn't exist, from within .vimrc? Or ...

Exact string match in vim? (Like 'regex-off' mode in less.)

In vim, I often want to search on a string with finicky characters which need escaping. Is there a way I can turn off the meaning of all special characters, kind of like regex-off mode in less, or fgrep? I am dealing with particularly hairy strings; here's an example: ((N/N)/(N/N))/N Not having to escape any characters to do a search...

VIM highlight variable under cursor like in netbeans

i worked in netbeans and liked its feature - when you place cursor in a variable name all occurences of the variable are highlighted. this is very useful for quick searching all occurences of the variable. is it possible to add this behavior to Vim ? ...

VIM count / determine number of errors in quickfix

This may sound silly, but I did not find it in the help. How to determine the number of errors in the QuickFix, after running :make ? Or at least see if there are any errors, i.e. errors > 0? ...

how do I do redo (i.e. "undo undo") in vim

In vim, I did to much undo. How do I undo this (i.e. redo) ...