vim (Vi IMproved) is a text editor supporting different editing modes.

learn more… | top users | synonyms

0
votes
0answers
25 views

vim frequently does not display text

My vim frequently does not display (some) text in terminal. It just shows blank area. If I attempt to select (either through mouse or keyboard), the text would appear. The issue is more severe in ...
3
votes
2answers
43 views

What is the problem of giving the right to use sudo vim? [on hold]

I'm using Mac OX 10.10. I would like to know what problems are caused by this: user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf I think this is in /etc/sudoers. I also have Cent OS. Does this ...
3
votes
1answer
263 views

How do I use ctags functionality in vim with cscope installed?

When I install cscope by adding the line Bundle 'chazy/cscope_maps to my .vimrc file, my tags menu (g+[) is replaced with a cscope list, which seems to contain a list of files where the tag is called, ...
0
votes
1answer
12 views

Not all Vim Text Transparent

I am using the following commands after setting the color scheme to make my vim transparent: highlight Normal ctermbg=none highlight NonText ctermbg=none highlight SpecialKey ctermbg=none However, ...
0
votes
1answer
8 views

how to locate vim which installed by brew?

I have installed a vim using brew, and it was installed to a very different place, and now I want to locate that vim, in a shell script, is there a good approach for this?
1
vote
0answers
13 views

System clipboard flushed out, once i exit vim

I use yy to access the system clipboard always. yy is mapped to a function as, function! Copy_ToSystemClip() .w !xsel -ob end function inoremap yy Copy_ToSystemClip()<CR> It copies to the ...
5
votes
3answers
2k views

Can't open syntax.vim error when using vimrc

When I try to open my .bashrc file. then it shows these lines: Errordetected while processing /etc/vimrc: line 45: E848: Can't open file /usr/share/vim/vim70/syntax/syntax.vim Press ENTER or type ...
10
votes
2answers
3k views

Make sed ask for confirmation before each replacement?

Is there a way to make sed ask me for confirmation before each replace? Something similar to 'c' when using replace inside vim. Does sed do this at all?
8
votes
4answers
7k views

Vim Error E138: Can't write viminfo file $HOME/.viminfo!

I'm afraid I've run into something rather strange. When I open a file normally, vim README.txt, everything is fine. But upon sudo vim README.txt, the file renders blank, and gives me a E138: Can't ...
1
vote
1answer
157 views

Set Environment Variable for Ranger File Manager

I've recently stumbled across ranger file manager and immediately took a liking to it. However, there is still a problem I couldn't figure out the solution to: How is it possible to change environment ...
0
votes
1answer
18 views

What is the format of the default statusline?

I read about how to update the vim statusline here. And I am able to update it successfully. But, I would like to retain the format of default vim statusline and just add some more info to it e.g. ...
4
votes
0answers
84 views

Problem using Ctrl+Arrow keys in Vim when using Byobu with tmux

In Vim, I had set the Ctrl+Arrow keys to skip words. This works just fine when running Vim inside the gnome-terminal. However, when using byobu (tmux), it shows weird behavior : it deletes ...
0
votes
1answer
14 views

how do I install both neovim and vim plugins which are in the same .vimrc file?

I'm new to neovim and would like to know how to install both neovim and vim plugins which are in the same .vimrc file?
1
vote
0answers
76 views

Neocomplete conflict with auto line-breaking in vim

I've found a conflict between automatic line breaks in vim and the neocomplete Vundle plugin. When neocomplete is off, then my set textwidth=80 option works correctly, i.e. a line break is inserted ...
1
vote
1answer
2k views

Terminal colors for Vim Airline and Tmux Tmuxline

When using Vim on its own with Vundle and Airline the theme appears normally: When I have loaded it up in Tmuxline, the theme uses different colors and even Vim looks different: Here's my Tmux ...
16
votes
7answers
12k views

Are cygwin vim commands different than normal vim?

I am unable to edit text files using vim in cygwin. I have to press i many times to insert text. Sometimes it works and sometimes doesn't. Whenever I move cursor up down I have to press I many times. ...
1
vote
3answers
51 views

How to copy contents of a (large) vim file to the OSX system clipboard to paste in other apps?

