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

learn more… | top users | synonyms

4
votes
6answers
2k views

vi shows as vim

When I type vi into a terminal it shows the following display: Note that it says vim not vi, I'm sure I haven't downloaded vim yet and that this is actually vi not vim: for example the arrow keys ...
1
vote
4answers
100 views

Search and replace two words with ex command

I want to search and replace 2 words with 2 other words with one g/.../s/.../.../g command. For example to replace word 'car' with 'truck' and 'cat' with 'dog' with one ex command in Vim.
1
vote
1answer
31 views

some POSIX Bracket Expressions not working

For example when I'm trying to find and replace something using g/[:digit:]/s/1/2/g Vim showing error: Pattern not found: [:digit:], while the string contains digits. Following POSIX Bracket ...
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
38 views

Using options with :tabe in vim

I have a file open in Vim. I'd like to open another file in a tab, using the :tabe command. However, I'd also like to open this file with the -M option, in order to avoid modification and writing of ...
0
votes
1answer
420 views

vim - “Press ENTER or type command to continue” right after loading only?

Recently my vim has developed the habit of displaying Press ENTER or type command to continue the first time I do certain things right after I open it. For example, if I'm at my shell prompt and type ...
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 ...
24
votes
6answers
3k views

Why is it risky to give sudo vim access to ordinary users?

I'd like to create a new user and give him sudo access. To be specific, I want him to use sudo vim and edit httpd.conf. I wrote this in sudoers: user ALL=(ALL) /usr/bin/vim ...
1
vote
3answers
127 views

Vim syntax highlighting fails with autosession

Since I've installed this VIM autosession manager (which does its job) syntax highlighting gets killed on the first buffer change after starting vim. I can restore it with :syntax on but I ...
4
votes
1answer
80 views

Unknown Function in Vim

I am hoping that this is the correct StackExchange community. Anyways, I have the following file (vimscript.vim): function HelloWorld() echo "Hello World" endfunction call HelloWorld() When I ...
4
votes
1answer
171 views

Disable or remove default vim keybinding

Is there a way to disable or remove a default vim keybinding? For example, if I wanted <S-k> (shift-k) to do nothing, how would I achieve this?
0
votes
1answer
51 views

Solaris vim end key

