Hello.
I'm using vim -d file1 file2 in order to see they difference. All works fine, but i want to ignore whitespace changes - they are irrelevant for source code files. vim help states that following command will do the magic:
set diffopt+=iwhite
But, unfortunately, this command only adds '-b' to diff tool command line, that only ig...
Ok, have a very specific setup question. I'm using Mac OS X, iTerm, and vim. I really like using my mouse for clicking tabs in normal mode, scrolling in normal mode etc. (e.g. I already have the mouse working within iTerm/vim).
However, I dislike using visual mode for selecting. I just want to use OS X selection not vim's visual select...
How would you go about marking all of the lines in a buffer that are exact duplicates of other lines? By marking them, I mean highlighting them or adding a character or something. I want to retain the order of the lines in the buffer.
Before:
foo
bar
foo
baz
After:
foo*
bar
foo*
baz
...
I wrote
set tw=0
into my .vimrc file.
But when I verify options with
:set
it's still
textwidth=78
Why ?
...
How can you switch your to current windows from horizontal split to vertical split and vice versa in Vim?
I did that a moment ago by accident but I cannot find the key again.
...
I open many files to Vim by
vim a/*.php
This opens 23 files.
I made my edit and run the following twice
:q
It closes all my buffers.
How can you close only one buffer in Vim?
...
I like cindent, smartindent and =% features in vim, which properly indents the code.
But, I have one problem with this, it indents everything with 8 spaces, and if I have few nested ifs, it can be very long line like here, though having so many nested ifs in first place is another question.
4 int main()
5 {
6 if(x)
7 ...
I get the following 10X times a day by accident.
Entering Ex mode. Type "visual" to go to Normal mode.
How can you disable the combo which causes it in Vim?
...
What is the most efficient way to swap two params for a method call in Vim?
For example, I want to change:
call "hello mister 123", 2343
to:
call 2343, "hello mister 123"
(Assume the cursor is at the beginning of the line.)
Ideally the trick works for stuff like
call "hello, world" , "goodbye, world"
...
the command to Refresh file from version on disk is
:e!
How can I do the same on all files in the buffer
Background.
I need that because I am using git with multiple branches with one vim open that contains a buffer. When I checkout to a branch, I would like to have vim to refresh.
...
Say I have a super long line in the VIM editor (say around 300+ characters). How would I break that up into multiple lines so that the word boundaries roughly break at 80 characters?
Example:
This is a really long line This is a really long line This is a really long line This is a really long line This is a really long line This is a...
How can I open in a split window multiple files. One split for each file if I'm not being clear.
I want to do something like. :sp app/views/*.erb and have the ~7 files all open in their own split windows.
...
Using Vim, I'd like to be able to replace preVARIABLETEXTpost with VARIABLETEXT in a single command. The reason is that pre and post might exist elsewhere in the file, and VARIABLETEXT changes.
Something like:
:%s/preGRABTEXTpost/GRABTEXT/g
Essentially I'm trying to strip pre and post when it exists with some text between them on ...
How can you put a list of files to Vim's -o -mode?
I have a list of files as Grep's output.
I run unsuccessfully
1
grep -il sid * | vim -o
2
grep -il sid * | xargs vim -o
3
grep -il sid * | xargs vim
4
vim -o `grep -il sid *`
5
vim -o | grep -il sid *
...
Hello there,
Is there a way to go the end of a Ruby block using vim? For example
module SomeModule
# <Supposing that the cursor is HERE>
def some_method
end
end
I want to go from where the cursor is, to the end of the block with one command, is that possible?
I've read this documentation, but it doesn't seem to work on .rb ...
I've been using JSLint, I was wondering if there were any sort of syntax checkers I could use for ECMAScript/JS and possibly other languages so if I do something like :check or :syntaxcheck and it would point out the first or even multiple syntax errors ( which I hopefully don't have ).
...
I'm learning new commands in VIM all the time, but I'm sure everyone learns something new once in a while. I just recently learned about this:
zz, zt, zb - position cursor at middle, top, or bottom of screen
What are some other useful or elegant commands you wish you'd learned ages ago?
...
I have text file:
gvim file.txt
In UNIX you can type this at any command prompt. If you are running Microsoft
Windows, open an MS-DOS prompt window and enter the command.
In either case, Vim starts editing a file called file.txt. Because this
is a new file, you get a blank window. This is what your screen will look
like:
...
I like that vim 7.0 supports spell checking via :set spell, and I like that it by default only checks comments and text strings in my C code. But I wanted to find a way to change the behavior so that vim will know that when I write words containing underscores, I don't want that word spell checked.
The problem is that I often will refer...
For example, I currently have this:
set iskeyword-=_
This has the effect of making this work:
foo_bar
If cursor is on "f", pressing w moves cursor to the underscore. Pressing again moves to the "b" in bar. This is the desired effect for movement, but has the undesired side-effect of breaking completion. Same story with CamelCas...