I like to use vim to edit other (non-programming languages) stuff. So I paste the content into vim and make the changes. How can I copy all of the text back into the primary clipboard for pasting? ...
9
votes
2answers
2k views

screen + vim — Any way to automatically set screen window name to open vim filename?

I have a pretty nice screen rc file that shows me the open screen windows almost like tabs at the bottom of the terminal. Currently the windows are named according to my prompt which is not so useful. ...
2
votes
2answers
156 views

Background color mismatch in vim and tmux

I'm having trouble getting the full range of colors to work in vim when I'm running through tmux. I belive that it's some sort of trouble with TERM variables or 256colors, but I've done everything I ...
1
vote
0answers
25 views

Bash completion function for vim 'scp://' Paths

For easily editing remote files with vim, I currently use a few .vimrc and .bashrc additions to my environment. The bash-scripting side of it "misuses" the available standard _scp bash completion ...
-1
votes
0answers
46 views

Vim: how to search +

I need to search the character + in a file,how to do with vim? I have tried /+ /\<+\> But don't work Edit: my fault /+ works fine
0
votes
1answer
16 views

How to redirect the echoed code content of `:function FunctionName` into current file?

I've learnt how to put variable value to file with this Stackoverflow link. e.g. :let L = [1,2,3] :put string(L) [1, 2, 3] It seems the method mentioned in above link is dealing with the ...
0
votes
1answer
22 views

Why my dict methods works well without defining with extra `dict` argument ? [vim]

My piece of code looks like: :let ClassZ = {'author': "Juchen.Zeng"} :function ClassZ.Print_author_name() : echo self.author :endfunction :function ClassZ.Change_author_name(arg1) : let ...
0
votes
1answer
12 views

Is there another brief way to detect if an item in vim list other than `index(L, item)`?

Like in python, there is a syntax i in L to detect if a value in a list. Is there similar syntax in vim other than index() function?
0
votes
1answer
24 views

How to print a vim list to file in ['l', 'i', 's', 't'] format?

Today I learnt that I can use register = to print vim variables to file. However I got some trouble when trying to print a list to file. # Command mode :let L = [1, 2, 3] :echo L [1, 2, 3] # Normal ...
2
votes
1answer
22 views

vim how to unabbreviate

I have abbreviated main to '#include.....', I was looking to unabrreviate it for one vim session, and tried the following :una main I get error 'E24: No such abbreviation'. The problem is, it's ...
0
votes
0answers
28 views

vim no tab completion in bash

When in shell, running vim <anything> and pressing tab, doesn't auto complete or show the list of the available files. Although it auto completes for the directory names, but not the file names. ...
1
vote
1answer
457 views

How can I compile a C program that I've edited in Vi or Vim?

I'm trying to compile and run a c project from vim and vi #include<stdio.h> int main(void) { printf("Hello! This is a test prgoram.\n"); return 0; } and i get this output ...
1
vote
1answer
24 views

How to search for <td>n in vim?

I can search for n with /n/ I can search for <td> with /\<td\>/ But how can I search for <td>n ? When I try /\<td\>n/ i get not found I'm trying to target the ...
1
vote
0answers
25 views

vim issue with tab/space in multi-line abbreviations in vimrc

i am trying to write a vim abbreviation to create a template program in c I have given the abbreviation as below in the .vimrc abbr main #include<stdio.h> \^M#include<string.h> ...
1
vote
1answer
33 views

How to express “There is a specified symbol in the following unknown numbers of characters” in regex(vim)?

I have many python code examples in my markdown files, which should be prepended with >>> symbols. So I write a vim function to do this job: function AddShellPrompt() range let lnum = ...
2
votes
1answer
29 views

Vim pausing randomly for a minute or so at a time

I'm running Linux Mint Maya 13.2 on a laptop from a USB stick, and SSHing onto that install from my own work computer. When i'm editing a file with Vim, i keep getting a pause of about a minute where ...
16
votes
6answers
3k views

Automatically create matching braces in vim

How do I automatically create matching braces in vim? It should work as follows: If I input an open brace the closing one should appear automatically and the cursor should be placed in between. To ...
2
votes
0answers
11 views

