vi is a text editor of the Unix operating system.

learn more… | top users | synonyms

0
votes
1answer
1k views

cannot type anything into tmux (some keys have weird behaviour)

I'm using tmux via wemux. Sometimes the input seems to be stuck and only very few things are working: can not enter any characters or numbers can still see the output of the program that's running ...
0
votes
1answer
13 views

Trying to edit file in vi and it crashes [1]+ Stopped

Found this question, this is what I see: Swap file error message while trying to edit .vimrc file? But in my case, I can delete swap files, try to edit file and Ctrl-Z and I get this: [6]+ Stopped ...
5
votes
2answers
978 views

Is it possible to launch MacVim NOT in full screen mode?

Whenever I Launch MacVim it takes up the whole screen. I don't want this. Is there any way to prevent it from happening? I run OS X 10.8.
0
votes
1answer
28 views

Prevent Vim from selecting less than 2 characters?

I use Vim more and more, and I installed the plugin ideaVim in my IDE from JetBrains (pyCharm, phpStorm). I still use the mouse a lot to navigate and select text, and sometimes when I click in the ...
3
votes
4answers
4k views

Vim is not reading gzipped files automatically

I want to see some zipped log files .gz in unix through putty. When I open them in vim the contents are not readable. I think vim is not able to unzip them.
22
votes
7answers
37k views

How to get rid of the warnings when opening a file that has a .swp file?

How can I get rid of the annoying warnings when I open a file that has a .swp file? Or, how do I not generate the .swp files at all? Example warning: E325: ATTENTION Found a swap file by the name "....
74
votes
11answers
240k views

How do i select all text in Vi/Vim?

I always use vi for editing config files. Today I wanted to select all the text in a file (around 1000 lines), copy it, then paste into Google Docs. How can I do that?
1
vote
3answers
3k views

How to use the mouse to scroll up/down in MacOS Yosemite Terminal when vi is open

In MacOS X, pre-Yosemite versions I could open vi in the Terminal window and scroll up and down the history of the Terminal. The vi lines in this case did not scroll. To scroll I used the mouse-pad'...
3
votes
3answers
8k views

changing the color of comments in vim

I use vim to browse the source code. In java source files comments appear in blue color on black background which is difficult to read, how to change this color scheme so that comments can appear in ...
1
vote
0answers
31 views

Make part of php comment line bold in vim

I've a PHP script, and I would like to know if natively, I can make a part of a comment line BOLD. For example a comment : // it is released when you execute RELEASE_LOCK(), execute a new ...
0
votes
2answers
5k views

Tab complete in VI mode KSH 'vi-tabcomplete' gives bad options

When I try stuff like in my .profile: set -o vi-tabcomplete I get: .profile[292]: vi-tabcomplete: bad option(s) Does anyone know of a workaround?
12
votes
4answers
5k views

How can I edit all the files returned by find in vi in Linux?

Something I find myself doing a lot is running a find command and then editing all of them in vi, which looks something like this: > find . "*.txt" ./file1.txt ./file2.txt ./path/to/file3.txt >...
2
votes
4answers
2k views

Notepad++ visibility for BOM

How to use the 6.2.3 version of Notepad++.I want to know how to make visible of BOM chanracters.I tried with menu list available but no use. But those characters are available only at Linux ...
0
votes
2answers
35 views

VI - Paste something in the first position/character of a succession of lines

I would like to yank one character and paste it in the first position of the succession of lines. For example, I need to add a "#" in the front of 7 lines of a file. Someone can help me?
0
votes
1answer
82 views

How to extend vim editor to full screen in putty?

When I use vi or vim to edit files in putty, it only shows a limited lines and columns. So how to extend the editor to full screen?
0
votes
2answers
126 views

What does “vi-move” keymap in Bash's vi mode actually do?

The keymap section in the Bash Reference Manual says that one of the acceptable options is "vi-move". There doesn't seem to be any description for what this corresponds to. I'm well acquainted with "...
0
votes
2answers
291 views

How do I copy text from window text editor to nano/vi in a Putty window

I was following some guide to create key-pair for my remote linux system, one of the steps being copy the public key generated and saved on my local computer to the authorized-keys file on remote ...
3
votes
4answers
3k views

