Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

learn more… | top users | synonyms

7
votes
4answers
1k views

bulleted lists for plain-text documents in Vim

While Vim supports automatic indenting in lists, the default setting only covers ordered lists, starting with digits, such as: 1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do ...
0
votes
2answers
30 views

Move cursor from the beginning of a highlight to end of highlight

I have the following sentence: I want to add api restriction to MsrestHandler and RESTHandler. ~ (~ indicates the cursor position) I want to change MsrestHandler to MsRESTHandler. Because ...
0
votes
1answer
14 views

How to efficiently delete the first N characters in each line in a paragraph without using visual mode in Vim?

In vim, is it possible to delete the first N characters in each line in a paragraph without using visual mode or using dot command multiple times? Convert www.some_website.com www.some_webiste2.com ...
0
votes
0answers
14 views

vim syntax highlight export to HTML ignores highlighted search results

I would like to export highlighted code from vim to HTML including highlighted search results. Using :TOhtml works fine, however it omits the search highlights. So, how can I export the highlighted ...
15
votes
4answers
16k views

how can I check which version of vim I have installed?

I'm running Mac OS X Snow Leopard. How can I check which version of vim I have installed? Ideally I'd like to know a general solution for checking software versions via the command line.
0
votes
0answers
24 views

Scrolling with trackpad/mouse in screen on OS X Terminal

I use screen command on Terminal on OS X. When I want to scroll up I change the mode to Copy Mode by pressing Ctrl A Esc. Then I use my trackpad to scroll up/down. It works. However, sometimes ...
0
votes
0answers
7 views

How to install vim-pandoc plugin on Windows (s:python.cmd . import vim_pandoc.bib.vim_completer)

I installed vim-pandoc into a recent install of Vim on Windows 8.1. When I open a Pandoc markdown file (that I made with Sublime Text 3) I get the following messages. This occurs whether or not I ...
0
votes
1answer
18 views

Extend vim's syntax highlighting for only *some* files?

Our software has many .xml configuration files. Vim colors these files, using e.g. /usr/share/vim/vim74/syntax/xml.vim. But can we customize the coloring for just these files, and not for all .xml ...
0
votes
0answers
15 views

Vim: use tab key for autocompletion with Autocomplpop plugin

I'm using basic autocompletion in Vim along with the Autocomplpop plugin, which automatically shows available completions when I start typing. Once I've typed enough to narrow down the list to the ...
1
vote
3answers
210 views

Vim: quit if buffer list is empty

I'd like :bd and :bw to actually quit my vim session if, after the current buffer is removed, the buffer list is empty (i.e. if, before executing :bd or :bw, I only had the current buffer in the ...
6
votes
4answers
2k views

How can I test for plugins and only include them if they exist in .vimrc?

In my .vimrc I am trying to use ftplugin and obviously use some commands relating to that under the assumption that it was loaded successfully. However, I have now encountered a few old machines that ...
3
votes
1answer
340 views

NERDTree: open file in current window?

When I open a file in a NERDTree buffer that was created by opening a directory, when I press <CR>, it opens the selected file in the current window unless the file is open in another window, in ...
3
votes
3answers
4k views

Vim Solarized dark theme looks weird on iTerm2

I just installed the solarized colorscheme following instructions on the project's page. This is what it looks like now: which is not like those screenshots on the official page. Any idea how to ...
0
votes
1answer
16 views

Kompozer and bootstrap

I am hoping to write my first webpage in bootstrap and, in the past, I have done this using only commandline (vim) and then seeing how it looked in a browser, but I know this is rather archaic and I ...
0
votes
0answers
10 views

vim: virtual edit doesn't extend past last line in file

I have the following in my vimrc set ve=all. When I want to move my cursor past the last line of the file, I cannot. Virtual edit seems to disallow motion past the last line. Is this just a ...
-1
votes
0answers
19 views

bash does not recognize syntax or filetype command from .vimrc on Mac 10.10.3

I am running OS 10.10.3, and when I add syntax on or filetype plugin indent on into my ~/.vimrc, i get: [ross@RossMac pic]$ source ~/.vimrc -bash: filetype: command not found -bash: syntax: ...
-1
votes
0answers
11 views

