vim

Can I substitute multiple items in a single regular expression in VIM or Perl?

Let's say I have string "The quick brown fox jumps over the lazy dog" can I change this to "The slow brown fox jumps over the energetic dog" with one regular expression? Currently, I use two sets of regular expressions for this situation. (In this case, I use s/quick/slow/ followed by s/lazy/energetic/.) thanks. ...

Is it possible to use vim with the mouse

Is it possible to use vim with the mouse? If so, how? ...

where is the : command history stored?

Hi, I want to know where the : command history is stored for a particular vim session. I know we can scroll and search through the history. My objective is to take a portion of the commands that I executed using trial and error and create a vim source file. ...

Linewise Selection in VIM

How can I select all lines that do not contain the word "hello" in VIM? I need it yanked and then saved to a file. How can I do it? I am looking for something like: :v/!(hello) > file ...

Find and Replace within selection in `vi`

How do I do a Find and Replace within a selection in vi? ...

Vim search highlighting

i have a pre-configured .vimrc file under ~/ ,after searching a term through '/' key,all items matched are highlighted,but after i find the need position and hit enter,the highlighted terms are still highlited... it's very disappointing since when i issue --c/"--,the screen is mashed with highlightings.which setting controls search high...

Highlighting matches in Vim over an inverted pattern

How may I highlight in Vim with the :match command the text that does not matches with the given pattern? So, I want the opposite of: :match myGroup /foo/ ...

In vim, how do I get a file to open at the same line number I closed it at last time?

I want to configure vim to open a file at the same place I left off at. ...

PHP IDE with vi key bindings

At the moment I'm using eclipse with viplugin. I also know about netbeans and its vi plugin. I find both of these IDEs don't really fit my tastes though. Too slow, bad remote editing support. I don't really have time at the moment to set up and try a vim based ide either. So, what other PHP IDE is available that supports vi key bindings...

How can I change a file's encoding with vim?

I'm used to using vim to modify a file's line endings: $ file file file: ASCII text, with CRLF line terminators $ vim file :set ff=mac :wq $ file file file: ASCII text, with CR line terminators Is it possible to use a similar process to change a file's unicode encoding? I'm trying the following, which doesn't work: $ file file.xml f...

Emulate Windows C-Del/C-Backspace behavior in VIM

I like to emulate the normal behavior of C-Del/C-Backspace on Windows in VIM. Currently i'm using: imap <C-Del> <C-o>dw imap <C-Backspace> <C-o>db This is close but not perfect. E.g. when trying to delete this from the end of the line foo(1, 2) with C-Backspace, this happens: foo(1, ) How can I solve this? ...

Vim movement on other programs

I'm learning Vim and with it came the urge to use 'hjkl' and friends on every other program, including mouse operated programs like browsers. How can I use these keyboard shortcuts, or something similar? I'm using Linux. ...

assembly vim syntax highlighting

The default assembly syntax file didn't works well,and after a searching on the web about gas assembly,found nothing about gas(AT&T syntax) syntax file for vim.. anyone found this??? I can't write my own syntax file.. ft=nasm ft=asm(default) ft=tasm ...

Case preserving substitute in Vim

Can this can be done in Vim? What I mean is: searching for 'BadJob' and replacing with 'GoodJob' would do the following replacements 'badjob' -> 'goodjob' 'BadJob' -> 'GoodJob' 'badJob' -> 'goodJob' 'BADJOB' -> 'GOODJOB' ...

How can I invoke VIM with C-X e for long, complex, tricky commands?

I found an awesome tip here. You can "[r]apidly invoke an editor to write a long, complex, or tricky command". However, when I press the key combination above, I get Emacs open. I would like to switch it to Vim. How can I invoke Vim with C-X e? [1. Problem SOLVED by Brian Cambell] export EDITOR=vim Add to your .bashrc or appropria...

Multi-line regex support in Vim

I notice the standard regex syntax for matching across multiple lines is to use /s, like so: This is\nsome text /This.*text/s This works in Perl for instance but doesn't seem to be supported in Vim. Instead, I have to be much more specific: /This[^\r\n]*[\r\n]*text/ I can't find any reason for why this should be, so I'm thinking I ...

Where can I get a vim syntax file for the Falcon programming language?

I just discovered the Falcon programming language today and would like to experiment with it a bit. As it is quite new, there is no ide. That's not a problem as I can use Vim. It would be helpful if there were a Vim syntax file for Falcon, but I can't seem to find one. Can someone point me to a Vim syntax file for Falcon? If not, I could...

Using VIM as a logfile-viewer

I'd like to use VIM as a logfile-viewer. Is it possible to reload the current file in a regular time interval (~1s)? ...

How can I use vim to edit text from Perl while the script is still running?

I have a Perl script that outputs text. I want to import this text into vim, edit it, save it and then exit. On exit, I want the original Perl script to process the edited file. E.G. how crontab -e works when you add a new job. Thanks :) ...

Vim in Emacs

The question does not refer to some Vim-mode in Emacs, but to Vim inside Emacs. I am not waging any Editor-war. I just want to use Vim in Emacs. You can get to Vim in Emacs with commands "M-x term" and "vim". When I am using the Vim-Emacs, the typing is awkward. There are odd signs, such as "4m", "4mm" and "^?^?". The backspace and ...