vim

Storing vim settings with a document

Is there any way to save the state of vim settings with a document? To clarify: I'm editing a document and I change a bunch of settings. I don't necessarily recall which; and I don't want to use these settings again, except for the current document. I don't want to manually try to remember what I've changed; or what the magic abbreviati...

How to indent a selection in gvim (win32)?

I'd like to indent a block of text. I am able to do this in the linux build of givm. I do this is the state of gvim where I'm not in the insert or visual mode. The bar at the bottom is blank on the left and the line number, percentage are showing on the right hand side. Then I perform the following procedure: I select a block of text...

ctags best practicies

I'm working on +1M LOC C/C++ project on Solaris (remote, via VNC or SSH). I have a daily updated copy of source code on my local machine too (Windows, just for browsing code). I use VIM and ctags combo (on both Solaris and Windows) but I'm not happy with results / speed. What settings for ctags would you recommend? There are a lot of op...

Vim as Visual Studio IDE

hi Guys I have spent lot of time doing research on VIM. I am Windows guy since last 6 yrs and was using VS. Now started working on Linux. I want to make VIM as close as possible to VS. I want features like Project Navigation Files in Different Tabs Search in Project AutoCompletion I have found plugins for the above requirements Projec...

Schema-aware XML editing in Vim

When editing an XML file in IntelliJ IDEA, if the document references a schema, IDEA will fetch the schema and use the information for auto-complete. It knows which tags are valid in which contexts, so when you hit CTRL-space, it suggests only those tags. It also highlights any tags that are invalid according to the schema. Does anybo...

How do you prefer to switch between buffers in Vim?

I've tried MiniBufExplorer, but I usually end up with several windows showing it or close it altogether. What I'd like is something like LustyJuggler with incremental search, the way I switch between buffers in Emacs. Surely there is a script like this? ...

Can Windows key be mapped in Vim?

Using Windows key as Meta is very useful in Emacs, is there the way to do it in Vim? ...

What Vim features are missing in Emacs with Viper and Vimpulse?

There are important features of Emacs which are missing in Vim, such as the comint mode, and there are no scripts/plugins which can replace them. There are also benefits of Vim over Emacs, such as modal editing and generally better default shortcuts. However, Viper mode gets me both. Vimpulse also enables visual mode. Unfortunately, no ...

Using vim Sessions Only With GUI?

My usage-scenario may seem a bit unusual, but here it is: When using vim (it's one of about 4 different editors I use regularly), I use it in two different situations. The first is via the GUI, in which I'll have multiple buffers and have some settings different than when I use it from the command-line (by testing "if has('gui_running')"...

Vim: NERD_tree Plugin. Need help understanding a bloggers .vimrc addition to streamline this plugin.

So I'm basically a beginner when it comes to Vim, nonetheless I do know the basic things (open files, edit, move around, basic grep, .vimrc, etc) I would submit this link first http://weblog.jamisbuck.org/2008/11/17/vim-follow-up If you scroll down to where it says "NERD___tree", it explains what it is and gives a link to the home pag...

Vim: \n vs. \r

I haven't used vim in a Unix system in a while, but as I recall there was no \r, it was always \n. I'm using gVim under windows and when I search for new line characters I use \n. Searching for \r returns nothing. But when I replace the characters I have to use \r's. \n's give me ^@ Can anyone explain what's going on here? ...

Removing duplicate rows in vi?

I have a text file that contains a long list of entries (one on each line). Some of these are duplicates, and I would like to know if it is possible (and if so, how) to remove any duplicates. I am interested in doing this from within vi/vim, if possible. ...

How to configure vim to not put comments at the beginning of lines while editing python files

When I add a # in insert mode on an empty line in Vim while editing python files, vim moves the # to the beginning of the line, but I would like the # to be inserted at the tab level where I entered it. For example, when writing this in vim for i in range(10): # the # does not stay there where I entered it. It is moved like so, ...

How do I repeat an edit on multiple lines in vim?

I am aware that in vim I can often repeat a command by simply adding a number in front of it. For example, one can delete 5 lines by: 5dd It's also often possible to specify a range of lines to apply a command to, for example :10,20s:hello:goodbye:gc How can I perform a 'vertical edit'? I'd like to, for example, insert a particular...

How can you automatically remove trailing whitespace in vim

I am getting 'trailing whitespace' errors trying to commit some files in git. I want to remove these trailing whitespace characters automatically right before I save python files. Can you configure vim to do this? If so, how? ...

What is the recommended way to use vim folding for python coding

I am interested in enabling code folding in vim for python coding. I have noticed multiple ways to do so. Does anyone have a preferred way to do python code folding in vim? I.e, do you have a particular vim plugin that you use and like? do you use manual folding or do you place markers in comments? any other recommended ways to do c...

How to automatically align python variable assignment lines in vim

I would like to automatically align lines of python variable assignments in vim. For example I would like to change this: a = 1 banana = 2 into this a = 1 banana = 2 automatically in vim. Is there a way to do this? ...

Search for selection in vim

I use vim and vim plugins for visual studio when writing C++. Often, I find myself wanting to search for a string within a function, for example every call to object->public_member.memberfunc(). I know vim offers a convenient way to search for a single word, by pressing * and #, and it can also search for typed strings using the ubiquito...

How can I benchmark editor productivity objectively?

I'm not sure if Vim makes me more productive compared to other editors/ide's like Eclipse for example. But somehow I get an empowering feeling when using Vim and noticed resistance to trying others editors. I've become an Vim addict. Example: As soon a I see some cool feature in an other editor I'm thinking "Vi can do that (i just have...

is it possible to set per-file options for Nedit like you can do for emacs/vim

With VIM or Emacs I can put comments in the file that will be VIM's settings for that file: /* * Local Variables: * mode: C * c-basic-offset: 4 * c-indentation-style: linux * indent-tabs-mode: nil * default-tab-width: 8 * fill-column: 125 * End: * * vim: et:sw=4:ts=8:si:cindent:cino=\:0,g0,(0: */ Can the same be do...