vim

what's the diffrent with vim regex and normal regex

I notice that vim's substitute regex is a bit diffrent with other regexp, what's the diffrent with them. ...

How can I run Ruby specs and/or tests in MacVim without locking up MacVim?

About 6 months ago I switched from TextMate to MacVim for all of my development work, which primarily consists of coding in Ruby, Ruby on Rails and JavaScript. With TextMate, whenever I needed to run a spec or a test, I could just command+R on the test or spec file and another window would open and the results would be displayed with t...

Insert vim variables into text for comment shortcut.

I have a simple goal: Map Ctrl-C, a command I don't think I've ever used to kill vim, to automatically insert at the beginning of a line the correct character(s) to comment out that line according to the file's filetype. I figured I could use an autocommand the recognize the file type and set a vim variable to the correct comment charac...

Path for tags in VIM for multiple projects

Hi, I've recently started using ctags on my projects. I currently have the following setup: root/tags [contains all non-static tags] root/foo/tags [contains static tags for the foo directory] root/bar/tags [static] root/something/else/tags [etc.] ... I can set tags=./tags,tags,/path/to/root/tags and everything works perfectly. Howev...

Regular expression to remove the last column from a pipe delimited file.

I've got a file with 1000's of entries and 131 columns, the columns are pipe delimited. There is no pipe at the end so format is something like. 2010-10-04|Security|AMEND|20162214| ... lots more columns ... |Bloomberg How can I remove the last column of the file say in Vim ? ...

Is there a way to export my current vim maps and functions as a .vimrc?

I lost my latest version of my .vimrc and I have no snapshots of it anywhere but I do have a vim still open that has the new functions and mappings. I was hoping that maybe someone would know how to "export" that running vim's maps and functions out to a file so I could recreate the .vimrc? ...

fresh installation of gvim on ubuntu. where should I put my plugins?

I just installed gvim on fresh installation of ubuntu lucid. I've messed this up before that's why I want to start on the correct step here. Where should I keep all my plugins and my .vimrc?? my current runtimepath on gvim is: runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/usr/share/vim/vimfi...

Shell application in Vim window

I'm searching a way to start console application in vim window. So I could open python & php interactive shell in it. It would be very handy. I want something like :10 sp !python ...

Aliasing a command in vim

Vim is my preferred text editor when I program, and thus I always run into a particularly annoying issue. Frequently, when I quickly need to save the buffer and continue on to some other miscellaneous task, I do the typical :w However, I – what seems to be like more than 50% of the time – always manage to capitalise that :w. Natural...

Set python virtualenv in vim

I use vim for coding and for python coding in particular. Often I want to execute the current buffer with python interpreter. (for example to run unittests), usually I do this with :!python % <Enter> This scenatio will work works fine with global python, but I want to run virtualenv python instead. How do I enable virtualenv within vim...

Dealing with code indentation in Vim?

Hello, I work on an engineering team of 4 people, mostly writing javascript while occasionally dabbling in ruby and python. So, as a team, we share code all the time, and as most programmers do, each member of the team has his favorite level of indentation & related settings. I am one of 2 members of the team who use and love Vim as my ...

Vim Regex : How to search for A AND B NOT C

I have many lines containing the names of US Presidents Carter, Bush, Clinton, Obama. Some contain 1 of those names, some 2, some 3, some all 4 of them (in any order) I know how to search for Carter AND Clinton AND Obama -> :g/.*Carter\&.*Clinton\&.*Obama/p ; I know how to search for Carter AND (Clinton OR Bush) -> :g/.*Carter\&(.*Cli...

Vim commands :Explore :Sexplore :Hexplore doesn't work in cywing

Hi I am using vim 7.3.3 in cywing 2.721, the installation was made using cywing, every thing works but when I try to use the following command. :Explore vim said E492: Not an editor command also neither :Sexplore or :Hexplore works. is there any way to activate this functionality? This is in machine with windows xp. ...

vim travel to pathfile via shortcut, directly, always.

when i travel between files using a shortcut over a pathfile, then it seems like i don't just travel between files. i go to a file using >, within that file i change location of the cursor and do something, then i press <. but instead of going to the previous file, it first goes to the original location i was at when i entered the file,...

How to map function keys to compile my program ?

Hello In VIM i want to map say function key Fn for compiling the currently open C/C++ file. Is that possible ? If yes please guide me. ...

Vimscript: find last open parenthese or bracket

I'd like to write a function in vimscript that finds the last open parenthese or bracket in a line. This isn't necessarily an easy problem, because it needs to be able to handle all of the following: function(abc function(abc, [def function(abc, [def], "string(" function(abc, [def], "string(", ghi( As you can see, nested parenthesis, ...

How to collapse concealed text ?

The problem is as follows : 1) This is about a plain .txt file 2) I have enabled the conceal feature and created this syntax file : set conceallevel=3 syn region cTest conceal start='€£' end='£€' hi cTest ctermfg=DarkYellow 3) I write first a summary/skeleton of what I want to say, and put it in between €£ and £€. Then, in the same...

How do I make imap work in paste mode in Vim?

Hi, I recently started use :imap jj and am trying to unlearn Ctrl+[. However, imap doesn't work when paste mode is on. How do I make it work in paste mode? Thanks. Sam ...

How to install rails plugin for vim ???

I have dowloaded the rails.zip file from http://www.vim.org/scripts/script.php?script_id=1567. and have unzipped it to a folder rails. Now to install the plugin to vim. Here's the vim version am using in my ubuntu 9.04 : version 7.2.79. ...

Testing for locale existence in Vimscript

One of my problems when creating a portable .vimrc is with locales. Let's say I always want to use English language for messages. Depending on OS and Vim version, the command needed may be lang messages en, lang messages en_US, lang messages English_US, etc. Now, I can do this: try lang messages en catch try lang messages en_US ...