Stair stepping

22 views
Skip to first unread message

Harry Putnam

unread,
May 2, 2010, 10:41:42 AM5/2/10
to vim...@googlegroups.com
My setup: Linux (gentoo) 2.6.33-gentoo
vim VIM - Vi IMproved 7.2
compile info inlined at the end of this post

For some time now I've been noticing when I paste scripting code
into vim I'm getting the stair stepping effect.

It didn't used to a few mnts back..

I know about paste on/off in vim and have the toggle set to F4.
So I have to toggle paste on, do the paste and then toggle paste off
since having paste on messes with numerous other settings.

However, there was a time, maybe a few mnths ago, when all that
toggling was not necessary.

Maybe I lost a few lines out of ~/.vimrc or maybe I didn't compile
vim the same... I don't know what the cause is but wondered if anyone
here knows if there is a way to set vim up (other than paste on/off)
so that pasting can happen without stair stepping.

Here is an example of what I'm talking about.

cut/copy this paragraph
my %h1 = (
f1 => "./b/f1",
fa => "./b/c/fa",
f2 => "./b/l/c/f2",
fb => "./b/g/f/r/fb"
);


paste it into an open vim file in insert mode.

my %h1 = (
f1 => "./b/f1",
fa => "./b/c/fa",
f2 => "./b/l/c/f2",
fb => "./b/g/f/r/fb"
);
------- --------- ---=--- --------- --------
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 21 2010 22:01:44)
Included patches: 1-411
Modified by Gentoo-7.2.411
Compiled by root@reader
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv
+cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval
+ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer
+fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall
+linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse
-mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra
+perl +postscript +printer +profile +python +quickfix +reltime +rightleft -ruby
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects
+title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim +xsmp_interact
+xterm_clipboard -xterm_save
system vimrc file: "/etc/vim/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: i686-pc-linux-gnu-gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -march=i686 -pi
pe -D_FORTIFY_SOURCE=1 -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
I/usr/lib/perl5/5.10.1/i686-linux/CORE -I/usr/include/python2.6 -pthread
Linking: i686-pc-linux-gnu-gcc -Wl,-E -Wl,-O1 -o vim -lXt -lcurses -lacl -lgpm -W
l,-E -fstack-protector -L/usr/lib/perl5/5.10.1/i686-linux/CORE -lperl -lutil -lc -L/usr
/lib/python2.6/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Tony Mechelynck

unread,
May 2, 2010, 1:31:17 PM5/2/10
to vim...@googlegroups.com, Harry Putnam
On 02/05/10 16:41, Harry Putnam wrote:
> My setup: Linux (gentoo) 2.6.33-gentoo
> vim VIM - Vi IMproved 7.2
> compile info inlined at the end of this post
>
> For some time now I've been noticing when I paste scripting code
> into vim I'm getting the stair stepping effect.
>
> It didn't used to a few mnts back..
>
> I know about paste on/off in vim and have the toggle set to F4.
> So I have to toggle paste on, do the paste and then toggle paste off
> since having paste on messes with numerous other settings.
>
> However, there was a time, maybe a few mnths ago, when all that
> toggling was not necessary.
>
> Maybe I lost a few lines out of ~/.vimrc or maybe I didn't compile
> vim the same... I don't know what the cause is but wondered if anyone
> here knows if there is a way to set vim up (other than paste on/off)
> so that pasting can happen without stair stepping.
>
> Here is an example of what I'm talking about.

