Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
3answers
39 views

Insert text with vi editor

I was using nano before. I'm a bit confused on how to start inserting text, sometimes I just start typing and on the bottom I see -- insert -- and I can edit and save fine. But sometimes I just skip ...
0
votes
1answer
56 views

Replace text with text from another file in a script?

I want to replace 5 rows of text in a file with the text of another file in my script, I know that running vim I can do :45,50d :r replacement.txt to delete 5 rows and then insert the entire file, ...
0
votes
1answer
53 views

How do I type numbers in vi?

Sometimes when I have to do basic editing of a file or write a basic script when I'm working in Terminal, I use vi. The problem is that when I type numbers, it goes to that line. Is there a way to ...
1
vote
2answers
59 views

Exclude dash (-) from word separators in vi

vi uses dash and space as word separators. is there any way to exclude dash from word separators ? This is required to work with the symbols generated by ctags exe. when symbol contain a "-" ,vi tags ...
0
votes
1answer
116 views

Remap shift-tab to tab in bash/screen/putty in Linux?

Well I use vi-mode in bash via the set -o vi command. What's annoying is when I'm typing words in capital then try to complete using tab but don't release the shift-key fast enough, it brings me out ...
1
vote
4answers
140 views

How do I edit a file currently being used by vi?

I am new to Linux and trying out Ubuntu 11.10. I am setting up a SSH server and one of the instructions asks me to edit sshd_config file using vi. In vi, I can't remember what happen (it's all a ...
0
votes
1answer
72 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
56 views

vi substitution matching

I am able to pattern match a regex in vi, but when I add the replacement string, vi thinks that is part of the regex match. This occurs despite use of various different delimiters. Is there some way ...
0
votes
2answers
74 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 ...
0
votes
1answer
124 views

iTerm2 Terminal Too Wide Error

I am using iTerm2 to ssh to various servers. When i use VI to edit a file i get an error that reads 'Terminal Too Wide.' To fix this I use the following command 'stty columns 120.' Is there a ...
0
votes
2answers
89 views

How to make VI use spaces instead of tab even when I press backspace key?

When I tried to use yml, it requires NO TAB, ONLY SPACE policy. I realized I need a special setting for this. Anyway, I can't live without tabs. So I want to make my VI behave like this. When I ...
3
votes
5answers
126 views

In Vi, how do I map “:t” equal to “:tabnew”?

I don't want to always type the word. it's annoying.
1
vote
1answer
64 views

Readline in vi mode: how can I enable up/down arrows?

When bash has vi bindings available (set -o vi), up/down arrows work in both command and insertion mode. When I setup readline's ~/.inputrc to use vi mode (set editing-mode vi), applications like ...
10
votes
2answers
53 views

vi / vim abrumpt buffer movements within window

When using :set wrap in vi/vim, the contents of an entire wrapped line are placed in the display buffer upon moving the cursor into a new line, even when navigating through a file by display line ...
1
vote
1answer
218 views

how to block select, move, copy, paste in vi?

I am trying to migrate from Notepad++ to vi. In N++, I constantly rely on block edit (or "column mode"), as it is a great increase in productivity: I can select a rectangular area of text by pressing ...
2
votes
1answer
188 views

Whats the difference between vi editor in Red Hat linux and Ubuntu?

I realize a difference in vi editor of ReD Hat and Ubuntu. In my company, I'm working in Red Hat. In that, the vi editing commands working as usual. Say, 'dd' to delete,'p' to paste, 'yy' to yank, ...
0
votes
1answer
135 views

Mac OS X. Vi - E185 cannot find color scheme

Editing with vi in terminal gives the following error. E185: Cannot find color scheme metacosm. I think the problem is not im my .vimrc (no strange carrage returns). I strongly suspect this problem ...
1
vote
2answers
208 views

Vi on Linux: show ^M line endings for DOS-format files

On Solaris, if you open a file in vi that has Windows line endings, this shows up as ^M at the end of every line. On Linux, vi is cleverer and understands the Windows file format, and does not ...
0
votes
1answer
211 views

mingw/msys with vi, ctags support?

I'm trying to run vim on win7 inside msys (which isnt entirely necessary, i know i can run gvim in windows, but i'd like to be able to use vi inside terminal) everything installs fine with mingw-get ...
2
votes
1answer
235 views

How to switch comfortably to vi command mode on the zsh command line?

In vi, I have mapped 'jj' to escape to be able to switch to command mode without using the annoying escape key. Now I want to have the same for command line editing for which I use vi-mode. I already ...
2
votes
2answers
64 views

Can I display emacs buffer modification history?

I've used vi for decades, but I'm trying to improve my emacs skills. In vi, I often check the status of my buffer by issuing this command: :w !diff - % Is there a command in emacs that I can use ...
5
votes
8answers
204 views

vi / vim tutorial recommendations

Being a common tool for *nix System Administrators, I'm looking for recommendations for vi/vim tutorials. After seeing this 'how do I do [this] in vim' question in Stack Overflow, I realize that I ...
0
votes
2answers
146 views

Install VIM in Cygwin

I have installed cygwin in my windows machine and I have also selected some additional packages as part of my installation (like gcc etc). Now I want to add vim also to my existing cygwin set up. What ...
0
votes
2answers
27 views

Forcing highlighter to html in VI when it fails to recognize an input file

I'm having trouble editing HTML in an older version of VI(M). VIM - Vi IMproved 6.3 (2004 June 7, compiled [...] 2005). When reading .sh shell scripts there is no problem, though. It doesn't ...
1
vote
1answer
66 views

Vi: how can I paste the last string of text that I entered when I was in insert mode?

How can I paste the last string of text that I entered when I was in insert mode? I think I've done this before on accident but I can't recall how.
2
votes
3answers
172 views

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

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 ...
0
votes
0answers
121 views

