vim

A problem with folding bash functions in vim

Hello! I have a bash script file which starts with a function definition, like this: #!/bin/bash # ..... # ..... function test { ... ... } ... ... I use vim 7.2, and I have set g:sh_fold_enabled=1 such that folding is enabled with bash. The problem is that the folding of the function test is not ended correctly, i.e. it lasts until t...

How can I indent code in the Vim editor on Windows?

Duplicate: How to indent a selection in gvim (win32)? How do I indent multiple lines quickly in vi? Using vim under linux I can indent a block of code using the VISUAL mode and pressing ">". In vim under Windows this does not happen. This is what happens: Press V, the VIM enter in the VISUAL mode Press 'Down', the VIM exit ...

Hide (or fold) columns of text in (g)Vim (horizontally)

Hi all, is there a way to hide columns of a buffer (text file, you know what I mean) while editing it in Vim? e.g. text visible in the buffer before hiding column 2&3: abbcccccc accdddddd And after hiding them: acccccc adddddd (Not to mention I'm working with really huge files (sometimes over 200 gb).) And yeah, I had found fold...

How to get the size of a gunzipped file in vim

When viewing (or editing) a .gz file, vim knows to locate gunzip and display the file properly. In such cases, getfsize(expand("%")) would be the size of the gzipped file. Is there a way to get the size of the expanded file? [EDIT] Another way to solve this might be getting the size of current buffer, but there seems to be no such ...

VIM Ctrl-V Conflict with Windows Paste

I am using VIM in Windows. The problem is that I want to use Ctrl-V as a visual mode. However, this key has conflict with Windows paste. How can I reset this key back to VIM visual mode instead of pasting. I prefer to set this in my _vimrc configuration file. Thanks for any help! ...

Replace Tab with Spaces in VIM

I would like to convert tab to spaces in gvim. I added the following codes to my _vimrc: set tabstop=2 It works to stop at 2 spaces but it still looks like one tab key is inserted (I tried to use h key to count spaces afterwards). Not sure what should I do to make gvim to convert tab to spaces? ...

VIM How do I search for a <XX> single byte representation

When I cut and paste from a Word document into VIM, quotes get translated into a-circumflex followed by <99>, where the <99> is a single byte representation. (Which I know because when I move to it, typing a single 'l' moves me right to the over all four characters). I want to do search and replace, and I know enough to find the a-cirum...

how to open a file in a list of files in vim?

I have a longish list of files opened in vim that looks like this: /dir1/file1 /dir2/file2 /dir2/file3 ..... How can I open all of them one by one the easiest way possible in the same session of vim either with split or edit? ...

Vim Case-Agnostic Regex

I've run into the following case a few times and I was wondering if there is a fast way to handle it in Vim. I'll have a source file like the following: #ifndef _FOO_H_ #define _FOO_H_ class Foo { Foo(int foo); }; #endif And I would like to convert it to the following: #ifndef _BAR_H_ #define _BAR_H_ class Bar { Bar(int ba...

What is your Linux/Vim cheat sheet?

As a Windows user, I found it difficult to master the Linux and Vim commands. So are there some cheat sheets to look them up into quickly? ...

Tabbing selected section in VIM

In many GUIs when I select a section of text and then hit the TAB or Shift-TAB button the selected section will indent in or out. In VIM I can select a visual section and then hit the "<" or ">" key to change indenting, however once I hit the "<" key my selection is cleared so I am stuck selecting the section again and hitting "<" agai...

vim regular expression

I have following text in a file 23456789 When i tried to replace the above text using command 1,$s/\(\d\)\(\d\d\d\)\(\d\d\)*\>/\3\g I am getting 89. Should't it be 6789? Can anyone tell me why it is 89. ...

Can I use SPACE as mapleader in VIM?

Hello, From http://items.sjbach.com/319/configuring-vim-right I got that you were supposed to be able to use SPACE as the mapleader in vim. I've tried but it does not seem to work. Anyone who have made it work? Tried: let mapleader = <space> Thanks, -Martin ...

How would I create a VIM or Vi command to delete all text after a certain character for every line in a text file?

Scenario: I have a text file that has pipe (as in the "|" character) delimited data. Each field of data in the pipe delimited fields can be of variable length, so counting characters won't work (or using some sort of substring function... if that even exists in VIM). Is it possible, using VIM / Vi to delete all data from the second p...

Keeping parentheses balanced (Paredit for Vim?)

Emacs has Paredit which actively prevents you from typing unbalanced parentheses (short of C-Q ( to force-insert a literal one, or other craziness). Inserting an open paren also inserts a closing one. Backspacing over a paren either deletes both the opening and closing paren, or neither. There are shortcuts to wrap a bare word in new ...

Advice for Getting By in the Delphi IDE without VI

As a long time VIM user, it pains me to have to use the Delphi IDE. At least with Visual Studio there's ViEmu which works well. So, do you have any advice for getting by in the Delphi IDE when you're so used to VI? Any settings that you'd recommend to make things a little more familiar? Any specific keyboard shortcuts that can save t...

Unset ignorecase in vim?

:set ic ignores the case, how do you unset this? ...

Advice regarding IPython + MacVim Workflow

I've just found IPython and I can report that I'm in deep love. And the affection was immediate. I think this affair will turn into something lasting, like the one I have with screen. Ipython and screen happen to be the best of friends too so it's a triangular drama. Purely platonic, mind you. The reason IPython hits the soft spots with...

Vim: apply settings on files in directory

How do I specify Vim settings for all files under the current directory? The ideal solution would be if Vim searched for and read a .vimrc in the current directory before searching for ~/.vimrc, and apply the settings there for the entire tree. I've seen a plugin, but this means the applied settings aren't transparent since they requir...

vim Comment Newlines Unexpected Behavior

In using vim, when I start a comment with //, immediately after I type a space, it begins a new comment line. For instance, if I typed the following: //hello world my name is stefan I would get: //hello //world //my //name //is //stefan This behavior has manifested itself in python code as well, where if I begin a line with print,...