According to ":help 'paste'", setting paste is not necessary in gvim,
nor in a terminal where Vim handles the mouse clicks itself. So: are you
sure you're using the same terminal as a few months ago? Are the mouse
actions (when Vim runs in that terminal) handled by the terminal or
passed to Vim? Does it make a difference if you use "*P rather than
middle-click (or than the terminal's Edit => Paste menu if any)?


Best regards,
Tony.
--
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it on
the computer.

Harry Putnam

unread,
May 3, 2010, 5:22:47 PM5/3/10
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> writes:

> According to ":help 'paste'", setting paste is not necessary in gvim,

I'm not using gvim. I should have made it clearer

> nor in a terminal where Vim handles the mouse clicks itself. So: are
> you sure you're using the same terminal as a few months ago? Are the
> mouse actions (when Vim runs in that terminal) handled by the terminal
> or passed to Vim? Does it make a difference if you use "*P rather than
> middle-click (or than the terminal's Edit => Paste menu if any)?

I don't know what `*P' is. I use middle click.

I do not know if the terminal has changed . I use xterms almost
exclusively and prefer vim in an xterm... not gvim.

I normally start vim in an xterm with the usual
vim filename

Typing in an xterm:
xterm -version
XTerm(256)

Not some gnome terminal, KDE terminal or some other jive.. just a
regular xterm.

Gary Johnson

unread,
May 3, 2010, 6:32:16 PM5/3/10
to vim...@googlegroups.com
On 2010-05-03, Harry Putnam wrote:
> Tony Mechelynck <antoine.m...@gmail.com> writes:
>
> > According to ":help 'paste'", setting paste is not necessary in gvim,
>
> I'm not using gvim. I should have made it clearer
>
> > nor in a terminal where Vim handles the mouse clicks itself. So: are
> > you sure you're using the same terminal as a few months ago? Are the
> > mouse actions (when Vim runs in that terminal) handled by the terminal
> > or passed to Vim? Does it make a difference if you use "*P rather than
> > middle-click (or than the terminal's Edit => Paste menu if any)?
>
> I don't know what `*P' is. I use middle click.
>
> I do not know if the terminal has changed . I use xterms almost
> exclusively and prefer vim in an xterm... not gvim.
>
> I normally start vim in an xterm with the usual
> vim filename
>
> Typing in an xterm:
> xterm -version
> XTerm(256)
>
> Not some gnome terminal, KDE terminal or some other jive.. just a
> regular xterm.

That's how I use Vim, too. My pasting works fine, like yours used
to. I compared by version information with yours and I didn't see
any X- or mouse-related differences that I thought were relevant.
I'll list the differences below anyway. My Vim is also 7.2.411.

$ xterm -version
X.Org 6.8.2(225)

How about the setting of 'mouse'? Mine is

:set mouse?
mouse=a

Version differences:

Yours | Mine
-----------------------------------------------------------
Huge version without GUI. | Normal version with GTK2 GUI.
+arabic | -arabic
-balloon_eval | +balloon_eval
-browse | +browse
++builtin_terms | +builtin_terms
+dialog_con | +dialog_con_gui
-dnd | +dnd
+emacs_tags | -emacs_tags
+farsi | -farsi
+keymap | -keymap
+langmap | -langmap
-mouseshape | +mouseshape
+mouse_dec | -mouse_dec
+mouse_netterm | -mouse_netterm
-netbeans_intg | +netbeans_intg
+perl | -perl
+profile | -profile
+python | -python
+rightleft | -rightleft
-toolbar | +toolbar
+xfontset | -xfontset
-xim | +xim

Compilation and Linking:

Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0
-I/usr/lib/gtk-2.0/include -I/usr/X11R6/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0
-I/usr/include/freetype2 -I/usr/include/freetype2/config
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2
-I/usr/X11R6/include

Linking: gcc -L/usr/X11R6/lib -L/usr/local/lib -o vim
-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -lm -lncurses
-lselinux -lacl -lgpm

Regards,
Gary

Benjamin R. Haskell

unread,
May 4, 2010, 12:24:19 AM5/4/10
to vim...@googlegroups.com
On Mon, 3 May 2010, Harry Putnam wrote:

> Tony Mechelynck writes:
>
> > According to ":help 'paste'", setting paste is not necessary in
> > gvim,
>
> I'm not using gvim. I should have made it clearer
>
> > nor in a terminal where Vim handles the mouse clicks itself. So: are
> > you sure you're using the same terminal as a few months ago? Are the
> > mouse actions (when Vim runs in that terminal) handled by the
> > terminal or passed to Vim? Does it make a difference if you use "*P
> > rather than middle-click (or than the terminal's Edit => Paste menu
> > if any)?
>
> I don't know what `*P' is. I use middle click.
>
> I do not know if the terminal has changed . I use xterms almost
> exclusively and prefer vim in an xterm... not gvim.
>
> I normally start vim in an xterm with the usual
> vim filename
>
> Typing in an xterm:
> xterm -version
> XTerm(256)
>
> Not some gnome terminal, KDE terminal or some other jive.. just a
> regular xterm.

I also use Gentoo.

xterm-256 wasn't in portage a couple months ago, so your terminal has
certainly changed in the last few months. Using all combinations of
vim-7.2.{182,411} and xterm-{223,256}, though, I see the undesired
behavior. It looks like older xterms (including 243, which was what I
had installed when I started exploring this) have a USE-flag called
'paste64', which apparently adds the --enable-paste64 compile flag.

My guess is that --enable-paste64 (which is no longer in the ebuild) is
essentially built-in at this point.

Upgrading back to xterm-256 and adding the line:
UXTerm*allowWindowOps: true
to my ~/.Xdefaults file solved the problem[1]. IIUC, this enables
'bracketed paste' mode[2] (possibly other things?), but may have
security implications[1b].

--
Best,
Ben

[1] discovered via these lines in the ebuild:
if use paste64 ; then
elog "bracketed paste mode requires the allowWindowOps resource to be true"
elog "which is false by default for security reasons (see bug #91453)."
elog "To be able to use it add 'allowWindowOps: true' to your resources"
fi
[1b] bug #91453: http://bugs.gentoo.org/91453

[2] http://www.xfree86.org/current/ctlseqs.html#Bracketed%20Paste%20Mode

Tony Mechelynck

unread,
May 5, 2010, 10:29:41 PM5/5/10
to vim...@googlegroups.com, Harry Putnam
On 03/05/10 23:22, Harry Putnam wrote:
> Tony Mechelynck<antoine.m...@gmail.com> writes:
>
>> According to ":help 'paste'", setting paste is not necessary in gvim,
>
> I'm not using gvim. I should have made it clearer
>
>> nor in a terminal where Vim handles the mouse clicks itself. So: are
>> you sure you're using the same terminal as a few months ago? Are the
>> mouse actions (when Vim runs in that terminal) handled by the terminal
>> or passed to Vim? Does it make a difference if you use "*P rather than
>> middle-click (or than the terminal's Edit => Paste menu if any)?
>
> I don't know what `*P' is. I use middle click.

not star-bigpee but doublequote-star-bigpee. When used at the keyboard
in Normal mode, this means "put the X selection before the cursor". Or
use a lowercase p instead of an uppercase (i.e. shifted) P to put after.
Or use + (plus) instead of * (star) between the " (double quote) and the
P or p to put from the clipboard (as with Edit=>Paste) instead of the
X11 selection (as with middle-click). (Note: Vim terminology uses "put",
"yank" and "delete" instead of "paste" "copy" and "cut" respectively.
Any register can be involved.)

See
:help p
:help P
:help registers
:help gui-selections
:help x11-selection

>
> I do not know if the terminal has changed . I use xterms almost
> exclusively and prefer vim in an xterm... not gvim.
>
> I normally start vim in an xterm with the usual
> vim filename
>
> Typing in an xterm:
> xterm -version
> XTerm(256)

Hm. Here (on openSUSE Linux 11.2) the answer is:

X.Org 6.8.99.903(242)

But I usually use gvim, or sometimes Vim in konsole or in the pure-text
Linux console (accessed by Ctrl-Alt-F1 fot /dev/tty1 to Ctrl-Alt-F6 for
/dev/tty6, come back to X by Ctrl-Alt-F7). The latter is very handy when
I decide to boot without X (into runlevel 3 instead of the default 5)
for maximum throughput of console-only operations.

>
> Not some gnome terminal, KDE terminal or some other jive.. just a
> regular xterm.
>

Best regards,
Tony.
--
Molecule, n.:
The ultimate, indivisible unit of matter. It is distinguished
from the corpuscle, also the ultimate, indivisible unit of matter, by a
closer resemblance to the atom, also the ultimate, indivisible unit of
matter ... The ion differs from the molecule, the corpuscle and the
atom in that it is an ion ...
-- Ambrose Bierce, "The Devil's Dictionary"

Harry Putnam

unread,
May 11, 2010, 9:48:41 AM5/11/10
to vim...@googlegroups.com
Gary Johnson <gary...@spocom.com> writes:

>> Not some gnome terminal, KDE terminal or some other jive.. just a
>> regular xterm.
>
> That's how I use Vim, too. My pasting works fine, like yours used
> to. I compared by version information with yours and I didn't see
> any X- or mouse-related differences that I thought were relevant.
> I'll list the differences below anyway. My Vim is also 7.2.411.

Thanks for a comprehensive post. Lots of stuff to look at and I don't
know what 95 % of it does...... even though I've used vim more or less
continuously for some 12-13 yrs now.

mouse=a here too. But I see the xterm versions are different.

I just use gentoo installer `emerge' and don't fuss with the compile
myself. But I do have a fairly long .vimrc

It may just be cruft in that... I think I'll post it inline below.
Maybe someone will see a problem there... its certainly a sloppy mess.
I don't use half of those iab settings... maybe I'll clean them up in
the sweet bye and bye...

cat .vimrc
------- --------- ---=--- --------- --------
set nocompatible " Use Vim defaults (much better!)
"" [HP 09/24/09 10:03 `filetype plugin on' is here from the README
" on perl-support.zip from:
" http://www.vim.org/scripts/script.php?script_id
filetype plugin on "
" # [HP 09/24/09 16:05 Ditto with the time/date settings,,
" perl-support/templates/* uses them]
" orig let g:Perl_FormatDate = '%D'
" orig let g:Perl_FormatTime = '%H:%M'
" orig let g:Perl_FormatYear = 'year %Y'
let g:Perl_FormatDate = '%m%d%y'
let g:Perl_FormatTime = '%H%M%S'
let g:Perl_FormatYear = 'year %Y'

filetype indent on " load indent.vim

"" [HP 09/24/09 16:07 This part below is from `sc' on vim list
" It's a way to get a new perlscript chmodded 755 but still let
" the perl-support plugins work for inserting stuff.
" From: sc <toot...@swbell.net>
" Subject: Re: How to alter the behavior of perl-support plugin
" Newsgroups: gmane.editors.vim
" To: vim...@googlegroups.com
" Date: Thu, 24 Sep 2009 15:47:11 -0500
" Message-ID: <200909241547....@swbell.net>
" http://vim.wikia.com/wiki/Setting_file_attributes_without_reloading_a_buffer
function! SetExecutableBit()
if &modified
write
endif
" let fname = expand("%:p")
" checktime
" execute "au FileChangedShell " . fname . " :echo"
" silent !chmod 755 %
" checktime
let ta = system("chmod 755 " . expand('%'))
" execute "au! FileChangedShell " . fname
endfunction
command! Xbit call SetExecutableBit()
"" ]
"" ]

"""" Folding
set foldmethod=syntax " By default, use syntax to determine folds
set foldlevelstart=99 " All folds open by default

set vb t_vb= " Disable all bells/flashing.
set bs=2 " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
" set rtp+=~/.vim/xpt

set backup " keep a backup file
set viminfo='20,\"100 " read/write a .viminfo file, don't store more
" than 50 lines of registers
set history=200 " keep 50 lines of command line history
set ruler " show the cursor position all the time
"" [HP 092809_225105 laststatus=2 jacks up ruler ]
set laststatus=2
"" [HP Kill the splash screen
set shortmess+=I
"" ]
"" [HP 10/03/09_11:26:35 replaced set tabstop=3 with ts=2 sw=2 et
"" From: Tim Chase <v...@tim.thechases.com> on vim list
"" Date: Sat, 03 Oct 2009 10:35:24 -0500
"" Message-ID: <4AC76F3C...@tim.thechases.com>
set ts=2 sw=2 et
set tabstop=3
'"" ]
set pastetoggle=<F4>

"" [HP Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
endif
"" ]

"" [HP Only do this part when compiled with support for autocommands.
if has("autocmd")

" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=72
autocmd BufRead .vimrc set tw=72
augroup cprog
" Remove all cprog autocommands
au!

" When starting to edit a file:
" For C and C++ files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd FileType * set formatoptions=tcql nocindent comments&
autocmd FileType c,cpp set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
augroup END
"" ]
"" [HP Set these so we get sensible formating in these files with no tabs
"" and a sensible shiftwidth
:au FileType perl,awk,sh,c set shiftwidth=2 expandtab
""======== BEGIN mappings ==========
nnoremap \tp :set invpaste paste?<CR>
nmap <F4> \tp
imap <F4> <C-O>\tp
"" ]

"" [HP 092809_230720 What the hell does this do
:nmap \ve :if &ve == '' <Bar>
\ set ve=all <Bar>
\ else <Bar>
\ set ve= <Bar>
\ endif <bar>
\ set ve? <Cr>
"" ]

"" [HP map z to act as a register selector eliminating the need to type
"" <shift><double quote>
nnoremap z "z
"" ]

"" [HP Make p in Visual mode replace the selected text with the "" register.
vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
"" ]

"" [HP Don't use Ex mode, use Q for formatting
map Q gq
"" ]

map ,d "=strftime("%c")<cr>p
nmap <F3> :g/^\(CVS:\)\( $\\|.*--[^ ]*$\\|.*Lines beginning\)/d<CR>:%s/^CVS: //
nmap <F10> :.,$s/^/## /
map <F8> :s/^## //<CR>j
map <F7> :s/^/## /<CR>j
"" [HP Make Insert key non-operational
imap <Ins> <Nop>
"" ]

"" ===== BEGIN iab ===========
iab sepr ------- ------- ---=--- ------- -------
"" ===== BEGIN Bash/Ksh Stuff =============
iab kbase myscript=$(basename $0)
iab bbase myscript=$(basename $0)
iab HERE usage(){<cr>cat >&2 <<EOM<cr>EOM<cr>} #end usage<up><up><c-o>o<left>
iab bget while getopts "flags" opt; do<cr> case "$opt" in<cr><cr> esac<cr>done
iab hpcom <C-R>=strftime("# [HP %y%m%d_%H%M%S #]")<cr><left><left><left>
iab ac>> ####>>>### Accumulative Notes ##########
iab ac<< ####<<<### Accumulative Notes ##########
iab hpev <C-R>=strftime("ev %y%m%d\n\nev")<cr><up>
iab hpcomv <C-R>=strftime("\"\" [HP %m%d%y_%H%M%S ]")<cr><left>
iab hpd <space><space>print "hpdb \n";<left><left><left><left><left><left>
"" ===== BEGIN Perl Stuff =============
"" print clause with new line (print $_ . "\n";
iab nl . "\n";<C-O>7h
iab pfile use File::Find;<CR><CR>## $File::Find::dir = /some/Path/<CR>## $_ = foo.ext<CR>## $File::Find::name = /some/path/foo.ext<CR><CR>find(\&wanted, @srdir);<CR>sub wanted {<CR>}<left><left>
"open my $fh,'>',$var or die \"Cannot open $var: $!;
iab popn open my $fh,'>',$var or die \"Cannot open $var: $!\";
"iab popt if($opt_) {
"iab pfori
iab pds sub PaddedDateStr {<CR> my($mon,$mday,$year,$hour,$min,$sec,$wday) =<CR> (localtime(time))[4,3,5,2,1,0,6];<CR> $year -= 100;<CR> ## prints 05 (with %02d)<CR> $mon += 1;<CR> my $PaddedDateStr = sprintf"%02d%02d%02d%s%02d%02d%02d%s%d",<CR> $mon,$mday,$year,"_",$hour,$min,$sec,"_",$wday;<CR> return $PaddedDateStr;<CR>}
iab pbase my $myscript;<CR>($myscript = $0) =~ s/^.*\///;<CR>
iab ptime my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst);<CR>($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =<CR> localtime(time);<CR>
iab png #!/usr/local/bin/perl -w<c-o>a
iab ulib use lib qw(/home/reader/scripts/lib); ## location of dater.pm
iab qp print \n"; <C-O>4h
iab pget ## ==== BEGIN Getopts section ====<CR>## Declare vars inside our()<CR>our ( );<CR>use Getopt::Std;<CR>my $optstr =" ";<CR>getopts($optstr);<C-O>?" "?s+1<CR>
iab popt if($opt_){<CR><CR>}<up><up><right><right><right><right><right><right><right>
iab ptrip print "Usage tripped at <" . __LINE__ . ">\n";
iab pmy \`$myscript '
""iab pdie or die ": $!";<ESC>hhhhhs
iab pdie or die "Can't open $ : $!";<C-O>6h
iab par my @ar = ("one","two","three","four","five");<CR>
iab pwh while(<>){}
iab pel elsif(){<CR>}<C-O>?()?s<CR>
iab pif if(){<CR>}<C-O>?()?s<CR>
iab pnarg if(!@ARGV \|\| $ARGV[0] eq "help"){<CR> usage();<CR> exit;<CR>}<C-O><CR>
iab parg if(@ARGV){<CR><CR>}<C-O>k
iab pn . "\n";
iab pst use strict;<CR>use warnings;
iab pu sub usage {<CR> print "<CR>Purpose:<CR>Usage:<CR><CR>";<CR>}<CR><ESC>kkkkA
"" ==== End Perl stuff ========================
iab ydate <C-R>=strftime("%b %d %T %Y")<cr>
iab sdate <C-R>=strftime("%s")<cr>
iab vkeyz <C-R>=strftime("\" Keywords:\n\" %b %d %T %Y %w\n\" &&")<cr><up><up><c-o>A
iab skeyz <C-R>=strftime("# Keywords:\n\# [Keydate:%y%m%d_%H%M%S_%w]\n# &&")<cr><up><up><c-o>A

"" [HP This is disabled, because it changes the jumplist. Can't use
"" CTRL-O to go back to positions in previous files more than once.
if 0
" When editing a file, always jump to the last cursor position.
" This must be after the uncompress commands.
autocmd BufReadPost * if line("'\"") && line("'\"") <= line("$") | exe "normal `\"" | endif
endif
"" ]

"" [hp added from section at :he color [xterm ]May 20 2000]
endif " has("autocmd")

if &term =~ "xterm"
if has("terminfo")
set t_Co=8
set t_Sf=<Esc>[3%p1%dm
set t_Sb=<Esc>[4%p1%dm
else
set t_Co=8
:set t_Sf=<Esc>[3%dm
:set t_Sb=<Esc>[4%dm
:endif
endif
"" ]

"" Elisp
if has("fname_case")
au BufNewFile,BufRead *.el,*.elc,.emacs,.gnus set ft=lisp
else
au BufNewFile,BufRead *.el set ft=lisp
endif

"" [HP M4]
if has("fname_case")
au BufNewFile,BufRead *.m4 set ft=sh
else
au BufNewFile,BufRead *.m4 set ft=sh
endif

"" [ HP To test your color setup, a file has been included in the
"" Vim distribution. To use it, execute these commands:
"" :e $VIMRUNTIME/syntax/colortest.vim
"" :so %
"" [HP 093009_111107
"" Also a good way to see the names of colors
"" vim knows about]
"" ]
set background=dark
set nohlsearch

"" [HP 093009_104047 this one is put here to repair whatever plugin
"" xpt is doing to the statusline, where it shows `<' where line number
"" should be
autocmd VimEnter * :set statusline&
"" ]

Harry Putnam

unread,
May 11, 2010, 10:03:44 AM5/11/10
to vim...@googlegroups.com
"Benjamin R. Haskell" <v...@benizi.com> writes:

[...]

>> Not some gnome terminal, KDE terminal or some other jive.. just a
>> regular xterm.
>
> I also use Gentoo.
>
> xterm-256 wasn't in portage a couple months ago, so your terminal has
> certainly changed in the last few months. Using all combinations of
> vim-7.2.{182,411} and xterm-{223,256}, though, I see the undesired
> behavior. It looks like older xterms (including 243, which was what I
> had installed when I started exploring this) have a USE-flag called
> 'paste64', which apparently adds the --enable-paste64 compile flag.
>
> My guess is that --enable-paste64 (which is no longer in the ebuild) is
> essentially built-in at this point.
>

> Upgrading back to xterm-256 and adding the line:
> UXTerm*allowWindowOps: true
> to my ~/.Xdefaults file solved the problem[1]. IIUC, this enables
> 'bracketed paste' mode[2] (possibly other things?), but may have
> security implications[1b].

I tried... putting `UXTerm*allowWindowOps true'' into .Xdefaults
which over the years I've ended up symlinking to .Xresources and
.xresources

So all were covered.

Started a second X session by first `Ctrl-Alt F2' to get a different
vt in console mode... then `startx -- :1'

Starting X on a different display, which should have activated anthing
new in ~/.Xdefaults, but I still see the stair stepping

However the technique Tony M mentioned: "*P
(Double Quote Asterisk Upper/lowercase P/p) works without stair
stepping. ... I didn't now that trick....

You don't have to be in insert mode which is handy... often I loose a
few characters from a piece of pasting because vim was in command or
maybe its normal mode, and I try to paste with middle mouse.

Harry Putnam

unread,
May 11, 2010, 10:27:33 AM5/11/10
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> writes:

>> Typing in an xterm:
>> xterm -version
>> XTerm(256)
>
> Hm. Here (on openSUSE Linux 11.2) the answer is:
>
> X.Org 6.8.99.903(242)

Its starting to look like that might be the culprit... my later
version of xterm.... I haven't installed an older version to test
yet.

> not star-bigpee but doublequote-star-bigpee. When used at the keyboard
> in Normal mode, this means "put the X selection before the cursor". Or
> use a lowercase p instead of an uppercase (i.e. shifted) P to put
> after. Or use + (plus) instead of * (star) between the " (double
> quote) and the P or p to put from the clipboard (as with Edit=>Paste)
> instead of the X11 selection (as with middle-click). (Note: Vim
> terminology uses "put", "yank" and "delete" instead of "paste" "copy"
> and "cut" respectively. Any register can be involved.)

Thanks for `"*P'... I didn't now that trick.. and it pastes
flawlessly. It's handy in that it doesn't need vim to be in insert
mode. I often lose little bits of pasted code trying to paste into
vim with middle mouse when vim is NOT in insert mode. (Might lose
a few characters, until vim sees one that turns on insert mode)

Might take awhile to acclimate my retarded hands to use "*P, its a
little awkward to hit quickly.

But I suppose it could become like `:wq' if I used it often enough.

One thing though... I don't see a bit of difference when using upper
or lower case P/p. The pasting goes ahead of the cursor in either
case.

If I open vim, go to insert mode... and scroll down a few lines so I
can tell where a paste/put is going.... then back to normal mode, and
put some perl code with `"*P', clear that out and try it again with
`"*p'... either way the code goes in ahead of the cursor.


> But I usually use gvim, or sometimes Vim in konsole or in the
> pure-text Linux console (accessed by Ctrl-Alt-F1 fot /dev/tty1 to
> Ctrl-Alt-F6 for /dev/tty6, come back to X by Ctrl-Alt-F7). The latter
> is very handy when I decide to boot without X (into runlevel 3 instead
> of the default 5) for maximum throughput of console-only operations.

Yeah, I used to use that often... here's another one.
Ctrl-alt-F2 to get a new vt in console mode... then
`startx -- :1 (starts another X session on a different display)

You can go back to the first Xsession with C-A-7, or back to the
second one with C-A-8. Its a way to startx after making changes to
.Xdefaults or whatever, and see what any changes did, without have to
back out of your current session. Or restart it.

Benjamin R. Haskell

unread,
May 11, 2010, 11:36:23 AM5/11/10
to vim...@googlegroups.com
On Tue, 11 May 2010, Harry Putnam wrote:

> "Benjamin R. Haskell" writes:
>
> > [...] adding the line:
> > UXTerm*allowWindowOps: true
> > to my ~/.Xdefaults file solved the problem[...]
>
> I tried... putting `UXTerm*allowWindowOps true'' into .Xdefaults

My line may have been too specific. In the bug report my previous post
referenced[1], the line causing problems was the more general:

*allowWindowOps: false

I used UXTerm in mine, because... well... I use uxterm. So, maybe try
without the class name (UXTerm):

*allowWindowOps: true

or with the class name for xterm proper (XTerm):

XTerm*allowWindowOps: true


> [...] which over the years I've ended up symlinking to .Xresources and
> .xresources
>
> So all were covered.
>
> Started a second X session by first `Ctrl-Alt F2' to get a different
> vt in console mode... then `startx -- :1'
>
> Starting X on a different display, which should have activated anthing
> new in ~/.Xdefaults, but I still see the stair stepping

For future reference/further testing, you can use the 'xrdb' program
(x11-apps/xrdb in Gentoo) to alter your X resources in various ways.

E.g. to fully reload:

$ xrdb ~/.Xdefaults

To see current:

$ xrdb -q
$ xrdb -q | grep allowWindowOps

--
Best,
Ben

[1] http://bugs.gentoo.org/91453

Harry Putnam

unread,
May 11, 2010, 6:15:52 PM5/11/10
to vim...@googlegroups.com
"Benjamin R. Haskell" <v...@benizi.com> writes:

> My line may have been too specific. In the bug report my previous post
> referenced[1], the line causing problems was the more general:
>
> *allowWindowOps: false
>
> I used UXTerm in mine, because... well... I use uxterm. So, maybe try
> without the class name (UXTerm):
>
> *allowWindowOps: true
>
> or with the class name for xterm proper (XTerm):
>
> XTerm*allowWindowOps: true

Yeck... I should have caught that but instead just blindly pasted it
in there.

But anyway, it doesn't help with no `class' selector either.

[...]

> For future reference/further testing, you can use the 'xrdb' program
> (x11-apps/xrdb in Gentoo) to alter your X resources in various ways.
>
> E.g. to fully reload:
>
> $ xrdb ~/.Xdefaults
>
> To see current:
>
> $ xrdb -q
> $ xrdb -q | grep allowWindowOps

Thanks .. thats one of those things I knew all about 4-5 yrs ago but
haven't used much for a few yrs.. and it just left my pea brain
altogether.

But even after refreshing with xrdb ~/.Xdefaults after removing the
`class' selector I still see the same old stair stepping.

Looks like the fartherest back I could downgrade on current portage
would be xterm 250.

I might try that later.

Harry Putnam

unread,
May 12, 2010, 3:00:10 PM5/12/10
to vim...@googlegroups.com
Harry Putnam <rea...@newsguy.com> writes:

> Looks like the fartherest back I could downgrade on current portage
> would be xterm 250.

I did try it... downgrade to 250... no help

John Little

unread,
May 13, 2010, 1:07:24 AM5/13/10
to vim_use
Harry wrote:

> I often lose little bits of pasted code trying to paste into
> vim with middle mouse when vim is NOT in insert mode.

This is caused by the same thing as causes your "stair stepping": the
middle mouse click is being seen and acted on by the terminal
emulator, instead of passing it to vim. If vim gets the click it can
act appropriately whatever mode it's in. (Vim gets an escape sequence
beginning with " <esc> [ M ! ". Setting mouse=a causes Vim to tell
the terminal emulator to send it info about mouse clicks.)

(I only mention this to make sure you understand what's happening, my
apologies if you knew this already.)

Hmm, I wonder what your $TERM is? And what vim has set in its term
option? Conceivably, if these are not "xterm" you'd be at the mercy
of whatever termcap or terminfo your system has.

Regards, John

Harry Putnam

unread,
May 16, 2010, 1:06:17 AM5/16/10
to vim...@googlegroups.com
John Little <john.b...@gmail.com> writes:

> This is caused by the same thing as causes your "stair stepping": the
> middle mouse click is being seen and acted on by the terminal
> emulator, instead of passing it to vim. If vim gets the click it can
> act appropriately whatever mode it's in. (Vim gets an escape sequence
> beginning with " <esc> [ M ! ". Setting mouse=a causes Vim to tell
> the terminal emulator to send it info about mouse clicks.)

Turns out mouse was not set mouse=a... switching to mouse=a has solved
my problem... someone asked me earlier about that and I responded that
it was set mouse=a... Not sure how I arrived at that now... but a few
tests just now after : set mouse=a.
>
> (I only mention this to make sure you understand what's happening, my
> apologies if you knew this already.)

As you see from above... you were dead right to guess I didn't know
poop about it.

> Hmm, I wonder what your $TERM is? And what vim has set in its term
> option? Conceivably, if these are not "xterm" you'd be at the mercy
> of whatever termcap or terminfo your system has.

For the record.. I did report using standard xterm... not some
knockoff baloney like konsole or the like.

echo $TERM
xterm

I'm not sure how to determine what `term option'[s] might be set
to... I did post `:version information... but I don't see anything
about a term setting there.

Thanks for drumming it into me about mouse=a... I was really startled
pasting something into vim (while in normal mode and having it just work.

Gary Johnson

unread,
May 16, 2010, 3:18:52 AM5/16/10
to vim...@googlegroups.com
On 2010-05-16, Harry Putnam wrote:
> John Little <john.b...@gmail.com> writes:

> > Hmm, I wonder what your $TERM is? And what vim has set in its term
> > option? Conceivably, if these are not "xterm" you'd be at the mercy
> > of whatever termcap or terminfo your system has.
>
> For the record.. I did report using standard xterm... not some
> knockoff baloney like konsole or the like.
>
> echo $TERM
> xterm
>
> I'm not sure how to determine what `term option'[s] might be set
> to... I did post `:version information... but I don't see anything
> about a term setting there.

To find out what 'term' is set to,

:set term?

To find out the settings of all options,

:set all

To find out the settings of all options not set to their default
values,

:set

See

:help :set

You would think that "term=xterm" would appear in the output of
":set", but it doesn't, probably because ":help term" says that the
default value is $TERM.

HTH,
Gary
Reply all
Reply to author
Forward
0 new messages