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

learn more… | top users | synonyms

1
vote
1answer
23 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
51 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
24 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 ...
1
vote
3answers
85 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 ...
0
votes
1answer
203 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 ...
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 ...
16
votes
3answers
9k views

tmux, TERM and 256 colours support

Introduction My question arises from the necessity of understanding why I have now (after multiple trials) Terminal and tmux supporting 256 colours and tput colors telling me there are only 8 of ...
2
votes
0answers
33 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 ...
2
votes
1answer
52 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?
3
votes
1answer
30 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 ...
0
votes
1answer
37 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
178 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 = ...
0
votes
3answers
121 views

Open list of files in vim to specific lines

I know about vins command line operator but I need a version that works on multiple files . For instance I have a stack trace file and would like it to open all of the files to the line in a ...
2
votes
0answers
148 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 ...
2
votes
5answers
177 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
23 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 ...
13
votes
2answers
1k views

What happens if I use vi on large files?

Though we were instructed not to, a colleague of mine used vi to view a large text file (server.log 3.5 GB). This filled up /var/tmp and caused some problems on the server. What caused this? Why ...
1
vote
1answer
40 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
45 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
74 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
72 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
209 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 ...
1
vote
3answers
3k views

gvim on RHEL (Red Hat Enterprise Linux) install in home directory

How to install gvim on a RHEL server that doesn't have it (for use with SSH with X11 forwarding*)? No sudo access is available, so it has to be in the user's home directory. *Getting all the ...
3
votes
3answers
62 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
32 views

Reverse global and local marks in vi/vim

How can I reverse the capitalization convention of marks in vi/vim? Normally a lower-case mark like "a" means it is local to the current file, but upper case marks like "A" are global to the session. ...
0
votes
2answers
64 views

What is the difference between “find” and “till” in vim?

I see I can use t c or Tc to move to the next / previous character c I can also use fc or Fc to move to the next / previous character c Is the only difference between them that tc places the ...
2
votes
1answer
78 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
62 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 ...
5
votes
3answers
202 views

Make vimdiff display different lines as different lines (not partially different)

vimdiff has an annoying habit of displaying two almost-completely-different lines as the same partially-different line just because they share a character in common at the beginning or end. For ...
2
votes
0answers
20 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
101 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 ...
13
votes
2answers
10k views

How can I set “vi” as my default editor in UNIX?

I believe I can do something like export EDITOR=vi, but I'm not sure what exactly to enter, and where. How can I set "vi" as my default editor?
0
votes
2answers
55 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
43 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
122 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
720 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 ...
0
votes
1answer
34 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 ...
12
votes
4answers
2k views

How can I constantly see the current filename in vim?

I am using vim and I need a way to always be able to see the file that I am working on without having to do ^G. I see the file name when I start vim but when I start to work and use various functions ...
1
vote
1answer
189 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 ...
2
votes
3answers
1k views

console vim in screen session: remap Ctrl-Shift-Left, Ctrl-Shift-Right to not delete lines

I have my gvim setup so that I can select word-wise with Ctrl-Shift-Right, Ctrl-Shift-Left etc. (yes, I know it's a bad habit, but it works for me..). Unfortunately, these key combinations delete ...
17
votes
3answers
11k views

What does the noeol indicator at the bottom of a vim edit session mean?

I open a file using vim in ubuntu, and this is displayed at the bottom of the screen. "file.py" [noeol] 553L, 16620C What does noeol indicate ?
4
votes
3answers
1k views

Using CtrlP isn't giving very good results - am I using it wrong?

I was hoping that I could just type "job.php" and be directed to the job.php in my /lib/model/ folder, but I've mostly just get many other files returned: [No name] > ...
2
votes
2answers
149 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 ...
46
votes
8answers
33k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
1
vote
1answer
59 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
3answers
116 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 ...
8
votes
3answers
3k views

What does [converted] mean at the bottom of vim?

I have a log file, and when I open it via vim, it looks not readable, and it has [converted] at the bottom. What does [converted] mean? Is there a way to fix the format issue so that it is human ...
4
votes
2answers
135 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 ...
0
votes
1answer
467 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 ...