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

2
votes
1answer
28 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
477 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
402 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
25 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
281 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
656 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
15 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 ...
0
votes
0answers
26 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 ...
3
votes
3answers
218 views

Map Ctrl-Shift-V to an action in vi

I want to be able to paste from the clipboard on gVim on Windows using Ctrl-Shift-V, just like in Terminator. However, if I put this on my .vimrc imap <C-S-V> "+gP The shortcut works ...
9
votes
2answers
4k views

How do I only dp or do just the lines, not the entire block in Vim diff?

I'm currently using MacVim (Snapshot 64) "Split Diff by..." menu option. The file is Django's my settings.py from version 1.3.1 to a fresh file from version 1.4. (Open the image on a separate ...
0
votes
0answers
11 views

vim Repeatable Motion that Distinguishes Vertical and Horizontal

I've been looking for a plugin like repmo that can repeat my previous horizontal movement and previous vertical movement separately, and reverse the direction of the motion. (e.g. 5j could be repeated ...
1
vote
1answer
21 views

Get vim to ignore conversion errors when reading file

I have a UTF-16 file with a BOM. I've set fileencodings to: set fencs=ucs-bom,utf-16le,utf-8,default,latin1 However because of one character on one line, vim does not auto-detect UTF-16 and ...
9
votes
3answers
12k views

Configure VIM for copy and paste keyboard shortcuts from system buffer in Ubuntu?

How do I configure VIM for using Ctrl-c to copy and Ctrl-v to paste from system buffer in Ubuntu?
1
vote
1answer
32 views

Display trailing spaces in vim

I would like to have a nice and sweet display of trailing white-space in my terminal vim. This would allow me to remove them before closing the file. I am aware that this question is quite popular ...
1
vote
1answer
45 views

How can I add a fixed amount of time to all “hh:mm” strings in a document?

I have a document that's a transcription of a video interview. The video itself has embedded SMPTE timecode as well as burnt-in timecode (BITC). The SMPTE timecode and BITC correspond to the time of ...
1
vote
1answer
233 views

How to “Edit with Vim” as administrator in Windows?

When you install gvim in Windows, you get a right-click Explorer context menu item: "Edit with Vim". Is there a way of either adding a "Edit with Vim as Administrator", or just changing the existing ...
1
vote
1answer
25 views

Vim NERDTree | Remap '<cr>' to 'go' | open file but remain in NerdTree window

I'm trying to remap Nerdtree keys so that <cr> opens a file but the cursor stays in the nerdtree window. Nerdtree has this capability by default and can be triggered with the g + o key mapping. ...
0
votes
1answer
30 views

How would I write this VIM command for `sed`?

I have a .csv with special characters that are wrecking an import I need to do. In VIM, I discovered away to remove the special characters with : :%s/\r//g This removes ^M from some of my broken ...
6
votes
3answers
3k views

What configuration will let vim show the buffer/filename in the status line even when only one buffer/file is open?

When I have more one one file open in vim (using split-screen), each commandstatus line (the last line in the window) looks like this: filename.txt 73,1 4% ...
1
vote
2answers
33 views

Vimserver on Cygwin

Following to this question, I discovered that I can use --servername <name> and --remote on my console vim executable under Cygwin. So I installed vim-common vim and gvim and I do not have ...
4
votes
5answers
13k views

How do you run Vim in Windows?

I just installed gVim, and tried using the usual "vim myfile.java" technique that usually works for linux to open up a file and edit it. But unfortunately, this doesn't seem to work. I've also tried ...
0
votes
1answer
18 views

Vim mapping characters in insert mode

OK this may be pretty basic question but I just learned how to make custom key mappings. I am trying to make vim automatically "end" two lines lower when typing "class" so I wrote following in ...
1
vote
2answers
68 views

Best way to increment numbers in one line in Linux [closed]

I have one line with lot of entries among which is also time. ('DEFAULT',17,NULL,'2014-07-14 10:30:00','Something','2014-07-14 06:30:00',1),('DEFAULT',26,NULL,'2014-07-14 ...
1
vote
1answer
48 views

Pathogen - only some of vim plugins work

So recently I installed Pathogen along with a few plugins like NerdTree, and Solarized and they both work really well. Today I tried to install Ruby indentation plugin ...
0
votes
1answer
32 views

Command with localleader in gVim

I'm giving gVim a try, among others because it has a neat plugin for todo.txt. That nice plugin in it's readme description demonstrates its usage by saying to do x you should <localleader>x. ...
0
votes
1answer
343 views

Change pythonpath in Vim

I'm using Vim for Python coding. The problem is, that I'm writing in Python 3 and Vim settings contain only Python 2.7 paths. That does not allow me to use plugins (like python-mode) for autocomletion ...
0
votes
1answer
29 views

How does vim know to syntax-color .hgrc?

With syntax on, vim syntax-highlights my ~/.hgrc file. How does vim recognize this file? How can I get vim to apply the same syntax coloring to a differently-named file?
0
votes
1answer
57 views

Configuring function keys in PuTTY for both Vim and Midnight Commander under tmux?

First off, I'm aware that I can use Alt+1 (through 9 and 0) to synthesize the respective function keys (F1 through F10) in Midnight Commander. It has helped me many times, but by default I still press ...
1
vote
1answer
39 views

How to set cursor to after last character in vim?

Why can't I insert at the end of a line in vim if there's no whitespace at the end? Let's take for example my SSH config file: I try to use $, l, e, but I can't seem to get to the end of the word. ...
1
vote
1answer
48 views

Color scheme(s) in Vim not properly working

On Archlinux, using Vim 7.4 (installed with pacman), I tried to use the lucius color scheme. However, the moment I turned it on, all color went away. This happened in the Xfce Terminal emulator under ...
1
vote
1answer
295 views

Solarized Dark + Gnome Terminal + Vim + Vim-Airline

I installed the solarized dark theme for gnome terminal using https://github.com/Anthony25/gnome-terminal-colors-solarized and then with Vundle installed ...
11
votes
9answers
9k views

Vim: execute the script I'm working on in a split screen

I'm working on a small python script, which needs frequent execution in order to debug and further develop. Can I split the vim screen and execute my script on one part with a keystroke?
2
votes
1answer
859 views

Set default editor for crontab -e invoked with sudo

I'm using Bash on Debian Squeeze. I just read this topic: change default text editor for crontab to vim I have exported both variables VISUAL and EDITOR to vim for normal user and for root. And this ...
12
votes
3answers
4k views

cygwin + mintty + vim backspace problem

I have installed vim, mintty via cywin on XP. The problem is when I try to hit backspace in VIM edit mode, the cursor move back a character instead of wiping the previous char. How can I tweak this ...
2
votes
1answer
154 views

How can I tell what command is running on the remote end of an ssh connection?

Tl;dr - how do I find the name of the command (eg $BASH_COMMAND) running on the remote end of an ssh connection? ... My example setup is two tmux vertical panes, LH pane runs a local vim session ...
0
votes
2answers
36 views

How to reload a bak of etc/apache2/httpd.conf in terminal after bad changes made with Vim?

I changed the apache2/httpd.conf through vim in Terminal OS X yosémite as Su and quit saving changes. But in browser, the localhost sent the 403 Forbidden message "you don't have permission access to ...
7
votes
3answers
2k views

Can I get the Vim Ctrlp plugin to ignore a specific folder in one project?

The Vim Ctrlp plugin has a way to globally ignore certain folder names. Eg: let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' However, I have an ignore rule that's specific to one project. I ...
0
votes
0answers
35 views

Vim color schemes and SAS programs

I have a problem that when I open SAS programs (.sas files) in Vim, the colors look very ugly (a mix of white and black background, etc.). Example here: This is how vim looks when I open a SAS file ...
0
votes
1answer
16 views

rename builtin vim command / remove from completion list

If a vim plugin and a vim builtin command share very similar names, is it possible to rename the builtin to something unambiguously different, or otherwise remove the builtin command from vim's ...
1
vote
1answer
14 views

vim - update file history more often

I was wondering if it is at all possible to have vim update its file history more often. For example, if I got into insert mode, and type 20 lines of code, exit, and hit 'u', it undoes everything I ...
0
votes
0answers
12 views

Pentadactyl tabopen all matching links

I'd like to open a whole mess of links, each in there separate tabs. I've got a pattern (here's its as simple as @ to identify all the links. So, i could type F@ and see all the links I want to open ...
1
vote
1answer
38 views

Vim and Vundle error

Errors discovered when processing function vundle # scripts # complete .. <SNR> 47_load_scripts: line 7: E15: Invalid expression: E15: Invalid expression: Errors discovered when processing ...
2
votes
3answers
99 views

Notepad++/other editors: How to view same file in multiple columns with auto scrolling?

Is there any editor that allows me to have two columns, where the second column picks up after the last line of the first column? I don't mean cloning like in Notepad++ where I have two open copies of ...
0
votes
1answer
37 views

Solarized color scheme did not come out as expected after installation

After I install solarized, the background color didn't come out as expected. vim uses terminal black background instead of using solarized's blue background. My terminal is also set to ...
0
votes
0answers
9 views

Generate octave.info file to include documentation on additional installed packages

I use vim to write GNU Octave scripts and I have included the line autocmd FileType octave setlocal keywordprg=info\ octave\ --vi-keys\ --index-search in my .vimrc file which enables me to use Info ...
0
votes
1answer
33 views

Mutt: let vim handle syntax highlighting when viewing plain text attachment

I use mutt for e-mail and I let vim handle plain text attachments. In my ~/.mailcap I have text/plain; view %s ; needsterminal That works fine, but it removes all syntax highlighting. I often ...
0
votes
1answer
23 views

horizontal scroll binding in vim

I'm using VIm 7.3 to edit 5 files side-by-side with vsplit, set scrollbind and set nowrap, it's quite useful, works well for vertical scroll, but the horizontal scrolling don't be sync. There is a ...