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

learn more… | top users | synonyms

2
votes
6answers
25 views

Writing a script and executing it in vi

I have several text files. All these text files need to undergo a set to editing which can be done in vi. I want to automate this. vi has several commands for replacement. Suppose the text files need ...
0
votes
1answer
22 views

vi replace search text by manipulated search text

I'm stucked in a bigger problem. This is a very simplified version of the problem. Suppose I have a text file containing at several places the code 20091a or 20092a or 20093a. I'm wishing to surround ...
4
votes
3answers
292 views

Switching among cli and vim and other files workflow

I saw some kind of workflow in vim: Vim had a file open. Then some combination of keys made vim disappear and the user was in the command line working in cli mode, then opened another file and then ...
2
votes
1answer
62 views

What does the underscore motion do in vim?

I don't understand the underscore motion in vim, at least in the context of yank (y). My cheat sheet reads "soft" bol down which I do not comprehend. If I use the motion alone it seems to be the ...
0
votes
0answers
12 views

Folding in vimrc does not work as expected

I added these to my vimrc: set foldenable set foldmethod=syntax set foldlevelstart=1 let javaScript_fold=1 " JavaScript let perl_fold=1 " Perl let php_folding=1 ...
3
votes
2answers
75 views

Vim settings within ncftp edit

I'm using the ncftp utility. It has an edit command which handles the get, edit, put sequence for me as in GUI ftp clients. It's great except for one thing, I get vanilla vim, with none of my ...
1
vote
1answer
316 views

Vim colorscheme background not filling terminal

I am using vim with lxterminal, and the colorscheme kolor, and I am experiencing an issue where vim's background color does not fill the entire terminal. It can be seen clearly at the bottom of ...
5
votes
3answers
929 views

Vim unnamed register + or *

Im using Vim 7.3 in Ubuntu and I'm having a little problem copying to the system clipboard with the following command "+y but I'm getting the following error: E354: Invalid register name: '+' In my ...
2
votes
1answer
21 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. ...
8
votes
2answers
142 views

Vim spell punctuation for ⸮

I am finding myself using the point d'irony (⸮) more and more. However, vim spelling does not recognise it as a valid punctuation character. How can I add it to vim so that the spelling works?
4
votes
1answer
272 views

Vim Copy to System Clipboard without overwriting the default register(")

When I use "+y to copy to the system clipboard, the selected content is copied to the + register as well as the default(") register. How can I ensure that the content is copied only to the + register ...
1
vote
2answers
47 views

Vim - statusline and links

Given this situation: cd ~/temp ln -s /var/lib/alsa alsa cd alsa pwd -> /home/<username>/temp/alsa But if I open some file in the directory output of pwd, the vim statusline gives me: ...
3
votes
3answers
184 views

Method for storing/remembering one liner commands

Often when configuring and adjusting unix-based systems I use a lot of one-line commands that are difficult to remember. For example, to determine what version of ntp (the time server) is running, you ...
5
votes
3answers
690 views

vim - how can i do a 'change word' using the current paste buffer

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar' and I want to replace it with my paste buffer. To replace the text ...
0
votes
1answer
16 views

Can I get my iTerm key-combos working in tmux?

I have some shortcut keys defined in iTerm, and I use them for key-mappings in Vim. For example, I map Ctrl-Enter to send a ^[O2P escape code, which I then use to define a Ctrl-Enter key-mapping in ...
0
votes
1answer
24 views

Cursor keys do not jump over tabs in Vim

When I step over a tab with the cursor keys (h and l), the cursor does not jump over the tab, it just goes one space at a time. This is annoying because I am not sure if there is a tab there or ...
6
votes
1answer
52 views

Change inside comments with Vim

Is there a way to change inside of a comment with Vim? I know you can change inside brackets and quotes with i] and i". For example, If you are on a quote you can press, ci"my new textESC And ...
-2
votes
1answer
50 views

Why are there several keys unbound in vim?

There are several keys that are unbound in vi/vim, such as g, q, v and #. Is there a particular reason why these keys are unbound? Can I just use them however I want or will I be breaking certain ...
4
votes
1answer
311 views

Vi: On startup, highlight tags and display tags in a preview window

I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or outline file, vi reads the tags present in this ...
1
vote
0answers
54 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 ...
1
vote
2answers
31 views

Random colored column?

For whatever reason, the first column is highlighted and I can't figure out why. I have not messed with my vimrc file, nor any zsh options. This column is only highlighted only with, "aliases.zsh", ...
1
vote
1answer
394 views

Configuring Vim with clientserver and clipboard

On OS X I have vim working just fine from homebrew. The default homebrew install compiles vim with these flags. ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.161/share/man ...
7
votes
2answers
105 views

How do I only undo pasted text in vim?

TL;DR; version - How do I undo text that was pasted in from my OS copy buffer without undoing other text that was typed in since I went into insert mode? Longer description: Put something in your ...
1
vote
2answers
30 views

How to open chapters of Vim user manual in Vim

I opened the Vim user manual with the :h user-manual | only command (to open it in one window) and now I want to enter/open the separate text files. I tried to put my cursor over a section, such as ...
2
votes
3answers
67 views

Find and change certain LaTeX coding in vim, using regular expressions?

How can I change the following LaTeX coding: \cite{1,3-7,9} to \cite{1,3,4,5,6,7,9} in vim? I would prefer to use regular expressions.
2
votes
1answer
25 views

Vim: Exit single character replace mode with <C-C> when using `nnoremap <C-C> <silent> <C-C>`

I've become far too trained to use <C-C> to return to normal mode. I understand there is a difference between <C-C> and <ESC> but that's beside the point of this question. I use the ...
10
votes
4answers
1k views