A simple question: why with solaris 10 on vim pressing end key produce F? This is what appened pressing end This is a text file,i will press "end key" F F F F :(
1
vote
3answers
526 views

“E488:Trailing Characters” while typing :<F7>

I have written the following in vimrc.vim :filetype plugin on :let s:save_cpo = &cpo :set cpo&vim :let &cpo = s:save_cpo :set runtimepath = ~/home/nikcha/.vim/plugin :set fileformat = ...
2
votes
5answers
209 views

Edit Nth occurence interactively in a search in vim

Given a text with multiple occurrences of the word foo, I would like to do an interactive search through the text, and upon the Nth occurrence of foo, edit it. I can only find the search and replace ...
0
votes
1answer
27 views

Moving by page without chords in Vim

Often I want to skim through a document or piece of code, which I do with page down (Ctrl-D) and page up (Ctrl-U), but it feels like I am violating the spirit of Vim using emacs-like chords/control ...
0
votes
1answer
57 views

Updating vim on remote host

I want to lead this off by saying I'm quite new to any type of server administration so please bear with me. I am currently running a shared bluehost account. The current version of vim on the ...
1
vote
1answer
270 views

Is vim multithreaded?

I have a HUGE (and I mean huge) text file that I am going to process with vim. I could process it using two different (debian) machines. One is duel-core and one is octo-core. A single core on my ...
1
vote
1answer
45 views

How can I enter visual mode *after* (or: to the right of) the cursor

Let's say I am typing something, then realize that what I just typed will be repeated a couple of times. Now, what I would like to do is to select backwards, yank (thereby returning to the position I ...
3
votes
4answers
58 views

vim edit a file with a user-vimrc but still load all previous initializations

Checking the man page for vim says it's -u switch that lets me choose a different vimrc file -u {vimrc} Use the commands in the file {vimrc} for initializations. All the other initializations ...
1
vote
2answers
152 views

Vim colors conflicting with terminal ones

For most vim colorschemes, they appear different than advertised when I open vim in xterm. I've been using xterm-256color and set t_Co=256. A similar thing happens when I use xfce-terminal, but the ...
3
votes
2answers
145 views

Editing Remote Files in Git repo

I have a remote Linux machine which I use as a development server for a web application. I cannot reproduce the environment locally, the files must execute on the remote server, but I want to edit ...
0
votes
2answers
222 views

Using grep for listing certain lines from a file

Using a random file, such as /usr/share/vim/vim74/tutor/tutor, is there a way to list all lines that start with a 5 letter word ? How about the lines that end with a 5 letter word ? I've been ...
3
votes
3answers
65 views

Quick way to open a distant file in vim in command line

Suppose I have two files with the following filepaths: ~/another/project/file1.txt ~/this/is/some/very/deep/project/file2.txt As you could see, file1.txt and file2.txt are located "far way" from ...
2
votes
1answer
217 views

on osx vim 7.3 set number set relative number not working

I'm using OSX Mavericks. Using VIM 7.3, I can't seem to get the "hybrid" line numbers to work. I was reading a tutorial stating that if both set number and set relativenumber were included in the ...
2
votes
2answers
106 views

Vim, how to delete from CURRENT cursor position, until end of line and next N lines?

This is strangely difficult to figure out. I do not want to delete what is to the left of the cursor, only from the cursor to the end of the line, and the following 3 lines in ONE command. I know I ...
2
votes
0answers
34 views

command-t plugin not working in vim

The command-t plugin is not working. When I press the <leather> + t, it gives me the error from the picture. Please help with this error. Thank you.
2
votes
1answer
142 views

Is replacing a particular line in a file through a bash script possible in VIM or EX?

I would like to modify a particular line, say line 5, in a file by using the EOEX construct how can I achieve my aim? The code snippet that I use to achieve my purpose is as follows: #!/bin/bash ...
0
votes
2answers
84 views

How to insert specific lines into a file using vim?

I am using vim for both programming and competitive coding. Now, since I want to insert specific macros whenever I open a source file when I am doing competitive coding. I just copy paste the entire ...
2
votes
1answer
44 views

How to update a date in a file if applicable and increment the last digit by one if one writes to the file using Vim?

Aim The aim is to update a number in a file if one writes to a file using Vim. If the date resides in the file the date part should be left unchanged, but the last digit needs to be incremented by ...
7
votes
2answers
180 views

How to show line numbers in vim on the right side of the buffer?

I have set nu in my .vimrc which shows line numbers on the left side of current buffer. I would like to see line numbers on the right side. How to achieve this? UPDATE: This should also work for set ...
11
votes
6answers
1k views

vi commandline, goto line and column

I have been mixing the use of emacs and vi (vim) for a long time. Each of them has its advantage. I parse error output from a compilation like process and get a line and column number but I can only ...
2
votes
1answer
477 views

YouCompleteMe vim extension: How to jump to next error?

Is there any way when using the YouCompleteMe vim extension to jump to the next point in the file with an error? I find myself just scrolling through the page until I find the error highlight, but ...
0
votes
1answer
49 views

Vim mappings stop working

Some of my Vim mappings have stopped working, even though :map <keys> shows that the mapping has been registered. One example is map <S-CR> O<Esc> in my .vimrc, which does not work ...
2
votes
0answers
193 views

Supress standard output in vim-latex-suite

I use Vim Latex-Suite together with the PDF reader Zathura. In the last versions of Zathura they decided to output the following warning: "warning: Failed to loads bookmarks" whenever a document ...
1
vote
1answer
102 views

vim :grep using the bash 'globstar' option

I am (slowly) switching to Vim for everyday Ruby on Rails coding (Linux Cinnamon 64bit). Being a newbie, I recently came across something I don't understand. I want to use the :vimgrep and :grep ...
2
votes
2answers
255 views

Use Netrw or Nerdtree in Zsh/Bash to select a file BY BROWSING?

Often I find myself in the shell, wanting to insert a filename into a lengthy command. I'd like to hit a shortcut, and use Netrw or Nerdtree to browse for a file or directory, and have it pasted in ...
2
votes
3answers
149 views

Vim: consolidate regex-matching lines

I've pasted a log generated by rsync running through Cygwin on a Windows 2008 server. I am rsync'ing data over to a new file server (Synology), and after trimming out anything that's not an error, I ...
1
vote
1answer
1k views

PluginInstall vs BundleInstall command in Vundle?

On the Vundle GitHub page it says that one should use PluginInstall to install plugins, but when I search for Vundle on the web people often use BundleInstall instead. Both commands seems to be ...
4
votes
2answers
192 views

Can .vimrc be divided into multiple files?

Say I have some hundred custom re-mappings with iab for Java and some other hundred or so re-mappings for Haskell, then I'd want do divide these into different files to make it more manageable. What ...
1
vote
1answer
132 views

C++ header/source files in file chooser

By convention, our C++ headers live in .hpp files. When I open a gvim window with a .cpp file (so C++ source), then use the open menus, I get file chooser window which allows me to select files for: ...
2
votes
2answers
54 views

vim disassembles my indentation [duplicate]

When i'm in Insert mode at vim, and press Shift+Insert to paste my code to my file, vim disassembles my indentation , Such as: Question: How can i solve this problem?
1
vote
1answer
94 views

Vim visual selection method differs between Windows & Linux?

In Linux vim and gvim, I can make a visual selection by pressing V (e.g., v VISUAL or Shift+V VISUAL LINE), releasing it, and using movement keys (e.g., arrows) to highlight the desired text. In ...
3
votes
1answer
163 views

Vim emulation in IDEs vs gVim as IDE

I am currently using gVim as editor and cannot think about going back to mode-less editing. I code in Java for Android and in Python for another project. While trying to set up gVim as my primary ...
2
votes
1answer
203 views

A Sublime editor feature for vim… File pre-view?

I was wondering if there was a vim plug-in for the Sublime editor feature showing a smaller version of the file currently being edited, generally in the right hand side of the window -- see picture ...
1
vote
3answers
106 views

How to hide a content of a file? [closed]

Is there any way to hide the content of a file? Suppose I have the file bind which contains the following line: This is a test. After saving the file, it should not display its content. Is there ...
1
vote
1answer
42 views

Creating specialised dictionary file for VIM (from Wikipedia?)

I use VIM's dictionary completion feature very frequently, yet have found it unhelpful when it comes to 'specialized' terminology, in my case German philosophical terms. I would now like to create my ...
0
votes
2answers
35 views

Is there a way to limit a vim window to show only a portion of a buffer?

Sometimes when working with big files containing many functions I would like to create some splits showing specific functions and nothing more. Is it possible in vanilla vim or with some plugin to ...
3
votes
2answers
156 views

Vim - Automatically changing the pair of a changed HTML tag

How can I configure Vim so that when I change one member of a matching pair of HTML tags, the other is automatically changed to match? For example: given <span>content</span>, I want to ...
0
votes
0answers
22 views

Set default editor for 'info coreutils' [duplicate]

I'm using Ubuntu 14.04 and have this in my .bash_profile: export EDITOR=/usr/bin/vim export VISUAL=/usr/bin/vim man respects this setting but info always opens in something else, nano or it's own ...
4
votes
2answers
1k views

tmux vim colorscheme background is not showing

I have installed tmux but now text mode vim colorschemes do not fill the background colour properly. Here is how it looks with colorscheme xoria256 in the normal Ubuntu 14.10 terminal: And here ...