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
1answer
29 views

How to perform search and replace in vim in reverse?

I need to perform a search and replace regex in vim of the style: s/search/replace/g However, I need to do this in reverse, from the bottom of the text to the beginning.
0
votes
2answers
26 views

In vim, why is it :-1j to join with the line above?

In vim, why is it :-1j to join with the line above? e.g. :g/^ /-1j to join all lines that start with a space. The commands are easier to remember when you understand how they come about and in this ...
0
votes
1answer
16 views

how to save changes to config directory

I'm trying to save changes to a /var/www/ config directory for my virtual server. I hit Ctrl X and am now in "X mode" but my Putty is unresponsive. What can I do to save these changes and exit?
0
votes
0answers
23 views

Sublimetext 3 Vintage - Insert multiple lines with Open command

With open command you can insert a new line above or below the current line. Is there a way to insert multiple lines? I've tried 2o 3O 2\o 2\o but it doesn't work.
0
votes
2answers
36 views

Highlight cursor after changing buffer in vim

While using vim I have trouble finding my cursor quickly after entering another buffer, especially if I have many splits open. I fixed this by writing a function which is called by an autocmd when a ...
0
votes
0answers
18 views

Syntax highlighting in .vim for python segments files on windows

I use python a lot in my vimrc. On my linux machine it correctly highlights segments of code between func! VIMSCRIPT_FUNC_WITH_PYTHON() python << endpython import vim ...
1
vote
1answer
22 views

How to send commands from a file to VIM?

This is the content of cmd.txt: :w 2.txt :q In command line, I do D:\>vim 1.txt<cmd.txt I expect cmd.txt as input stream (rather than my keyboard) and vim will save 1.txt as 2.txt and ...
0
votes
1answer
24 views

VIM - How to select a substring

I have the following line, that has no spaces - 123456789abcdefghij01234123456780900dfasdfsadfsadfsa I want to select (highlight for yanking) 10 characters, starting at column 10. I can ...
1
vote
1answer
22 views

Possible for vim marks to point to the character to which they are originally set instead of the character's original line/column location?

Is it possible to make vim marks (e.g. mm) point to the character to which they are originally set instead of the character's original line/column location? For example, if I type mm on the first ...
0
votes
2answers
36 views

Give active split all of screen besides 5 lines for inactive splits

edit Answer provided I'm trying to split my window in vim by running the following: :sp The desired behaviour I'm trying to achieve is to limit the inactive split to five lines while giving the ...
1
vote
2answers
31 views

Can I Soft-Link files from my desktop to a server in Linux

I am looking for creative ways to sync my vim files (~/.vimrc, ~/.vim/) on the server I am running. Can I soft-link files from my desktop machine (Fedora) to any of the nix servers I am on?
0
votes
2answers
28 views

Add quotes to large number of words in vim

So I created a large number of javascript objects with literal syntax and I forgot to use quotes for the keys of many, many key value pairs. How would I devise a regex to "add single quotes to any ...
2
votes
1answer
20 views

Vim marks and US international keyboard

I use a US-international keyboard so that pressing 'a produces "á" while on insert mode. However, I would like to access a mark named a by pressing 'a under normal mode. That doesn't work and as a ...
0
votes
1answer
29 views

How can I edit the identical part of multiple files at once?

I have multiple HTML files that form a small website. Several lines of code are duplicated at the top of the files (although the <title> differs), and a few lines are duplicated at the bottom. ...
0
votes
2answers
25 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 ...
4
votes
1answer
61 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 ...
6
votes
2answers
541 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: ...
2
votes
0answers
35 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, ...
0
votes
0answers
10 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
22 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 ...
0
votes
1answer
48 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 ...
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
17 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
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 ...
1
vote
1answer
15 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
20 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?
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
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. ...
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
25 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?
0
votes
3answers
154 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");
0
votes
1answer
15 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 ...
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 ...
1
vote
1answer
31 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
56 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 ...
1
vote
1answer
17 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
23 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 ...
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 ...
1
vote
3answers
31 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 ...
0
votes
1answer
36 views

Vim line numbers in insert mode

For some reason, Vim (gVim for Windows) turns off the line numbers when I enter insert mode. This can be rather jarring, because it shifts all the code to the right or left when I leave or enter ...
1
vote
1answer
24 views

Doesn't “scrollwheelup/down” mapping work in gvim on windows OS?

I tried it all ways to make the mouse buttons ScollWheelUp/Down work in my vim. Checked in all other plugins if there is a conflicting map, no conflicting map. Tried this: :verbose map ...
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?
0
votes
1answer
27 views

Get hotkey to type a random number as if I typed it on a keyboard on Windows?

In many cases I need to not just generate a list of random integers (which is easy), but to type random integers into various software. For example, to skip a random number of lines (1 to 100) in ...
1
vote
2answers
37 views

Adding an abbreviation for spaces in vim

I am trying to add the following abbreviation in vim, but its not working. noreabbrev <space><space> .<space> Its just like in most modern phones keypad. so can someone tell ...
0
votes
1answer
25 views

Going from insert to normal in vim causes this to appear

Whenever I go from insert to normal mode, this shows up at the bottom of my vim screen. What is it and how do I stop it?
1
vote
1answer
26 views

Vim highlighting between editing sessions

Is there a way to disable vim from carrying highlighting between editing sessions? For example, I was looking for the definition of pi (M_PI) in /usr/include/math.h and searched /PI to find ti real ...
1
vote
2answers
26 views

Vim assembly formatting

Vim is not properly indenting assembly code, regardless of if I want it to do it automatically or if I try gg=G it'll just says ## lines indented even though it didn't change anything and all my text ...
0
votes
0answers
47 views

Vim YouCompleteMe

I see that the vim plugin YouCompleteMe is a great autocompletion tool but is there a way to get it to complete not just from a file I am working on but external files as well? Like, if I go to type ...