How can I paste (overwriting) with vim?

In vim I use yy and p all the time to yank and paste lines. However, if I want to replace one line multiple places in the file, I can't use yy p dd p because the dd deletes the line to the clipboard ...
5
votes
2answers
34 views

Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color ...
10
votes
4answers
20k views

How do I quit from Vi?

I started Vi on my Ubuntu machine. However I don't know Vi, and now I can not quit. I see the editor and I can write text, at the bottom line there is a label "recording". How do I quit from Vi?
0
votes
1answer
668 views

How to install vim-gtk in debian wheezy

this is the terminal trace root@wheezy:/home/me# sudo apt-get install vim-gtk Reading package lists... Done Building dependency tree Reading state information... Done ...
-2
votes
0answers
22 views

vim switches split afer entering/leaving a folder

I'm using vim as a browser/navigator (e.g., with :e ./). Now, when I enter/leave a folder (e.g. with -), vim switches to another split. This does not occur always, but often enough to irritate me ...
1
vote
2answers
32 views

How can I replace ^I into tab spaces in vim editor for .java file?

When I open my .java file in vim, I could see a couple of lines prefixed with one / more ^I characters. It looks like tabs in Eclipse that has got converted into ^I. I would like to replace a single ...
1
vote
1answer
39 views

Vim delay when using Ctrl+C, but only in SQL files

I'm working on a side project with both JavaScript and SQL source files. When I'm editing the JavaScript, Vim behaves normally. However, when I'm editing the SQL files, there's about a one-second ...
1
vote
1answer
16 views

Using vim-latex with latexmk and evince results in garbled text (GLib-GObject-CRITICAL)

When I compile a latex file in vim with the vim-latex plugin with \ll usinglatexmk, my vim terminal text content gets littered with error messages like the following dispersed through the text: ...
1
vote
2answers
89 views

Vim: join lines by replacing ^M

I have a file which has embedded ^M characters. I wish to join the lines at the ^M character. ie: change this: ^M être, ^M étant, ^M ...
1
vote
0answers
13 views

how to create a v.imrc [duplicate]

I created a macro in vim and stores in key s. example let @s='sample'. I want to write this macro in q.vimrc. How can this possible?. please give a simple sample program.
1
vote
2answers
349 views

How to fix weird vim polluting the terminal behaviour on arrow keys and on delete in insert mode?

My terminal gets polluted by B, C,A,D when I try to navigate within vim using arrow keys and on delete using backspace it only scrolls back without deleting the characters on screen while the ...
1
vote
0answers
32 views

How to make a vimrc? [closed]

I made a macro and stored in key 's' and stored by using like that: :let @s='macro_name' I want to write this macro in q.vimrc (for the use of my collegues). How is this possible?
2
votes
2answers
93 views

How do I change the colour of text matching a regex in vim?

Suppose I want to make all text that matches some regex persistently and automatically (and without affecting / searches) appear in a different color. How would I do this in vim 7.4?
0
votes
2answers
35 views

Skip search and replace after a heading in Vim

I have to replace a pattern, but I don't want to replace it after a particular word. This is my program: :vnoremap ::silent! call Bib() function! Bib() %s/\s*\n*{\\&}\s*\n*/ /g ...
3
votes
2answers
591 views

How to enable vim addon packages?

I have installed vim-nox as well as vim-latexsuite and vim-outliner on Ubuntu 12.10. There's nothing wrong with Vim but neither of the add-on packages does anything. What do I have to do to in order ...
6
votes
5answers
2k views

Indent several lines with VIM?

For eample, I'm editing this code: <html> <body> <script> var a = 10; a += 100; </script> </body> </html> now I need to indent the script line: ...
1
vote
2answers
70 views

How do I open all files in the current directory and all subdirectories using vim?

So far I've been using vim */** which seems to open all files in subdirectories but not those in the current directory, and vim * which opens all files in the current directory. But how do I open all ...
2
votes
1answer
120 views

How to reload a file in vim?

Various editors like gedit detect if the file is changed and asks to reload it. Sometimes in vim when I got many files to edit, I sometimes end up opening same file in different tabs for quick look ...
1
vote
2answers
31 views

refresh changed content of file opened in vi(m)

I have a config-file that I keep open in vim, but that sometimes gets changed on disk, without these changes being reflected on the terminal. Can I refresh the content on the screen without closing ...
1
vote
1answer
30 views

Can you further integrate and present sequential moreutils vipe command output in vim using successive splits etc?

I have used the moreutils suite a few times and I find it makes you think further about base utilities and is insightful(and fun). For instance, vipe allows running an editor - like vim - in the ...
3
votes
2answers
33 views

Keymaping for re-indent source code in Vim

I have key mapping in my ~/.vimrc file that re-indents edited source code on the fly. It looks like as follows: " press F4 to fix indentation in whole file; overwrites marker 'q' position noremap ...
6
votes
4answers
5k views

Auto indent / format code for Vim?

I'm trying to use Vim more and more when I can. One of my biggest grip between Vim and an IDE like Aptana is the ability to auto indent. Is there a means of auto formatting code (HTML, CSS, PHP) so ...
1
vote
2answers
29 views

Specifying height for vertical splits in vim

Usually I am editing two files, A and B, split horizontally. I set it up, so that one buffer would only occupy the first 2 lines at the top of the screen, and the rest is for the other buffer. ...
25
votes
5answers
3k views

Why does `ESC` move the cursor back in vim?

In vim, when I hit ESC to return to command mode, the cursor moves one character to the left. This is not what I would hope for, occasional I immediately hit l to move back to that spot, perhaps to ...