Why in “:normal”command ^[ seems doesn't work with A? (vim)

Today, I learnt a bit of vim normal command, and below is my experiment: :normal i Insert ^[ yyp :normal A Append ^[ yyp # RESULT OF EXECUTE FIRST COMMAND FOR SEVERAL TIMES Insert Insert ...
7
votes
5answers
6k views

Copy-paste for vim is not working when mouse (:set mouse=a) is on?

I was trying to copy paste something from vim to another application and also, from that application to vim using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also ...
2
votes
1answer
38 views

Vim cursor highlights wrong position

I'm having some weird vim cursor behavior which I'm unable to solve. While I was editing a file, suddenly the cursor marker moved one or more spaces to the right while the cursor actions still ...
2
votes
3answers
58 views

Copy vim selected text to system clipboard

My vim is not compiled with clipboard feature. So, i use xsel as suggested by Gilles to copy/paste the contents. I use :.w !xsel -b for selecting the current line and, :w !xsel -b to select the ...
3
votes
1answer
1k views

ls and vim color on SunOS 5.8/Solaris 8

I want to use ls and vim with color on Sunos 5.8 SunOS 5.8 Generic_117350-11 sun4u sparc SUNW,Sun-Blade-2500 I have installed ls (GNU coreutils) 6.9 and vim 7.2 In ~/.cshrc: setenv TERM sun-color ...
0
votes
1answer
26 views

Is it able to echo parallel negative numbers in vim?

In h vim-script-intro. It says - will be interpreter as minus or negative depends on the situation. Thus echo -1 1 will result -1 1, and echo -1 -1 will result -2. Drove by my curiosity, I tried ...
0
votes
3answers
44 views

VIM: What's the quickest way to return from typing :w<enter> in insert mode?

Sometimes I forgot to press ESC to return to command mode and enter :w<enter> in some line I was editing. So I get the following: some line of code:w I was typing ^ cursor position So ...
7
votes
3answers
3k views

How to allow Page Up in GNU Screen?

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows. I use GNU Screen commonly as well. When using Vim inside Screen I am unable to use the ...
11
votes
3answers
5k views

Copy text from one tmux pane to another (using vim)

I have two files opened in vim, each in one tmux pane. I would like to copy let's say 10 lines from one file to another. How can I accomplish this not using the mouse's Copy -> Paste ?
2
votes
1answer
24 views

Strange characters after pressing numeric keyboards in VIM editor

I'm running VIM under GNU screen. When I'm in insert mode and press e.g. asterisk symbol on numeric keyboard, instead of asterisk I get <F3>, when I press e.g. 4 I get t followed by newline. My ...
1
vote
2answers
53 views

Trailing spaces when copying from console

It's this annoying behavior I've been experiencing here and there occasionally: when you select text with mouse in console (that is, copy it), paste it, and realize you've got extra spaces at the end ...
4
votes
1answer
109 views

Using inotifywait along with vim

I have simple script that monitors file for changes and rsyncs it with remote copy: #!/bin/bash while inotifywait -e close_write somefile do rsync somefile user@host.domain:./somefile done It ...
1
vote
1answer
43 views

Write before the cursor

In Vim, I have a #write after cursor A #write after end line I #write at start of line I want to write before a word, for example I want to edit this line My cursor is at the position after ...
37
votes
3answers
3k views

Why does Vim indent pasted code incorrectly?

In Vim, if I paste this script: #!/bin/sh VAR=1 while ((VAR < 10)) do echo "VAR1 is now $VAR" ((VAR = VAR +2)) done echo "finish" I get these strange results: ...
54
votes
8answers
14k views

Exit vim more quickly

I use Vim mainly for quick edits rather than long work sessions. In that sense, I find the keyboard sequence for quitting especially laborious: Esc, Shift + ;, w, q, Enter. How to quit Vim (possibly ...
0
votes
1answer
24 views

Python feature disabled vim-nox

I have installed vim-nox version 7.4 package in my Debian Wheezy machine from backports. I am confused that the python feature still does not work as shown from vim --version command as -python as ...
1
vote
1answer
28 views

How to insert named register from vim commandline

Using vim I have some troubles inserting the value of a specific register using commandline mode. When in normal mode I can enter the sequence "*p which will put the value of register "* beneath the ...