vim

What specific productivity gains does Vim/Emacs provide over GUI text editors?

This isn't meant as a troll or flamebait or anything like that. I've been using Vim as my console-editor of choice for a couple months now (for editing configuration files while in my terminal), but I don't think I could stand it for my normal, every day work of writing web applications, which I do with a GUI text editor (which one isn'...

How is VIM's undo tree used?

This answer says: Vim's undo/redo system is unbeatable. Type something, undo, type something else, and you can still get back the first thing you typed because Vim uses an undo tree rather than a stack. In almost every other program, the history of the first thing you typed is lost in this circumstance. This is the first I hear of ...

Is it possible to call :make in vim in linux without showing the shell

I've been trying to experiment with using :make recently but I don't like that vim has to switch to showing the shell output first and require one enter keypress, then it shows me what I think is a list of the collected errors based on 'errorformat' which I also need to confirm by pressing enter. I would prefer to just have a short "OK" ...

Hiding, showing, and applying functions to only visible lines with ability to restore in VIM?

I have an editor I am attempting to emulate that has some very nice features. One feature of the editor is to hide lines of a file (similar to a fold but without decorations) and apply commands operations only to those lines which remain visible. The hidden lines can then be brough back. For example the user sees Smurf Apple ...

Vim: Key map bindings to open Firefox in background

" Open firefox - maps to Option|Command|f map <M-D-f> :!/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P dev The above works but blocks in Vim. I want to do: map <M-D-f> :!/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P dev & but Firefox does not open. Any suggestions on creating a key binding f...

VIM: Scrolling down both parts of a split-window at the same time ?

Hi, I would like to know whether it's possible to scroll down the left and right parts of a vertically split window in vim ? I have 2 files I would like to compare roughly... Each line of these files looks almost the same... thanks ...

Vim smartindent problem

In vim with smartindent on: press enter after say a if statement type in { press enter twice type in } if you hit up and go to the previous line, indentation is removed from the blank line. Even the vim documentation says that "If you do not type anything on the new line except <BS> or CTRL-D and then type <Esc>, CTRL-O or <CR>, the...

Fast 'Find in Files' for VIM?

What are some options for getting really fast 'Find in Files' searching in VIM? Our codebase is large enough that searching needs to work off an index. grep/vimgrep/etc are too slow. Indexing doesn't need to be particularly fast; I can index overnight. Thanks, [EDIT] I'm also working in a Windows environment. ...

Search and replace on Eclipse

What's the syntax to perform a search/replace on Eclipse and use "match groups" ( is that it's name? " On vi I: %s/log(.*)/log \1 debug/g And lines like: log "Message" are replaced with log "Message" debug What's the correct syntax for eclipse in the search/replace dialog box ( beside checking up "Regular expressions" ) Than...

Disable warning in VIM?

Is there a way to disable warnings in VIM? In particular, I want to disable Warning 12 when a file turns from read-only to writable. I have a script which opens the file for edit in perforce, but vim thinks the file has changed and issues a warning. Thanks ...

Diff two tabs in Vim

Scenario: I have opened Vim and pasted some text. I open a second tab with :tabe and paste some other text in there. Goal: I would like a third tab with a output equivalent to writing both texts to files and opening them with vimdiff. Currently I the close I can find is "diff the current buffer against a file", but not diffing two open...

Can I view the doc string of a function in Python using VIM?

Is there any way to view a function's doc string when writing Python in VIM? For instance: def MyFunction(spam): """A function that foobars the spam returns eggs""" return foobar(spam).eggs() I'd like to be able to type MyFunction(spam0) and see the doc string, either as a tooltip or in the status bar or any other way th...

Vim: Stop "existing swap file" warnings

I have no idea why, but it seems that no matter how I quit out of Vim, it always leaves the swap files behind. So, whenever I open that file again, I get an irritating error about an existing swap file. Every time I have to choose "delete". I really wish this would stop. Is there anything I can put in my .vimrc to tell it, "just delete t...

vim: how to convert all text to lowercase

Hi, How do you convert all text in vim to lowercase? Is it even possible? Thanks, Kenneth ...

Way to use vim work on a cache of a file instead of the actual file?

I typically ssh to another computer to do my development, using vim (don't post "Use Emacs" please). However, I notice that vim is very slow when my internet is slow (duh). EDIT: I use a terminal on my local machine and open the remote file with a vim scp://host/file command. However, when I do this, every keystroke that I put in causes...

How do I actually use the value of an argument to a Vim function?

I'm trying to write a simple Vim function that takes the name of a file as an argument and reads the contents of that file into the current document (related to this question). Here's my first stab at it: fun! Tpl(tplfile) r c:\tpl\a:tplfile endfun That just gives me the following error: E484: Can't open file c:\tpl\a:tplfile ...

MacVIM Syntax file for CS

I am using MacVim to convert cs files to HTML. The convert function works fine. However, I don't like the default syntax highlighting for cs. I understand that the cs syntax file in at /Applications/Vim/MacVim.app/Contents/Resources/vim/runtime/syntax/cs.vim, Maintainer by Anduin Withers. Not sure if there is any other way to substitute...

^M at the end of every line in vim

When I am editing source files using vim and other editors sometimes at the end of the line I get these ^M characters at the end of each line. I think that it has something to do with editing a file in windows and then in linux. How can I remove all of these automatically? ...

remove messy leading whitespace in VIM on OSX

Hi, I am copying code from website matplotlib and pasting into the vim editor in a terminal on OSX: [(http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_demo.html)][1] While this works fine in bbedit: `from pylab import figure, show, rand from matplotlib.patches import Ellipse NUM = 250 ells = [Ellipse(xy=rand(2)*10...

Eclipse is Ugly (from a recovering vim user)

So, I'm finally taking the plunge to using eclipse from vim ... but I'm having some serious issues getting over the incredibly cluttered interface and menu system. Example: right clicking in the main text area yields a submenu with ~30 items... The whole eclipse environment seems cumbersome and rather ugly. I've painstakingly changed t...