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

0
votes
2answers
16 views

Ctrl+TAB is not working in vim with gnome-terminal

I have a serious problem. Usually, the editor I use is vim, though I can't map ctrl+tab action. I wanna switch tabs with ctrl+tab (ctrl + shift + tab). In xterm, this mapping is enabled, and the ...
2
votes
2answers
36 views

Undo paste in vim

I know about u and Ctrl-r for undo and redo. But u takes me back to the last saved state. I want to know how to undo a paste cmd-v. For example, I am typing here bla bla bla, [link to website](here ...
4
votes
2answers
2k views

Use another user's .vimrc and .vim/

I know that I can :source /path/to/some/.vimrc to load my user's .vimrc when running as root, but how can I use the entire .vim/ directory as well? Is there a startup option for using /home/user/.vim/ ...
3
votes
1answer
55 views

Vim can break file permissions?

I was using Vim the other day as usual, when I noticed something strange. Here's what I did: ~$ touch testfile ~$ ls -l | grep testfile -rw-r--r-- 1 username groupname 0 Jul 23 10:00 testfile ~$ vim ...
5
votes
2answers
496 views

Why does VIM show the Unicode code point and not the UTF-8 code value?

Consider this supposed line of code that I found in a PHP blog, note the quotes: throw new Exception(“That's not a server name!”); Those quotes are RIGHT DOUBLE QUOTATION MARK (Unicode code point: ...
38
votes
6answers
19k views

Mac OS X Terminal: mouse support?

Is there a native option (ie. without installing extra soft/package/plugins) to enable mouse support in the Terminal app? Actually, I'm using a lot vim with the option set mouse=a (activating mouse ...
2
votes
0answers
29 views

LC_LOCALE settings interactions between Mac OSX and LINUX via SSH

I have been struggling with the following problem for years now. I have never been able to solve it, and I adopted several workarounds to keep being able to work. However now I can't stand it anymore, ...
3
votes
2answers
836 views

My copy of vim is running extremely slowly when I edit medium to large (eg 1000+ line) files. How can I speed it up?

I'm using a lot of plugins -- perhaps one of them is the culprit. Here is my .vimrc, if anyone is interested: " Character encoding (if this is not set, all manner of hell breaks loose when " ...
0
votes
0answers
8 views

Override default .csl bibliography file with vim-pandoc plugin

I use vim and pandoc markdown with the vim-pandoc plugins (I only use the base and syntax plugins). I would like to change the default bibliography style to a different .csl file so that when I run ...
0
votes
1answer
21 views

vimrc “col <cs>” works but vim complains about trailing characters; colors do not work when using “color” or “colorscheme”

Colors work when adding col elflord to my .vimrc file but vim complains about trailing characters col elflord. Changing the command to color elflord or colorscheme elflord gets rid of the complaint, ...
0
votes
1answer
26 views

Vim Color Scheme Overwritten by a Plugin

I’m trying to set up some prettier highlighting for Vdebug. I had a look at the source, and it says I need to target a DbgBreakptLine (I don’t know what they are called, but it’s the thing you put ...
4
votes
2answers
2k views

Is it possible to make Gnome Terminal show the name of the file I am editting in vim as the tab title?

I often have several files open in vim, each in a different tab. I have to remember which tab has which file open. Is there a way to show this in the tab titles?
0
votes
1answer
35 views

Vundle - Plugins installed but not loading

I've installed vundle on my ubuntu box but when I load vim none of the plugins load. My vimrc: runtime! debian.vim set nocompatible " be iMproved, required filetype off ...
4
votes
2answers
1k views

How do I map <cmd>-<shift>-f to run Ack plugin in Vim?

I'm new to vim and I'm trying to map a key combo for running the Ack plugin found here: https://github.com/mileszs/ack.vim I want to map cmd-shift-f to run the Ack command :Ack. I've added the ...
0
votes
3answers
587 views

Using vim to force edit a file when you opened without permissions

I use vim to edit a file. Sometimes, I forget to have the appropriate permissions. I run vim and the file as a read only file. I can make changes, but I can't actually write the changes. Every once in ...
2
votes
1answer
4k 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 ...
14
votes
4answers
4k views

vim line wrap with indent

Vim/gvim will wrap long lines like this: 000000000000000000000000000000000000| 00000000000000 | 11111111111111111111111111111111| 111111111111111111 | ...
1
vote
1answer
24 views

gvim: visual mode movement broken

This is probably a result of too many plugins but I can't figure out which one. So normally Vj or Vk in normal mode would highlight two lines. The behavior now is this: When V is pressed, the whole ...
0
votes
0answers
15 views

Gvim font loading issue

Possibly related: Gvim displays wrong font when set from _gvimrc, but correct font when set from menus I'm experimenting a weird behavior with gvim (under GNU/Linux) while trying to set up a specific ...
0
votes
3answers
431 views

Vim: Possible to make default split vertical when opening help or file instead of horizontal?

When using :help, it splits the window horizontally and opens the help in the top window. I then need to use ^w L to move the help window to the right. Same thing if use ^w f to open a file under the ...
0
votes
0answers
18 views

vim indentation gets screwed up

I work on a lot of C++ files and it seems that after a while my indentation gets screwed up. I have a function like so. I have :set cindent set. Vim is putting the curly brace under the return ...
0
votes
3answers
440 views

Save terminal tabs, and vim sessions

Is it possible, using terminal in Ubuntu 12.04, to save the session, with all the tabs and everything opened in those tabs, and than reopen it at a later time? My problem is that I have a few tabs ...
1
vote
1answer
14 views

VIM coloring with terminal color rules

In Linux bash shell, we can put colors with something like this: Let's imagine a file color.txt with contents \e[0;31m blah blah \e[0 If we do 'cat color.txt', it will results in blah blah (red ...
0
votes
1answer
11 views

Change current directory using NERDTree

How can I navigate to a file or folder in NERDTree and change the working directory to that folder (or the folder containining the file I'm on). I know it's possible to keep NERDTree in sync with the ...
0
votes
1answer
18 views

Execute External with specific buffer in vim

Say I have more than one buffer opened in different window. How can I execute an external command with a specific buffer as a argument? Say I want to execute :!g++ "buffer no" How to do so?
28
votes
9answers
22k views

How can I get (g)Vim to display the character count of the current file?

I like to write tutorials and articles for a programming forum I frequent. This forum has a character limit per post. I've used Notepad++ in the past to write posts and it keeps a live character ...
1
vote
1answer
26 views

generalized subscripting and superscripting in vim

Using the text editor vim, one can produce subscripted and superscripted numbers by using the digraphs control-k-ns for subscription and control-k-nS for superscription, where n is an Arabic numeral. ...
0
votes
1answer
24 views

Vim switch statement indenting

right now switch statements are indented as follows (automatically). switch case statements I want them to be indented like this, what do I need to changes switch ...
1
vote
1answer
16 views

How can I construct a vim mapping to perform Ctrl-N, but as if iskeyword included '-'?

In Vim, when I'm programming, I often want Ctrl-N to behave as if - were part of a keyword; in other words, have it included in iskeyword. However, I'd like to create a new keymapping for this and ...
-1
votes
0answers
22 views

Vim settings for Linux kernel code development

Now, I know that there are plugins out there that will enable a function to format C code to "Linux kernel" style. But what I am wondering, is what setting can I put in my ~/.vimrc to not have to do ...
0
votes
0answers
14 views

Switch code formatting in all files

I have recently decided to switch my indent style from 1TBS to Linux Kernel style. Is it possible to convert all my files to this?
1
vote
3answers
30 views

Vim tab size when hitting <Tab> and when autoindent applies

I decided to change my tab size from 4 to 2, because why not? Anyone else who wants to look at the code can surely use thier preferences. However, a question. If I hit the tab key, it inserts 2, but ...
3
votes
2answers
281 views

Vim/Cygwin: No linebreaks in :! output

I'm using Vim via MinTTY under Cygwin. When I issue a command like :!ls -la the displayed output doesn't show newlines correctly. It rather just jumps to the virtual column of the next line, where ...
0
votes
3answers
153 views

Vim enclose in quotes

Say I have the following printf(text goes here); and I select "text goes here" in visual mode... How do I quickly change it to printf("text goes here");
1
vote
1answer
38 views

How to use Massren with Vim?

I want to use massren renamer in vim in order to rename files within the texteditor. First, I used this command within Vim to set Vim as default editor for massren :! ...
2
votes
1answer
18 views

Vim append date to end of line

I am trying to write a Vim command to append the date to the end of line. Right now I have the following, and it is not working. nnoremap <F5> "=strftime("%c")<CR>A What's wrong with ...
3
votes
3answers
774 views

In Vim how to delete all words and characters not matching a pattern

I have googled this several times over the years and have not found a good solution so I am giving up and asking. I want to be able to delete all words and punctuations that do not match a pattern. ...
0
votes
3answers
657 views

How do I open a file with vim from cmd?

I'm using windows 7. Unix I can open a file in vi with by using: vi textFile.txt In windows I want to navigate to the folder and type what I have above. What is the best way to go about this? ...
1
vote
1answer
30 views

Vim C line comment function

The following function in ~/.vimrc is to comment out C line, and it works perfectly. function CLC() execute "normal ^i/*\<ESC>$a*/\<ESC>" endfunction But I have two questions... 1. ...
5
votes
1answer
52 views

How can I use vim to view git diffs on Windows?

I want to use vim to view the output of git diff. I am running Windows 8 and I have vim 7.4 installed. I have, for convenience, created an environment variable VIMDIR set to Vim's install directory ...
16
votes
3answers
9k views

How to setup a line length marker in vim/gvim?

Some GUI text editors have a vertical line which serves as line length marker (it helps keeping lines shorter than 80 chars in source code files). Is is possible to have something similar in ...
1
vote
1answer
15 views

Insert a line of text before lines matching a regex in vim

I'm attempting to add a column to an HTML table using vim so I need to add a pair of <td> tags the line before each </tr>. So far I have :186,$s/ <\/tr>/<td><\/td> \n ...
0
votes
1answer
22 views

Setting up Slimv on Windows + Vim / gVim

I intend to learn Common Lisp, and the book I plan to follow has suggested that GNU Emacs in conjunction with SLIME be used. However, I am not particularly fond of the way Emacs runs on Windows, and ...
10
votes
4answers
9k views

Vim colors not working properly in terminal

I'm using gnome terminal, and vim with solarized color theme. When I open vim in the terminal, it's illegible. But when I open a file in gvim, the color scheme works perfectly. Gnome terminal's ...
0
votes
2answers
26 views

How do I view the content of a very large file at position in Linux?

I've got a file containing JSON data that is about 90MB of size and has one line. I need to go to position 99376229. Unfortunately vim and less both crash when I try moving to that column. How can I ...
3
votes
0answers
76 views

Tmux copy mode: stay in copy mode after selection

When using tmux, I often find a need to copy multiple items from one pane or window into another. When those items are located close to each other in a long scrollback buffer, my current workflow ...
0
votes
2answers
45 views

SSH'd (via Cygwin) vim to write to local file

Okay, so I'm trying to solve the problem of getting the contents of a yanked register from a SSH'd session in Vim, to go to the Windows clipboard. Here's the scenario: SSH into development ...
0
votes
3answers
139 views

How to set colors in OS X (Mavericks) terminal?

I want to set the color's palette of my terminal in order to use properly the Solarized colorscheme for Vim (http://ethanschoonover.com/solarized). I understand that i've to modify my .bash_profile ...
0
votes
2answers
22 views

Using Vim's “autocorrect” feature

If I create mappings in vim for autocorrecting ("teh" to "the"), how will it affect Vim's speed? Also, if I were to actually want to type "teh" how would I do it without vim autocorrecting it?
3
votes
1answer
433 views

Vim, how to play without the beeps?

I have started to like coding while listening to music. However this means I can't use vim with the sound off. It seems I get a beep when I press escape, or press : I'm on a Mac, and I love vim and ...