Square “separators” in vim-airline?

So, I just installed vim-airline as part of a set of packages on my Linux Mint 17.1 machine, and I'm getting some weird behavior with my setup. I know that the separators between the sections of ...
0
votes
0answers
17 views

Links browser and Vim together

I've been reading bloomberg.com/whatiscode and its a long webpage. I also recently started using Vim. At the moment, to take notes, I copy paste some parts of the webpage onto a text file. I would ...
0
votes
1answer
18 views

Vim disable the display of accents in latex file

I have a problem when writing with vim in a .tex file. When I type, for example : \`e I automatically get : è Which I would like to disable, because it is really annoying when writing, the ...
0
votes
2answers
22 views

vim/gvim command line switches?

I've just spent 1/2 hour trying to find a list of command line switches for vim. Since vim is a "command line editor" a search on "vim command line ..." is not very useful. I got curious trying to ...
276
votes
3answers
80k views

How do you reload your .vimrc file without restarting vim?

Can you edit your .vimrc file in vim, and reload it without restarting vim?
1
vote
2answers
111 views

Why doesn't vim always give me the option to delete a swap file?

If I restart vim after a crash, it'll tell me that a swap file for my file exists, and ask me what to do--open anyway, recover the file, quit, abort, etc. Sometimes it gives me the option to delete ...
4
votes
3answers
1k views

How can I automatically adjust the Gvim/MacVim window to the width of my vertical splits?

My overall goal here is simple, but the specifics are complex: I want to maintain each vertical split in my MacVim window at exactly 115 columns, regardless of how many splits I add. The story: I’m ...
0
votes
1answer
7 views

Vim let cursor sit on newline

Is there a way to let the cursor sit on a newline in Vim, similarly to the default behavior of Emacs? When you delete a character in the middle of a line, the character gets removed and the cursor ...
5
votes
4answers
2k views

Is it possible in vim to create a split view for command line use?

I know about the option :!ls, but I would like to use one of the splitted interface ( after is used :sp) as a command line window. Is this possible? If it is, how do I do it?
1
vote
1answer
35 views

Vim prompting file has changed after git pull

My work flow involves editing many files in vim, and occasionally I will do a git pull --rebase, which may or may not actually change the files I am editing. However, after such a rebase, vim will ...
1
vote
2answers
859 views

'abort: no repository found' when trying to install Vim through Mercurial

I'm new to Linux (which I'm setting up to start teaching myself web development). I am installing Vim, and in order to do so installed Mercurial. hg clone https://vim.googlecode.com/hg vim seemed to ...
0
votes
1answer
21 views

Tear off tabs in GVIM just like chrome or firefox

Is there a way to move tabs to a different instance of GVIM? I'm looking for something similar to how most web browsers function. When you drag a tab out of its current window, it either creates a new ...
1
vote
2answers
3k views

My vim plugins are not loading

I am on a Mac. I want to install vim plugins. The problem like always is that after following exactly the instructions on https://github.com/tpope/vim-pathogen the plugin fugitive will not load. I ...
0
votes
2answers
199 views

MacVim always return focus to terminal upon leaving

I'm running Mavericks and I recently started playing around with sshfs to try to boost my productivity by using MacVim (I've been using in-terminal vim for a few years now). I really like MacVim. I ...
0
votes
3answers
2k views

“.ssh/config” E212: Can not open file for writing

I'm new to linux. I downloaded an image of ubuntu 12 for VirtualBox and I want to configure the .ssh/config file to access via ssh to an application in development. I access /home/ubuntu folder and I ...
4
votes
5answers
497 views

How do I format code from the web using Vim?

For example, to render: while (head == tail) { head++; a[head] = 0 } into while (head == tail) { head++; a[head] = 0 }
0
votes
1answer
7 views

How do I go to top window in NERDTree for Macvim?

I've googled around a lot but I can't seem to find the solution for this. I want to switch to upper or bottom window using shortcut. Currently, I'm using Ctrl+w w but the command is switching around ...
0
votes
0answers
12 views

Scroll when vim displays too much text

If you enter :function in vim, a bunch of text scrolls past the screen. Is there any way to look through it? I don't care about the specific output of :function.
0
votes
3answers
2k views

Change menu/ui language of vim to english

I search on google and I read several answers but I am unable to change the menu/ui language of vim to english. Im my .vimrc I have set langmenu=en_US.UTF-8 language messages en_US.UTF-8 but it ...
8
votes
2answers
834 views

gvim redraw failure

I have a problem with gvim where the screen redraw partially fails. It's hard to explain but when I open a text file and page down or up the entire text file is not redraw properly. I have to move the ...
0
votes
2answers
44 views

Apply full vim colorization for bash scripts that have no shebang line

So in my project there are many bash script files that are sourced, but never run directly, so they get no shebang line and no execute bit set. Vim colors them a little bit, but doesn't use the full ...
22
votes
6answers
9k views

How do I edit an existing buffer in a new tab in vim?

Suppose I have started vim like this: vim foo bar Now I decide that I want each of those files in its own tab. Is there a way to do that without exiting vim and adding the -p option to my command ...
2
votes
1answer
26 views

How to give count to a Vim command line command (like :insert, :normal, etc)

In Vim as probably all of you know it is possible to give a count to commands in "normal mode" by preceding them with a number. Like for example 4dd that will delete 4 lines. I am wondering if there ...
0
votes
1answer
32 views

Vim in xterm : Mouse cursor not changing based on mouse mode

When I use vim with gnome-terminal or yakuake, and I have mouse on ( set mouse+=a ), then I see an arrow as mouse pointer, and when I have mouse off, then the "insert" sign as mouse pointer. However, ...
1
vote
2answers
476 views

Automatically detect and use indentation style of current file

I work on several projects that are using different indentation levels (2 spaces / 4 spaces / tabs...). Is it possible to make Vim automatically detect the indentation style of the current file and ...
2
votes
3answers
398 views

Is it possible copy text from vim to a system buffer?

I want to copy text from vim, eg. by selecting in visual mode, then ctrl+insert and I'd like to have the copied text in system buffer, so I can paste it anywhere I like with eg ctrl+v. Is it possible ...
0
votes
1answer
24 views

Can I “properly” run a vimscript in the background?

I'd like to run a peice of vim script in the background (preferably on windows, although if it only works on *nix, that's ok too) The idea would be the following: User calls vimscript function ...
2
votes
3answers
277 views

Why does the 'vi' command open 'vim' editor?

I am using Ubuntu 12.04. Not that I am complaining as I like my vim and prefer its many features. However, I’m curious as to why it does it. It is not aliased in .bashrc or .bash_profile. I am not ...
3
votes
2answers
651 views

Vim indent in LaTeX align goes crazy

I start with the following in a LaTeX document: \begin{align*} u(x, t) &= \frac a2 \int_0^t \dif s \int_{x-a(t-s)}^{x+a(t-s)} \dif y \sin(\omega y) \\ \end{align*} Then I go on and enter ...
4
votes
3answers
2k views

How can I add some padding to the macvim text area

I would like to add some padding between my text and the left edge of the window (or the right edge of the line numbers).
1
vote
0answers
14 views

How to get par formatter to not mangle paragraphs with non-space character prefixes, suffixes?

I can't get the par formatter to do what I want, specifically with automated prefixes and suffixes. Details: My .vimrc excerpt: set formatprg=par\ -w72reqh map t gqip This example input-to-par ...
2
votes
1answer
5k views

How do I set up neocomplcache?

I just started using vim and saw a cool plugin: neocomplcache. My problem is that I can't get it to work properly. After installing, I took the example config from the help files of neocomplcache and ...
0
votes
0answers
25 views

Special characters are not displayed in terminal and vim

I'm using redhat release 5.6 (Tikanga). Recently I installed a patched font that support some special characters. I'll describe what I did. Installed the font in the ~/.fonts directory Run fc-cache ...
3
votes
2answers
226 views

Autoformat for Perl in Vim

I got a piece of code about perl: if ($a==1){ &err_report("$a"); while($b!=1){ &err_ok(); } } And, I want to format it in vim. After using command: gg=G, the code ...