You are not logged in.
When I paste things into a vim session (in a terminal), the text I'm transferring gets rearranged weirdly.
Example: the PKGBUILD for Cube. It goes from this:
# Maintainer: Eric Belanger <belanger@astro.umontreal.ca>
# Contributor: Peter Baldwin <bald_pete@hotmail.com>
pkgname=cube
pkgver=2005_08_29
pkgrel=4
pkgdesc="Open source multiplayer and singleplayer first person shooter game"
url="http://www.cubeengine.com/"
depends=('sdl_mixer' 'sdl_image')
backup=(opt/cube/autoexec.cfg opt/cube/servers.cfg)
install=cube.install
source=(http://dl.sourceforge.net/sourceforge/cube/${pkgname}_${pkgver}_unix.tar.gz
cube.xpm cube.desktop cube.sh cubed.sh)
md5sums=('e77f3cf85292bf61100d2f8511a254cc' 'd8c1368a2ac729e168fe3dac7e7bd284'
'a09afc0facfb3f048bcc4d9377af3189' 'b57c33005a88a72cb4f6d0bab0e5bb0a'
'9fe10f48983864e0ebaa76abe9827065')
build() {
install -d $startdir/pkg/opt
cp -r $startdir/src/cube $startdir/pkg/opt
cd $startdir/pkg/opt/cube
touch servers.cfg packages/base/temp.{cfg,cgz}
chown root:20 servers.cfg autoexec.cfg packages/base/temp.{cfg,cgz}
chown root:20 savegames demos screenshots
chmod 664 servers.cfg autoexec.cfg packages/base/temp.{cfg,cgz}
chmod 775 savegames demos screenshots
install -D -m644 $startdir/src/cube.desktop $startdir/pkg/usr/share/applications/cube.desktop
install -D -m644 $startdir/src/cube.xpm $startdir/pkg/usr/share/pixmaps/cube.xpm
install -D -m755 $startdir/src/cube.sh $startdir/pkg/usr/bin/cube
install -D -m755 $startdir/src/cubed.sh $startdir/pkg/usr/bin/cubed
install -m755 bin_unix/linux_client cube_client
install -m755 bin_unix/linux_server cube_server
rm -r $startdir/pkg/opt/cube/{bin_unix,cube_unix}
}
To this:
intainer: Eric Belanger <belanger@astro.umontreal.ca>
# Contributor: Peter Baldwin <bald_pete@hotmail.com>
pkgname=cube
pkgver=2005_08_29
pkgrel=4
pkgdesc="Open source multiplayer and singleplayer first person shooter game"
url="http://www.cubeengine.com/"
depends=('sdl_mixer' 'sdl_image')
backup=(opt/cube/autoexec.cfg opt/cube/servers.cfg)
install=cube.install
source=(http://dl.sourceforge.net/sourceforge/cube/${pkgname}_${pkgver}_unix.tar.gz
cube.xpm cube.desktop cube.sh cubed.sh)
md5sums=('e77f3cf85292bf61100d2f8511a254cc'
'd8c1368a2ac729e168fe3dac7e7bd284'
'a09afc0facfb3f048bcc4d9377af3189'
'b57c33005a88a72cb4f6d0bab0e5bb0a'
'9fe10f48983864e0ebaa76abe9827065')
build() {
install -d $startdir/pkg/opt
cp -r $startdir/src/cube
$startdir/pkg/opt
cd $startdir/pkg/opt/cube
touch servers.cfg
packages/base/temp.{cfg,cgz}
chown root:20 servers.cfg
autoexec.cfg
packages/base/temp.{cfg,cgz}
chown root:20 savegames
demos screenshots
chmod 664 servers.cfg
autoexec.cfg
packages/base/temp.{cfg,cgz}
chmod 775 savegames
demos screenshots
install -D -m644
$startdir/src/cube.desktop
$startdir/pkg/usr/share/applications/cube.desktop
install -D -m644
$startdir/src/cube.xpm
$startdir/pkg/usr/share/pixmaps/cube.xpm
install -D
-m755
$startdir/src/cube.sh
$startdir/pkg/usr/bin/cube
install -D
-m755
$startdir/src/cubed.sh
$startdir/pkg/usr/bin/cubed
install
-m755
bin_unix/linux_client
cube_client
install
-m755
bin_unix/linux_server
cube_server
rm -r
$startdir/pkg/opt/cube/{bin_unix,cube_unix}
}
WTF is going on?
Offline
cat prog | sed -e 's/^ * //' > prog2
Mr Green
Offline
it's because vim automatically tabs stuff out for you.
this is what the paste option is for.
:set paste
and when you're done, turn it off.
:set nopaste
Offline
Thanks!
(I assume that turning off autoindent would also solve the problem?)
Offline
Nice! I also had problems with this
As is true for most people I know, I've always loved learning. As is also true for most people I know, I always hated school. Why is that?
Offline
Thanks paranoos. I have been switching to gvim for cut and paste when I have this issue.
Who says you can't teach an old dog new tricks.
Offline
Am I the only who feels silly for not knowing this?
Offline
nano has the same problem, with you set auto indenting on.
Offline
it's because vim automatically tabs stuff out for you.
this is what the paste option is for.:set paste
and when you're done, turn it off.
:set nopaste
Just to expand - you can also do:
:set paste!
to toggle the setting (which makes this key bindable).
However, vim-devel in [unstable] supports
set pastetoggle=<F2>
which will allow F2 to toggle the paste mode in any mode (normal, insert, visual, select, etc)
Offline
this is why i hate all the vims so much ...
Frumpus ♥ addict
[mu'.krum.pus], [frum.pus]
Offline
IMHO, it would be nice for all tips like these to be added to some kind of tips & tricks section in the Wiki. Not directly related to Arch, but it's always nice to have a page with stuff like this.
Offline
Problem with that is there's *so much* vim information out there, that it's hard to keep track of them all. But still, it'd be nice to have common things in the wiki.
Offline
How about we have a vim page in the wiki, with links to vim wikis :-D
Offline
I didn't mean a specific vim-wiki (although a few, nice vimrc's is always good), but a tips & tricks section. Maybe with a vim-article? Just a suggestion.
Offline
I think that'd be a great idea, since everyone tries vim at some point.
Personally I think phrakture would be the best person to write it, but I understand if he's too busy now he's a dev
.oO Komodo Dave Oo.
Offline
And theres so many things that everyone asks at one stage or another.
I'll try starting one now
iphitus
Offline