From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PiXDb-0005Av-68 for garchives@archives.gentoo.org; Thu, 27 Jan 2011 19:09:19 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 319CAE0AC5; Thu, 27 Jan 2011 19:07:35 +0000 (UTC) Received: from mail-yw0-f53.google.com (mail-yw0-f53.google.com [209.85.213.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 06128E0AC5 for ; Thu, 27 Jan 2011 19:07:34 +0000 (UTC) Received: by ywa6 with SMTP id 6so1211328ywa.40 for ; Thu, 27 Jan 2011 11:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=+gbBcZIcyWvhgboJO/GTHZ2cmNw3xPthPtBDCfuyqfc=; b=Uqn1Pq+3DX6Z+P4oi7+XMLPl/U7xnKTyJsDDd/UlsgEh5Z4O4PUA4nuyP21BTc3Mip ovYmopNCpA3nCJGK6wlKsSa4jimWLvjjuv2czV5ncLagKM8oYHQX14nRWlOu/AAnJXcQ orxMSO7322hYAUaCHeZzSTMCgSKIW8PpMraRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Ah5hc+9hWqaw6MJ00laPJM0XkK85DUtRmOyE8dvBNiGYRCggFR0izomx2+C5YB1YKP PwGQp2wXxN/fbjXPbmpEZwnK5Z0wPWKDCmcVf4rtPah1Z6TfzSqPM4GhqiFQMapksE3y R1SfVzvRW4qu5vwLrAhRHkWaUPg3rSfl79Zp8= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.150.229.17 with SMTP id b17mr1562245ybh.55.1296155254369; Thu, 27 Jan 2011 11:07:34 -0800 (PST) Received: by 10.150.51.11 with HTTP; Thu, 27 Jan 2011 11:07:34 -0800 (PST) Date: Thu, 27 Jan 2011 11:07:34 -0800 Message-ID: Subject: [gentoo-user] Paste into vim keeping indention or original? From: Mark Knecht To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: X-Archives-Hash: cb7098744fcb3a931c6889537b7f3ade What is the solution to begin able to paste code I find on the web into a file in vim and being able to keep the indentation from changing? For instance, here's the first few lines of code from a web page: #define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x))) int main(void) { const char filename[] = "file.csv"; /* * Open the file. */ The indentation on the code from const down is consistently 3 spaces: Pasted into vi: #define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x))) int main(void) { const char filename[] = "file.csv"; /* * Open the file. */ In this case const is correct, but the next line is 6 spaces, then 9 spaces, then 12 spaces. If it matters, I'm using KDE using Konsole, but I've seen this in other WMs. I looked at the Tab settings in my Konsole profile but nothing seems to matter. Thanks, Mark