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

learn more… | top users | synonyms

0
votes
0answers
7 views

Syntastic, Vim & Android: get them play well together

I've got a problem configuring my development environment for android. I'm migrating away from Android Studio due to continious issues that I have no desire to solve anymore. I'm a long-time VIM ...
0
votes
2answers
18 views

Is there a sudoedit equivalent for vimdiff?

I'm trying to get into the habit of editing root-owned files with sudoedit, instead of sudo vim. This has a few advantages, one of which is that it uses my user's ~/.vimrc. Is there an equivalent, ...
0
votes
1answer
25 views

Unable to install vim plugins

I am unable to install any vim plugins on nixOS running the command: nix-env -i vimplugin-Syntastic gives these as the last 3 lines of output: output path ...
0
votes
2answers
36 views

How to weave the words of a string into a block of strings in vim?

Given a string and a block of strings e.g. String: Use three words. Block: This is the first string of another block of strings. This is the second string of another block of strings. This is the ...
1
vote
1answer
32 views

How can I have my .vimrc detect what OS I'm using?

Since I upgraded my Ubuntu to version 14 I've had a lot of problems with sharing my .vimrc file between Ubuntu and OSX. The following commands no longer work and in fact gives errors: set filetype ...
1
vote
0answers
20 views

visual mode/highlighting/selecting text on uzbl?

Is there a way to do a vim-like visual mode to select text with uzbl? Or any way to select text in uzbl with the keyboard? I installed arch-linux recently, and I haven't gotten my touchpad working. ...
1
vote
2answers
30 views

`Delete` key doesn't work on vim insert mode for deleting previously typed content

I opened vim in my iterm2. Firstly, I typed something on insert mode, like Hello At this stage, if I didn't exit from insert mode, delete key works and can delete the whole word if I want. If I ...
0
votes
1answer
19 views

vim: found /var/log or similar

On vim for search an exact word i type /\<port\> in this case it return every occurence of port ,how to found /var/adm or /var/log entries? I have tried /\<\/var/\adm/> but no ...
0
votes
0answers
19 views

How to generete allegro5 tags for vim with ctags?

I was recently working on project with GTK2 in vim (with OmniCppComplete plugin). so I generated tags with ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --sort=yes /usr/include/gkt-2.0/ I did so ...
2
votes
2answers
35 views

Set default permissions by file type (at least in Vim) [duplicate]

When I create a new script, I always have to manually add executable permissions with chmod +x foo.sh. My default permissions are set to 644, and but I'd like any file with extensions like .sh .py to ...
2
votes
1answer
31 views

Yank all function declarations

Something I often have to do is make sure I have prototypes for all my functions in my C code at the top of file. What would be a way to quickly select all the function declarations in a .c file using ...
0
votes
1answer
49 views

Run a Vim command from a bash script

This is related to a question I asked earlier but I would like to keep it separate in case anyone else can find use in it. I have a command that I am running on a file called dummy.out from the ...
2
votes
2answers
55 views

Bash Scripting VIM commands

I have a few files that I have an annoyingly repetitive group of VIM commands to apply to. They are basic VIM commands just to delete some lines which are not supported by the process I need the files ...
1
vote
1answer
29 views

What does >… mean in vim and how to substitute a single whitespace for it?

I know that when :set list is used whitespace is shown as .. But what does it mean when a whitespace symbol is preceded by >, e.g. >., >.., or >...? And how do I remove it and leave only ...
0
votes
1answer
14 views

vim color changing between | |

I'm editing some rst files. In the math section, the color changes between | |. Why is this so? How can I change my rst.vim file to not change color between | |? Thank you in advance.
1
vote
1answer
42 views

My terminal is pure white // removal of the things spf13 has done to my Ubuntu

I have installed spf13 by using the command: curl http://j.mp/spf13-vim3 -L -o - | sh I didn't liked what I got, so I tried to get rid of it. I managed to get to my previous VIM configuration, but ...
1
vote
2answers
62 views

How can I invoke vi instead of vim [duplicate]

I want to use vi for better pasting. When I use vi I get vim When I type /usr/bin/vi I still get vim This is on my Max OSX 10.10 Yosemite
2
votes
1answer
33 views

Is it possible to make VIM emphasize found text?

As vim wiki's stated we can look up strings by using *. But by default, looked up string is not being emphasized. Is it possible to configure vim that the strings will be emphasized when looked up ...
2
votes
4answers
70 views

Substitute all occurrences of pattern with first matched group

I have to go from this: text match$something_here and match$xxx blablabla text match$something_else_here and match$xxx blablabla ... to this: text match$something_here and match$something_here ...
0
votes
0answers
16 views

Open an existing file in another tab/window while using gvim --remote-tab filename in one vim file.(Using Vim plugin script))

I am writing a vim plugin which maps a key to the function which opens and highlights the text in another file with the same text (if present) at the current cursor position in the current file. But ...
4
votes
5answers
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
44 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
21 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 ...
0
votes
0answers
24 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
21 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
75 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 ...
2
votes
0answers
15 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
2k 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
74 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 ...
3
votes
1answer
17 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 ...
2
votes
1answer
30 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
28 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
78 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
172 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
24 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
12 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
78 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
37 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
37 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
52 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 ...
2
votes
2answers
53 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
203 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
59 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
42 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
49 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
15 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
84 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
46 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
42 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
109 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 ...