0
votes
1answer
88 views

How can I switch vim mode quickly?

This question is not the same as In vim, how can I quickly switch between tabs?, but what I want is a bit similar to it, since we are all trying to find shortcuts when editing with vim:) Now I am in ...
2
votes
1answer
401 views

looking for an alternative to refile in orgmode for emacs

In emacs/orgmode there is something called refile. you select text, hit refile and you get a list of your outline headlines, select one and your text goes there. Can I achieve something like this in ...
4
votes
2answers
117 views

Getting vi/vim syntax highlighting used by certain user

At work most web-development we do, is done in vi/vim, on a debian-server. Sometimes we have to alter some files as root, and the syntax-highlighting-model of that user (root) is absolutely awesome. ...
1
vote
2answers
93 views

How can I use the vim editor to format the text like this?

I have a data.txt file, the data format is something like this: a|Êó• a|Êõ∞ a|Ôõ∏ a|Ôùã aa|Êòå aa|Êòç aaa|Êô∂ aamh|Êöò all I would like to do is convert the following text into this result: 'a' ...
0
votes
2answers
3k views

What is the ^I character and how do I find it with sed?

I usually import data from csv files to MySQL, but my data provider leaves NULL entries as "", so I need to replace "" with "\N". This is easy enough with a script like for csvfile in *.csv do ...
2
votes
1answer
145 views

Is it possible to define a custom movement in vim?

Is it even possible? What I mean is, many vim commands can take a movement to operate on, can I define a custom movement so that I can tailor my edits to an environment? The specific command I'm ...
23
votes
4answers
4k views

How reverse selected lines order in vim?

For example, if I have four lines as follows: the first line the second line the third line the fourth line I want to reverse them to the fourth line the third line the second ...
2
votes
3answers
443 views

How to rollback the edit version in VIM?

I realized I had deleted something for mistake when I typed :wq,then how can I rollback to the pre-version?Thank you!
1
vote
3answers
1k views

Vim: Bind <C-Enter>

Using vim for editing latex; how can I bind C-Enter? I tried the following, which does not work: imap <C-Enter> \\<CR> and imap <C-Return> \\<CR> However, something like: ...
4
votes
2answers
436 views

Text files on linux have “<97>” characters

When viewing a particular text file in vim or less on Linux or OS X, all the en dashes show up as highlighted "<97>" characters. What control-sequence do I need to type in order to substitute the ...
6
votes
5answers
2k views

How do I delete the next line in vim?

In emacs, whenever I want to delete a few lines of text, I just use C-k until all the text is gone. However, in vim it seems a bit more complex. I know I can do d$ to delete until the end of the ...
1
vote
2answers
82 views

In vim, is there a way to search for a word in a different window?

I'm working with a file where definitions, and references to those definitions are in different parts of the file. I'm looking at the file in a split window - one half looking at the definition, the ...
0
votes
1answer
2k views

How do I get vim not to include a trailing newline at the end of a file?

Emacs doesn't do it, but vim's my editor of choice. It's a problem when editing PHP and some other stuff. So, how do I get vim not to include a trailing newline at the end of a file? I must just be ...
3
votes
4answers
2k views

Ubuntu vi Acting Strange

I just installed Ubuntu Server 8 and found vi to be acting strangely (compared to vi on Fedora, CentOS and OSX). When I use the 'a' command to enter text, pressing the arrow keys results in "C", "D", ...
0
votes
3answers
301 views

Remove lines efficiently in Vim

How can you remove given lines efficiently in Vim? I want to remove all lines which match this :g!/div/ I unsuccessfully ran: :g!/div/s/^*//g
4
votes
2answers
6k views

How to distinguish between \r\n and \n in VIM

In VIM I can show all the hidden characters in a file via the command ":set invlist". However, end of line sequences are always displayed as $ whether it is a carriage return/line feed or just a line ...
12
votes
13answers
1k views

What Vim features do you use? [closed]

I spend almost all day programming in Vim and I am sure that a lot of you do too. What features do you use that make your day to day coding that much better? One that I use is gv, which will let ...