Is possible to insert a linebreak where the cursor is in Vim without entering into insert mode? Here's an example ([x] means cursor is on x):
if (some_condition) {[ ]return; }
Occasionally, I might want to enter some more code. So I'd press 'i' to get into insert mode, press enter to insert the linebreak and then delete the extra spac...
Hi
I want to read line n1->n2 from file foo.c into current buffer.
I tried :147,227r /path/to/foo/foo.c
But I get "E16: Invalid range",
though I am certain that foo.c
contains more than 1000 lines.
Thanks
Aman Jain
...
Hi
While surfing, I came to know that somebody has done Tower of Hanoi using vim. WOW!!!
Can you people share what all cool things you have been doing in vim.
Thanks
Aman Jain
Edit: Not sure about the Tower of Hanoi solution using vim being all that useful. But I think this question should be re-opened to allow people to comment on ...
How can I use vimdiff to view the differences described in a diff file?
...
By default, I think my vimrc setttings enable the auto-wrapping. However, sometimes, I would like to see text lines are not wrapped. Is there any command I toggle the text line wrapping enabled and disabled? This would avoid me to exit and to change settings.
...
I use _vimrc to configure my vim 7.2 (windows) default settings. One setting "set number" will display line numbers on the left side. My vim background color is white (I cannot find setting for this. Maybe the default is white. Anyway I accept this setting).
I would like the background color for line numbers to be Grey or dimmed color. ...
I like vim's visual mode. v for highlight/select chars or lines, Ctrl-v for rectangle highlighting, as far as I know (I am a beginner). Is there any way to use visual mode to highlight last two chars, for exmaple, on each line for some selected lines? The selected lines are in different length. Basically, I would like to find a quick way...
How can I add line numbers to a range of rows in vim? Not as in ":set nu" - this just displays numbers, but doesn't add them to the file.
...
I'm addicted to vim, it's now my de facto way of editing text files.
Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing java apps.
Some questions I have:
How do I invoke a maven task without leaving vi
Can I get code completion?
How's the syntax highlighting?
Anythi...
In vim, how would I go about inserting characters at the beginning of each line in a selection? For instance, let's say I want to comment out a block of code by prepending '//' at the beginning of each line (assuming my language's comment system doesn't allow block commenting like /* */). How would I do this?
...
Hello,
I use vim (7.1) on OpenVMS V7.3-2.
I connect to VMS trough a telnet session with SmartTerm, a terminal emulator.
It works fine.
But when I start a telnet session from a VMS session (connected via SmartTerm) to another VMS session, some keys doesn't work properly.
|--------------| telnet |-------------| telnet |-----------...
While using Vim (at home and at work), I often find myself doing similar things repeatedly. For example, I may turn a bunch of CSV text into a series of SQL inserts. I've been using Vim for years, but only recently have I tried to seriously think about how I could improve my productivity while using it.
My question is.. Is there a good ...
I thought I'd have a try at using Win32 GVim, and I'm finding that it's much more versatile than I realised. At this point I'm finding that for myself a lot of its features are still hidden. As an example I'm used to having a button on the toolbar to run external commands and capturing the output but I found in Vim it's :%!<command> to g...
I am new to VIM. I use e and w commands to edit and to write a file. It is very convenient. I am not sure if there is "close" command to close the current file without leaving VIM?
I know that q command can be used to close a file. But if it is the last file, the VIM is closed as well(actually on Mac the MacVIM does quit. Only the VIM w...
Is there a way to have % in vim find the next ([{ or whatever, even if it is not on the same line?
Example:
int main(int argc, char ** argv) {
#Your cursor is somewhere in this comment, I want
#it to get to the ( after printf
printf("Hello there.\n");
}
...
Does anybody know how I can get diff's color margins in VIM (if it is possible)? I mean something like this: (e.g., in NetBeans: Netbeans color margins). It was very useful when I was working with NetBeans, maybe somebody wrote such useful plugin for VIM?
Thanks!
...
In VIM in command line mode a "%" denotes the current file, "cword" denotes the current word under the cursor. I want to create a shortcut where I need the current line number. What is the symbol which denotes this?
...
I'm setting the below variables in my vimrc to control how windows get split when I bring up the file explorer plugin for vim. But it appears these variables are not being read because they have no effect on how the file explorer window is displayed. I'm new to vim. I know the vimrc file is being read because I can make other setting cha...
Is there a single shortcut to start inserting in the new line at end of the file? I'm aware of G + o combo.
...
Does anybody know how to edit a syntax file for VIM so that keywords are capitalized automatically? I need to do this to keep my coding style consistent with the rest of the developers in my team.
I'm using VIm version 7.2 (actually gVIM) and the syntax file I'm using is the Progress.vim file (installed automatically with VIM under the ...