1 #include <stdio.h>
2 int main(int argc, char* argv[]) {
3 int i=10;
4 /* } */
5 return 0;
6 }
If the cursor is on line 2 under '{' and I press the '%' key, the cursor shows
the matching closing brace on line 4 (which is commented out) and not the matching
closing brace on line 6.
Is there any workaround for this?
Tha...
Why does vim create <filename>~ files? Is there a way to disable that?
If it's for backup (or something), thanks but no thanks, I use git so I don't need your silly backup.
Also, these .<filename.with.path.hints>.swp files too.
How do I tell vim not to create those? or at the least to cleanup after itself?
EDIT
wops, duplicate:
...
I have the following use case, my file contents look like this
a
b
c
I want a regular expression to do this
a|
b|
c|
Can you recommend a regex in vim?
...
I use Vim.
I open a file. I edit it and I want to see what I've edited before I save it.
How can I do this in Vim?
...
I need to run tidy in vim, using the usual:
:compile tidy
:make
However, if I'm on an utf-8 file, I get errors that I don't see if I run tidy outside of vim, i.e.,
tidy -e -q -utf8
I get what I'm expecting
TIA!
...
I frequently must correct the following rails code:
assert_equal value, expected
The two arguments to assert_equal are out of order, and should read:
assert_equal expected, value
In vim, what is the most efficient way of going from the first line to the second?
...
I have been searching a solution which puts the fold marks and codes to an external hidden file.
This way you could have permanent folds without extra fold signs.
How can you control folds by an external file in Vim?
...
Does anyone know of a way to get vim to wrap long lines of text such that the position of the wrapped text is based on the indentation of the current line? I don't want to reformat my code, just for it to be displayed prettily.
For instance, if I set my settings so that the line:
print 'ProcessorError(%r, %r, %r)' % (self.file, self.in...
Duplicate: Can I see changes before save my file in Vim?
Is there a way to see the diff of the saved version and the edited version of the same file in VIM?
This is the scenario: I've opened a file, editing something and I went away from the computer due to some work. After sometime I returned back and I forgot what I was editing a...
I am trying to extract the string from a file having following pattern within a line
>------ </
The ----- represents can be any variable length string. The start pattern within a line is > and end pattern </.
Using regex of VIM is command line search possible? and if so could that be printed?
Or will have to write a script?
I am a ...
I often have multiple viewports opened in vim, using the :vsp and :sp commands. After I've been editing for a while, I'll often run the :make command from within vim. When I get errors, vim will then show me the lines that gcc says caused my errors. However, vim will often open the file with errors in another viewport, even if that file ...
I regularly run into C-codes without folding. It is irritating to read them if there is no folding, particularly with long files. How can I fold them?
...
I've added:
set number
nnoremap <F2>:set nonumber!
to my vimrc file. Basically what it's supposed to do is let me press to toggle line numbering but it's not working. What have I done wrong?
Thanks in advance :)
...
ReSharper has a nice feature called "extend selection": by pressing CTRL+W (I think this is the default) repeatedly, you select more and more from your current caret location. First it's a word, then more and more words, a line, inner then outer block of lines (for example an if-block), then a function, etc...
Basically, by pressing the...
I am writing an editor which has lot of parameters that could be easily interacted with through text. I find it inconvenient to implement a separate text-editor or lots of UI code for every little parameter. Usual buttons, boxes and gadgets would be burdensome and clumsy. I'd much rather let user interact with those parameters through vi...
In gvim, is it possible to have multiple rows of file tabs?
That is, instead of showing left/right arrows to navigate around the tabline (for tabs that don't fit into the tabline), it should "start" a new row of tabs.
Thanks in advance.
...
I have tried unsuccessfully to copy the pwd to pbcopy as follows
pwd | !pbcopy
How can you copy your path in Vim's ED editor (: -mode)?
...
HI, Im beginning VIM.
I hate pressing the Esc command, which is a little far in T61, in order to return to command mode. How do I map it to F4?
...
The book "Unix in a Nutshell" discusses about accessing multiple files on pages 572-573. There seem to be very useful commands such as ":e", ":e #", ":e new_file", ":n files", ":args", ":prev" and ":n!". The commands confuse me:
":n Edit next file in the list of files."
":args Display list of files to be edited."
":pre...
I run the following unsuccessfully in Vim's search mode
^(\1) (\2)
I am trying to find lines which two first words are the same in my .vimrc.
How can you search these lines in Vim?
[edit after the first answer]
I found the handy tool
:sort u
How can I compare my 1st version and the subsequent version after the command?
...