Vim shell bindings (set -o vi) on iTerm2

Trouble with history when using bash vi bindings on iTerm2 on Lion. (I had the same problem with iTerm when I switched to Lion.) Hard to explain exactly, but when I hit k to go to most recent ...
0
votes
0answers
34 views

How do I set the meta key with the meta convert feature in most *nix terminals?

.Xdefaults: xterm*eightBitInput: false This command apparently allows you to use a meta key + something to enter vi editing mode in a linux terminal. But what is the meta key and how do you set the ...
0
votes
1answer
32 views

How can I save settings in VI?

I have changed tab settings in VI with set tabstop=4. But when I restart VI, the settings are restored. How can I save the settings?
4
votes
2answers
80 views

Getting vi/vim syntax highlighting used by certain user

At work most web-development we do, is done in vi/vim, on a debian-server. Sometimes we have to alter some files as root, and the syntax-highlighting-model of that user (root) is absolutely awesome. ...
3
votes
1answer
255 views

How can I edit a google doc with vi and automatically update the original doc in the cloud when I write the file?

I'm using ubuntu 11.04. I have installed googlecl which claims to allow me to edit google doc files with vim. I have a google doc "test": google docs edit --title "test" --editor vim opens the file ...
2
votes
3answers
65 views

Target one line only in vim for a text substitution

Is there a way in vi(m) to target one specific line in a file for a string substitution? I need to frequently add SSL SHA fingerprints from Web servers to my Mercurial .hgrc. I can grab the required ...
2
votes
2answers
367 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 ...
3
votes
3answers
73 views

VI adding # moves cursor to beginning of the line

Why does vim move me to the begining of a line when I press # for a comment or remark say in a perl file? Why would I not want my comment to be indented at the same level of the current code?
1
vote
2answers
48 views

CTRL-\ vs <C-\> in Vim help

From Vim documentation: Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to Normal mode from any other mode. So what is the difference between CTRL-\ and <C-\>? ...
0
votes
0answers
142 views

Why can't I open a text file I just created?

I'm on Fedora distro server and OSX on Mac as client connected via crossover cable using a local IP. Fedora is serving web pages and the Mac is browsing and connected via ssh on the terminal. I was ...
7
votes
3answers
152 views

vi: how can I jump to end of file with a new line appended?

Here's an answer I want about 5 times a day. In vi, the command to go to the end of the file is G. But that always leaves me at the start of the last line of the file, if files don't have a blank ...
1
vote
1answer
70 views

Readline in vi mode: how can I access previously executed commands?

I recently followed this post's advice on how to make vi more ubiquitous and I changed my readline mode to vi. Before I did this, I could use the arrow keys to access previously executed commands. ...
0
votes
2answers
727 views

Ubuntu + Unable to Edit .bashrc file because of ReadOnly

To Remove Issue of WARNING: Unable to verify SSL certificate for api.heroku.com To disable SSL verification, run with HEROKU_SSL_VERIFY=disable By Googling I got few solution. One of them is added ...
3
votes
6answers
2k views

UNIX - How to copy and paste between different bash windows with files opend with VI?

Lets say I log in to bash, open a file in vi, then using alt-f2 I open a new terminal. After logging in I navigate to a second file and open that in vi. How can I CnP between these two files? I found ...
2
votes
2answers
105 views

non-destructive piping in vim?

Is there a way to pipe selected text through an external command in vim, but not to replace the selected text with the output? Occasionally I want to copy something in a vim buffer to the X clipboard, ...
1
vote
1answer
102 views

How to connect an old dumb terminal to a modern PC?

Could one connect an old dumb terminal to a modern PC? I have this fantasy of hacking around with some vi on an old ADM-3A, but have no idea if it's networkable with modern hardware.
4
votes
2answers
231 views

How to use a pipe to edit a file with vi

Lets say I have a file called file.txt. In it is a name of a file that I want to edit with vi. I want to do something like this so that I can edit the file: cat file.txt | vi However, that doesn't ...
0
votes
3answers
45 views

How to using redirection to create a file

I have a linux script that generates a string and prints it to the console. I want this string to be the name of a file and open it for editing in vi. How can this be done?
0
votes
1answer
48 views

How to navigate word-wrapped text files in vi

I find that navigating text files that have been word wrapped somewhat difficult in vi. If there is a line that is word-wrapped and it goes down several lines, then it is hard to navigate around this ...
2
votes
1answer
100 views

bash vi mode: what is (arg: N)?

I am using vi mode in a bash shell. If I enter insert command mode and type a number from 1-9 (eg: 5, in the example below), I get the following prompt: (arg: 5) <cursor> What does this ...
0
votes
2answers
88 views

Is there a setting that will allow vim to remember the column it was on, even if traverses a line who's EOL is less?

Is there a setting that will allow vim to remember the column it was on, even if traverses a line who's EOL is less? Consider the following lines: foo bar foo foo bar Say my cursor position is the ...
1
vote
2answers
467 views

how to write into file after doing sudo vi /dir to file

i have ubuntu 10.10 installed on a box. and i ssh to it from another computer. when i do sudo vi /var/www/page.php i enter a text editor. when when i try to type i hear that ding noise as in i cant ...
1
vote
2answers
179 views

Create file with 751 permissions at creation

I keep creating practice perl scripts in a linux directory using vi <filename> and need to chmod 751 <filename> before I can run it as I wish to. I'm sure there is a simple way to default ...
0
votes
1answer
583 views

How to pass vim buffer contents through shell command and capture the output to a split window

I've read lots of threads about running shell commands from vim, lots of documentation on vim commands, .vimrc and all that, but I just can't seem to understand the "ex" language or vim mappings well ...

1 2