tagged [vim]

Convert ^M (Windows) line breaks to normal line breaks

Convert ^M (Windows) line breaks to normal line breaks Vim shows `^M` on every line ending. How do I replace this with a normal line break in a file opened in Vim?

How to save the files opened in all windows and tabs in Vim?

How to save the files opened in all windows and tabs in Vim? I’d like to save the files opened in all vertical/horizontal windows? Is it possible without going to each window and executing the `:w!` c...

16 Jan at 06:21

Indent multiple lines quickly in vi

Indent multiple lines quickly in vi It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do I indent multiple lines quickly in vi?

29 Oct at 09:54

What is the <leader> in a .vimrc file?

What is the in a .vimrc file? I see `` in many `.vimrc` files, and I am wondering what does it mean? What is it used for? Just a general overview of the purpose and usage would be great.

16 Apr at 08:21

Why are there so few modal-editors that aren't vi*?

Why are there so few modal-editors that aren't vi*? Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (+ to delete back a word and so on)

21 Apr at 15:52

How to run vi on docker container?

How to run vi on docker container? I have installed docker on my host virtual machine. And now want to create a file using `vi`. But it's showing me an error:

30 Oct at 00:45

How to cut an entire line in vim and paste it?

How to cut an entire line in vim and paste it? I know how to use the `v` command in vim, but I need something which will delete an entire line and it should allow me to paste the same line somewhere e...

7 Jan at 21:59

How to copy a selection to the OS X clipboard

How to copy a selection to the OS X clipboard I have an area selected in Vim. How can I copy it into the OS X clipboard? (The OS X clipboard can be written to via a pipe to `/usr/bin/pbcopy`)

9 Dec at 20:20

How to get the list of all installed color schemes in Vim?

How to get the list of all installed color schemes in Vim? Is there a way to get a list of all installed color schemes in Vim? That would make very easy to select one without looking at the `.vim` dir...

5 Oct at 00:44

How to copy selected lines to clipboard in vim

How to copy selected lines to clipboard in vim How to copy selected lines to clipboard in vim. I know how to do it for [all text files](https://stackoverflow.com/q/1620018/1082727), but I want to do i...

23 May at 10:31

Working with huge files in VIM

Working with huge files in VIM I tried opening a huge (~2GB) file in VIM but it choked. I don't actually need to edit the file, just jump around efficiently. How can I go about working with very large...

21 Jan at 23:33

Jump to function definition

Jump to function definition How can I jump to a function definition using Vim? For example with Visual Assist, I can type + under a function and it opens a context menu listing the files with definiti...

7 Jun at 11:35

How do I close a single buffer (out of many) in Vim?

How do I close a single buffer (out of many) in Vim? I open several files in Vim by, for example, running which opens 23 files. I then make my edit and run the following twice which closes all my buff...

18 Aug at 12:31

How do I list loaded plugins in Vim?

How do I list loaded plugins in Vim? Does anybody know of a way to list up the "loaded plugins" in ? I know I should be keeping track of this kind of stuff myself but it would always be nice to be abl...

7 Apr at 07:29

What is in your .vimrc?

What is in your .vimrc? Vi and Vim allow for really awesome customization, typically stored inside a `.vimrc` file. Typical features for a programmer would be syntax highlighting, smart indenting and ...

25 Sep at 20:50

What Vim command(s) can be used to quote/unquote words?

What Vim command(s) can be used to quote/unquote words? How can I quickly quote/unquote words and change quoting (e.g. from `'` to `"`) in Vim? I know about the [surround.vim](https://github.com/tpope...

16 Jun at 00:1

How do I use vim registers?

How do I use vim registers? I only know of one instance using registers is via whereby I paste text from a clipboard. What are other uses of registers? How to use them? Everything you know about VI re...

25 Jan at 09:33

How can you automatically remove trailing whitespace in vim

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 automati...

How to copy to clipboard in Vim?

How to copy to clipboard in Vim? Is it possible to copy to clipboard directly from Vim? `yy` only copies stuff to Vim's internal buffer. I want to copy to the OS's clipboard. Is there any such command...

31 Mar at 00:28

How to specify a editor to open crontab file? "export EDITOR=vi" does not work

How to specify a editor to open crontab file? "export EDITOR=vi" does not work I'm using Red Hat Enterprise Linux 5, and I want to set the vim editor to edit the crontab file. If I run `echo $EDITOR`,...

2 Oct at 07:20

How I can delete in VIM all text from current line to end of file?

How I can delete in VIM all text from current line to end of file? I have very large files (more than 10Gb). I need only some lines from the top of the file. Is it possible (in vim) to delete the rest...

3 Jul at 12:46

Vim clear last search highlighting

Vim clear last search highlighting After doing a search in Vim, I get all the occurrences highlighted. How can I disable that? I now do another search for something gibberish that can't be found. Is t...

8 Jun at 20:42

set gvim font in .vimrc file

set gvim font in .vimrc file I am using gVim 7.2 on Windows 7. I can set the gui font as Consolas 10 (font size) from the menu. I am trying to set this in `.vimrc` file like below: But it doesn't work...

19 Jul at 21:40

Running Python code in Vim

Running Python code in Vim I am writing Python code using Vim, and every time I want to run my code, I type this inside Vim: This gets frustrating, so I was looking for a quicker method to run Python ...

17 Feb at 10:7

Changing Vim indentation behavior by file type

Changing Vim indentation behavior by file type Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a P...

31 Oct at 09:41