From owner-freebsd-questions@FreeBSD.ORG Sun Sep 7 04:23:35 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 602B2C71 for ; Sun, 7 Sep 2014 04:23:35 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 223601D29 for ; Sun, 7 Sep 2014 04:23:34 +0000 (UTC) Received: from r56.edvax.de (port-92-195-111-1.dynamic.qsc.de [92.195.111.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 35F782542D; Sun, 7 Sep 2014 06:23:25 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s874NPgh002263; Sun, 7 Sep 2014 06:23:25 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 7 Sep 2014 06:23:25 +0200 From: Polytropon To: Paul Kraus Subject: Re: Column ruler (like line numbers) in vi / vim / gvim Message-Id: <20140907062325.ea2a1507.freebsd@edvax.de> In-Reply-To: <8721540F-1DD5-47AC-8492-A307A6381647@kraus-haus.org> References: <20140906012327.3320bd39.freebsd@edvax.de> <8721540F-1DD5-47AC-8492-A307A6381647@kraus-haus.org> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Sep 2014 04:23:35 -0000 On Sat, 6 Sep 2014 13:41:37 -0400, Paul Kraus wrote: > On Sep 5, 2014, at 19:23, Polytropon wrote: > > > There is _one_ feature that I didn't find in vi / vim / gvim, > > and especially in regards of column-oriented data files, this > > would be really helpful: a real COLUMN RULER on top. I have > > "set number" and "set ruler" already in ~/.vimrc, but this > > involves too much "eye travel". I'd like to quickly see column > > numbers (on top) like I can see line numbers (on the left). > > > > As a grown-old mainframe person, I'm thinking about something > > like this: > > > > |...+....1....+....2....+....3....+....4....+....5....+….6 > > I have been cheating this for years, I use a line very much like > the above as a comment and separator when I am writing scripts :-) > > #————1————2————3————4————5————6————7————8 Well, I actually did the same in comment headers and templates, but the disadvantage was that this ruler didn't "move with the content". I've been using a similar approach for editing CSV files, but again, with sufficient lines, the top ruler became invisible. I then made a copy of it at the bottom of the file, handy for adding data. But when having to change something within a 800 line file, each line 500 chars wide, this doesn't help much. How I could even solve the ^Wp problem by a terrible idea: setl scrollbind scrollopt+=hor abo sp +enew call setline(1,' ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....|....+....|....+....|....+....|') let &l:stl="%#Normal#".repeat(' ',winwidth(0)) res 1 setl scrollbind nomod buftype=nofile winfixheight nonumber nocursorline wincmd p " doesn't seem to work call feedkeys("\p", 't') Yes, I send the keystrokes "manually". :-) The "quit quicky" and the "not more than 999 lines" problem is still present (with the last one solved by re-enabling line numers for the one line in that buffer). An advantage of the above solution is that it's easy to adapt to other "format rulers", for example for custom CSV files, for configuration files (column-oriented ones typically), or if you're really really brave, for RPG. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...