Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   vi defaults in 6.x (http://www.linux-archive.org/centos/694703-vi-defaults-6-x.html)

Frank Cox 08-16-2012 06:34 PM

vi defaults in 6.x
 
On Thu, 16 Aug 2012 13:23:28 -0500
Les Mikesell wrote:

> When I use copy/paste text into a window running vi, if there is a
> single line starting with '#', in the pasted content, it adds a # to
> all subsequent lines and indents each an additional level. Is there
> some way to eliminate this bizarre behavior, preferably globally and
> permanently so I don't have to repeat some change for every
> machine/user where I might log in?

I discovered exactly the same behaviour in the Sylpheed email editor a few
weeks back. Not only with cut-and-paste, but just typing into the editor
window. If a line starts with # then every following line after that also
gains one as you type.

--
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

08-16-2012 06:44 PM

vi defaults in 6.x
 
Frank Cox wrote:
> On Thu, 16 Aug 2012 13:23:28 -0500
> Les Mikesell wrote:
>
>> When I use copy/paste text into a window running vi, if there is a
>> single line starting with '#', in the pasted content, it adds a # to
>> all subsequent lines and indents each an additional level. Is there
>> some way to eliminate this bizarre behavior, preferably globally and
>> permanently so I don't have to repeat some change for every
>> machine/user where I might log in?
>
> I discovered exactly the same behaviour in the Sylpheed email editor a few
> weeks back. Not only with cut-and-paste, but just typing into the editor
> window. If a line starts with # then every following line after that also
> gains one as you type.

Huh. I just tried it, KDE, rxvt, CentOS 6.3, and don't see that.
# ipmitool -o supermicro sel list
1 | 08/15/2012 | 20:06:32 | Physical Security #0xaa | General Chassis
intrusion | Asserted
gets just that.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Joseph Spenner 08-16-2012 07:08 PM

vi defaults in 6.x
 
________________________________
> From: Les Mikesell <lesmikesell@gmail.com>
> To: CentOS mailing list <centos@centos.org>
> Sent: Thursday, August 16, 2012 11:23 AM
> Subject: [CentOS] vi defaults in 6.x

> When I use copy/paste text into a window running vi, if there is a
> single line starting with '#', in the pasted content, it adds a # to
> all subsequent lines and indents each an additional level.* Is there
> some way to eliminate this bizarre behavior, preferably globally and
> permanently so I don't have to repeat some change for every
> machine/user where I might log in?
>
> --
*> Les Mikesell

===
To make vi less annoying, I always create a .vimrc in the homedir of the account in question.* It contains:

syntax off
set nohlsearch
set noincsearch
:let loaded_matchparen = 1
set noai
set paste
set mouse=
set noautoindent

Hope this helps!

__________________________________________________ ____________________
If life gives you lemons, keep them-- because hey.. free lemons.
"♥ Sticker" fixer:* http://microflush.org/stuff/stickers/heartFix.html
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Les Mikesell 08-16-2012 08:14 PM

vi defaults in 6.x
 
On Thu, Aug 16, 2012 at 1:44 PM, <m.roth@5-cent.us> wrote:
> >>
>>> When I use copy/paste text into a window running vi, if there is a
>>> single line starting with '#', in the pasted content, it adds a # to
>>> all subsequent lines and indents each an additional level. Is there
>>> some way to eliminate this bizarre behavior, preferably globally and
>>> permanently so I don't have to repeat some change for every
>>> machine/user where I might log in?
>>
>> I discovered exactly the same behaviour in the Sylpheed email editor a few
>> weeks back. Not only with cut-and-paste, but just typing into the editor
>> window. If a line starts with # then every following line after that also
>> gains one as you type.
>
> Huh. I just tried it, KDE, rxvt, CentOS 6.3, and don't see that.
> # ipmitool -o supermicro sel list
> 1 | 08/15/2012 | 20:06:32 | Physical Security #0xaa | General Chassis
> intrusion | Asserted
> gets just that.

It is probably trying to be smarter than we are and doing something
context-sensitive. Try naming the file you are editing something.pl.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

08-16-2012 08:23 PM

vi defaults in 6.x
 
Les Mikesell wrote:
> On Thu, Aug 16, 2012 at 1:44 PM, <m.roth@5-cent.us> wrote:
>> >>
>>>> When I use copy/paste text into a window running vi, if there is a
>>>> single line starting with '#', in the pasted content, it adds a # to
>>>> all subsequent lines and indents each an additional level. Is there
>>>> some way to eliminate this bizarre behavior, preferably globally and
>>>> permanently so I don't have to repeat some change for every
>>>> machine/user where I might log in?
>>>
>>> I discovered exactly the same behaviour in the Sylpheed email editor a
>>> few
>>> weeks back. Not only with cut-and-paste, but just typing into the
>>> editor
>>> window. If a line starts with # then every following line after that
>>> also
>>> gains one as you type.
>>
>> Huh. I just tried it, KDE, rxvt, CentOS 6.3, and don't see that.
>> # ipmitool -o supermicro sel list
>> 1 | 08/15/2012 | 20:06:32 | Physical Security #0xaa | General Chassis
>> intrusion | Asserted
>> gets just that.
>
> It is probably trying to be smarter than we are and doing something
> context-sensitive. Try naming the file you are editing something.pl.
>
Odd. vi trythis.pl, then I highlight from another window
# semanage fcontext -a -t httpd_sys_content_t '/mipav-svn(/.*)?'
/etc/selinux/targeted/contexts/files/file_contexts.local: line 5 has
invalid regex mipav-svn/(*): Invalid preceding regular expression

, and that's what I get, with two lines.

mark


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Michael Hennebry 08-16-2012 09:33 PM

vi defaults in 6.x
 
On Thu, 16 Aug 2012, Les Mikesell wrote:

> It is probably trying to be smarter than we are and doing something
> context-sensitive. Try naming the file you are editing something.pl.

That is exactly what it isdoing.
A .pl file will probably syntaxted as a perl script.

>From man vim:
> /usr/share/vim/vimrc
> System wide Vim initializations.

--
Michael hennebry@web.cs.ndsu.NoDak.edu
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

SilverTip257 08-16-2012 11:55 PM

vi defaults in 6.x
 
+1 for .vimrc config files
vi is generally a symlink to vim these days.

@Les,
I've seen the auto-comment behavior you speak of. You may want to set
formatoptions [0] in your .vimrc

[0] http://vimdoc.sourceforge.net/htmldoc/change.html#fo-table

@Joseph:
You have autoindent specified twice - once in its abbreviated form and
then the long version.

set noai
set noautoindent

---~~.~~---
Mike
// SilverTip257 //


On Thu, Aug 16, 2012 at 3:08 PM, Joseph Spenner <joseph85750@yahoo.com> wrote:
>
> ________________________________
> > From: Les Mikesell <lesmikesell@gmail.com>
>> To: CentOS mailing list <centos@centos.org>
>> Sent: Thursday, August 16, 2012 11:23 AM
>> Subject: [CentOS] vi defaults in 6.x
>
>> When I use copy/paste text into a window running vi, if there is a
>> single line starting with '#', in the pasted content, it adds a # to
>> all subsequent lines and indents each an additional level. Is there
>> some way to eliminate this bizarre behavior, preferably globally and
>> permanently so I don't have to repeat some change for every
>> machine/user where I might log in?
>>
>> --
> > Les Mikesell
>
> ===
> To make vi less annoying, I always create a .vimrc in the homedir of the account in question. It contains:
>
> syntax off
> set nohlsearch
> set noincsearch
> :let loaded_matchparen = 1
> set noai
> set paste
> set mouse=
> set noautoindent
>
> Hope this helps!
>
> __________________________________________________ ____________________
> If life gives you lemons, keep them-- because hey.. free lemons.
> "♥ Sticker" fixer: http://microflush.org/stuff/stickers/heartFix.html
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Phil Dobbin 08-17-2012 12:57 AM

vi defaults in 6.x
 
SilverTip257 wrote:

> +1 for .vimrc config files
> vi is generally a symlink to vim these days.
>
> @Les,
> I've seen the auto-comment behavior you speak of. You may want to set
> formatoptions [0] in your .vimrc
>
> [0] http://vimdoc.sourceforge.net/htmldoc/change.html#fo-table
>
> @Joseph:
> You have autoindent specified twice - once in its abbreviated form and
> then the long version.
>
> set noai
> set noautoindent

Also, unless you want it to act like vi, use `set nocompatible` so that
it is then full vim & then your vimrc will have full effect.

Cheers,

Phil...

--
currently (ab)using
CentOS 6.3, Debian Squeeze, Fedora Beefy, OS X Snow Leopard, Ubuntu Precise

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Doe 08-17-2012 10:22 AM

vi defaults in 6.x
 
From: Les Mikesell <lesmikesell@gmail.com>

> When I use copy/paste text into a window running vi, if there is a
> single line starting with '#', in the pasted content, it adds a # to
> all subsequent lines and indents each an additional level.* Is there
> some way to eliminate this bizarre behavior, preferably globally and
> permanently so I don't have to repeat some change for every
> machine/user where I might log in?

If you do not want to change the defaults, you could temporarily call vim
without the initializations:
* vim -u NONE ...

JD
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Les Mikesell 08-17-2012 03:03 PM

vi defaults in 6.x
 
On Fri, Aug 17, 2012 at 5:22 AM, John Doe <jdmls@yahoo.com> wrote:
> From: Les Mikesell <lesmikesell@gmail.com>
>
>> When I use copy/paste text into a window running vi, if there is a
>> single line starting with '#', in the pasted content, it adds a # to
>> all subsequent lines and indents each an additional level. Is there
>> some way to eliminate this bizarre behavior, preferably globally and
>> permanently so I don't have to repeat some change for every
>> machine/user where I might log in?
>
> If you do not want to change the defaults, you could temporarily call vim
> without the initializations:
> vim -u NONE ...

That's the effect I want, since I log into a lot of different machines
and paste stuff into scripts. But, it doesn't seem to work. With
'vim -u NONE /tmp/test.pl' it still does the auto-comment stuff.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 12:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.