How to copy and paste between cygwin's vi/emacs and windows clipboard?

I tried to paste what I copied in windows clipboard into cygwin's vi or emacs, and it doesn't seem to work with yy (vi) or M-w (emacs). Is there a way to do it? I learned that /etc/clipboard has the ...
0
votes
0answers
28 views

Can I make vim highlight argument _names_ in C/C++ prototypes?

Can I make vim highlight argument names in C/C++ prototypes? Doesn't need to be perfect (handle function arguments, etc.).
2
votes
2answers
1k views

VI make every first letter that comes after a underscore uppercase

Found this site: http://unix.t-a-y-l-o-r.com/VMswitch.html And it works for the first character but my lines are line this this_is_a_string And I would like this This_Is_A_String Any ...
3
votes
2answers
5k views

Unix Script: Wait until a file exists

I need a script that will wait for a (examplefile.txt) to appear in the /tmp directory and once it's found to stop the program, otherwise to sleep the file until it's located So far I have: if [ ! ...
3
votes
2answers
248 views

In Vim, what are the differences between using :sus and :sh to access the shell without ending the Vim session?

I know that, while in Vim (and Vi, too, I think), if I want to temporarily access the shell I can do one of several things: Use :sh (a.k.a. :shell), then log out from the shell to return to Vim Use :...
14
votes
6answers
4k views

How to show the current Vi mode when using Vi keybindings in the shell?

I use the vi keybindings in my tcsh shell. Now, I don't know which vi mode I'm in (insert mode or command mode), which leads to a lot of frustration. Does anyone know of a way to show the current ...
7
votes
1answer
2k views

vi: what is verbose mode and when/how do I use it?

Sometimes When I'm using vi I accidentally hit caps lock when I'm in command mode. This apparently puts vi into verbose mode which I'm having trouble finding documentation about how to use. How and ...
7
votes
3answers
3k views

Error location navigation in Vim Syntastic

I've got Syntastic installed in Vim and it is finding errors perfectly (mostly in Python code I'm working on). If I jump around normally in the file I see the errors in the status bar when the cursor ...
5
votes
1answer
23 views

Trouble defining an environment variable on Cygwin

I'm using the Cygwin 64-bit installation on my Windows 7 machine. In my ~/.bash_profile, I set export JBOSS_HOME=/cygdrive/c/Program\ Files/wildfly-10.0.0.CR2/ However, when I attempt to open a ...
1
vote
2answers
85 views

Vim; Shortcut to add comment at beginning of line

When I code, I tend to execute the following manually a lot after having selected multiple lines of code. :'<,'>s/^/#/ I want to add this to my .vimrc but I am having troubles making it work. ...
4
votes
1answer
2k views

What's the difference between tiny, huge and small in vim on MacPorts?

I'm trying to install vim via MacPorts. I found this port at http://trac.macports.org/browser/trunk/dports/editors/vim/Portfile. There are variants like tiny, small and huge. Is there any way to tell ...
5
votes
2answers
7k views

Moving the the very bottom of the file with vi

No, I'm not talking about vim, I'm talking about old-school vi; because in vim you can actually issue a :bot and it'll move to the bottom of the file.
0
votes
0answers
8 views

`export default` breaks vi indentation

I'm using Ember-Cli framework and vi as my text editor, but whenever I use export default in my javascript files, vi miscalculate new lines indentation and it's becoming really annoying. My guess is ...
2
votes
4answers
438 views

In vim, what keystrokes (did I accidentally hit to) bring up :'<,'> and how do you set those marks?

I fumbled in vi and briefly saw this at the bottom of the screen, just as I was hitting ESC: :'<,'> Like it was ready for me to type an arbitrary ed command over a range spanned by the marks '...
0
votes
1answer
198 views

Vi copy and paste is not working

When I open vi/vim in conemu I am unable to paste text from clipboard (mouse right button), and unable to copy file to clipboard (mark text). However in git bash everything works fine. Any clues?
0
votes
1answer
44 views

Cannot Suspend vi with Ctrl-Z

It's on an AIX 6.1 connected via PuTTY 0.65. If I open a file and hit Ctrl-Z then. It works 1st. But when I switch back and hit Ctrl-Z again. A square cursor jumps to the bottom. I can type something ...
0
votes
0answers
32 views

Does VIMProbable have register support?

VIMProbable is a browser that works using vi keys. Does it have support for storing text in registers?
0
votes
0answers
278 views

How to send the Escape Key inside VirtualBox “vi” session?

When using a "vi" session within VirtualBox, how can I send the Esc key to change modes from input mode to command mode? Main PC is running Solaris 10 x86 with VirtualBox. VirtualBox guest O.S. is ...
2
votes
1answer
775 views

bash vi key bindings: Can I map keys? Display mode (insert vs command)?

I am a long time vi(m) user and recently made the switch to using vi key binding in bash. I can already tell that this will be an improvement, but I would like to customize a few things to really ...
2
votes
1answer
101 views

What does this vim cmd mean? :%y+

I found a command to select all text in Vi/Vim file. :%y+ Could someone explain the line, please?
1
vote
3answers
86 views

Terminal Program To Save VI State

For a few years now at work I have been using the GNOME Terminal, and have gotten very used to that. I usually organize my work by categorizing each task on its own virtual desktop, then within each ...
2
votes
3answers
870 views

Why does the 'vi' command open 'vim' editor?

I am using Ubuntu 12.04. Not that I am complaining as I like my vim and prefer its many features. However, I’m curious as to why it does it. It is not aliased in .bashrc or .bash_profile. I am not ...
0
votes
2answers
68 views

search and replace in VI

I need to convert '12.22.54' to '12:22:54' in a string below so that it works in MS SQL. cast('14-JAN-14 06.65.22 AM' as datetime),'63.124.79.253'); cast('14-JAN-14 12.22.36 AM' as datetime),'63....
1
vote
1answer
27 views

Navigating with arrow keys in vi is slow

I use rlogin to remote login from a Solaris 10 Sparc to a Solaris 10 x86 host. When using vi, navigating with the h, j, k, and l keys is very fast and smooth. However, navigating with the arrow keys ...
0
votes
1answer
138 views

How would I write this VIM command for `sed`?

I have a .csv with special characters that are wrecking an import I need to do. In VIM, I discovered away to remove the special characters with : :%s/\r//g This removes ^M from some of my broken ...
0
votes
1answer
58 views

Replace terminal's vi with windowed vim for root

I'm on Mac OS X, but I guess this is the same for other unixes. Every time I type vi on the terminal, I want to open the GUI version of Vim (in Mac OS it's called mvim). For my user, I got it ...
11
votes
5answers
9k views

Always use :set paste, Is it a good idea?

In a terminal vim, pasting clipboard data often messes up the code indent. I just knew if I uses :set paste the indent is not broken. Though, after pasting data, should I do :set nopaste again? What ...
8
votes
2answers
3k views

Vi can write to file despite file being read-only

The following example show how to create a file with only read permissions. As we can see, when I try to write to this file using the echo command I get, Permission denied. But why, in the case that ...
2
votes
1answer
203 views

Bash readline move cursor to previous forward slash

In bash , we can move back or forward by 1 word or character. Is there any option where i can move the cursor to the previous character that i specify, for example Forward Slash. ? Something like the ...
0
votes
1answer
55 views

Vi Editior Navigator Not Working Properly in Solaris 10

I am using ViEditor : This is my code of line : sh /u02/oraprod/prod/db/tech_st/11.1.0/appsutil/scripts/PROD_hooradb2/adautocfg.sh appspass=apps > $HOME/LOG/autocfg.log perl /u02/oraprod/prod/db/...
1
vote
1answer
790 views

Copy vertical text block in Vim on Mac

How do I copy a vertical text block in vim on a Mac? On a PC on would just do ctrl-c at starting point and ctrl-c at the end point and it would copy between these two coordinates. How do I do that on ...
0
votes
1answer
94 views

Vi like editing operating system wide? [closed]

Is there an extension I can install on Mac OS X that lets me use vi like commands everywhere in the operating system? And if this is not possible, is there a solution that just extends the terminal?
2
votes
2answers
186 views

In VIM, how do you delete to end of line while in command mode :?

While in VIM, I have a leader shortcut for the following: :!git commit % -m 'updated '; git push; ...