From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Anast Gramm Newsgroups: gmane.emacs.help Subject: Relative line numbers (vim like) Date: Fri, 18 Nov 2016 21:11:59 +0000 Message-ID: <20161118211159.tkrsyk2y2qifjd3g@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1479505843 31534 195.159.176.226 (18 Nov 2016 21:50:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Nov 2016 21:50:43 +0000 (UTC) User-Agent: NeoMutt/20161104 (1.7.1) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 18 22:50:39 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7r3O-0007em-Qw for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Nov 2016 22:50:39 +0100 Original-Received: from localhost ([::1]:39032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7r3R-0000Df-Pq for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Nov 2016 16:50:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7oa5-0006Bx-Pp for help-gnu-emacs@gnu.org; Fri, 18 Nov 2016 14:12:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7oa1-0008Nx-EL for help-gnu-emacs@gnu.org; Fri, 18 Nov 2016 14:12:13 -0500 Original-Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c7oa1-0008Nr-71 for help-gnu-emacs@gnu.org; Fri, 18 Nov 2016 14:12:09 -0500 Original-Received: by mail-wm0-x235.google.com with SMTP id t79so56385034wmt.0 for ; Fri, 18 Nov 2016 11:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=4iaqNqsrcTssaFoqWC5/nFTgwbmBVLLvXmM9FvhP15o=; b=vO2zQNgI8AXqgiCNuxnKAcT5DcTUuPj8OUS7PyWPwrDbaedvabyOhu9MVOem8i3mLh G1aWhjvyZQ10GzA2DguRpX4LemvnNQEsN58qWP04JVO9AkPxST6AL8Y2IqhIMTWlAK5u XSX2xhS7JV5LHZSdIXnlxS0RGM08JK+mmV6n3tIHKmXqvMck5UchyM5bmUORtjGQOW0B YCajT2HbbwgK+MLIheqc0+RNRypLZQwsiXm/P96TpTSBX2cy1DpLHlnszHAr8E1r0sR/ F7f5lBke7hhstkWVf3HUKPKoGq5yUMOBjUb0h2CNX4RnNq6aimWW2ie7wSq5TiSY7/sU 06Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=4iaqNqsrcTssaFoqWC5/nFTgwbmBVLLvXmM9FvhP15o=; b=huz9unSsFZQQNv4s2FTw3Nug+RC4Tgqqwk8ZnPii0WUzD9X16L86HTGAXZm1HU2EcJ c1s0DAlVYi7yPZy6uPOfHmCnVXHlbm18ywwrpwgF+PXJIJjb8z6KVaa81XIy7/nj++yz elTfyFNuy2cFwRaZ27MwDCK1+8DtfTbTFLXUbHIh8N09M/gEZ5nDak8rErvoNhsu8Iep /un3r5tpfPwlF9HDy9jcSEzDi9bEAWwUyF+/iizKq6pi80WcbnB39z6Uxi/eBNDXBsob XdVA/QdtpwEqgbfg1KcGfwFiCAqnpBV1pcbXe49y3H08E3H25rX5wTceuagd6pjGeHTH jA3g== X-Gm-Message-State: AKaTC02C9s5bbCKNYpj44Nn+Ht2ozfYvcz3NJElmoNpR9OlRkBVz0nlTsIzXtFVTKIzGbA== X-Received: by 10.28.72.3 with SMTP id v3mr20869wma.20.1479496327661; Fri, 18 Nov 2016 11:12:07 -0800 (PST) Original-Received: from gmail.com (adsl-173.37.6.151.tellas.gr. [37.6.151.173]) by smtp.gmail.com with ESMTPSA id m9sm4872037wma.0.2016.11.18.11.12.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 11:12:07 -0800 (PST) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::235 X-Mailman-Approved-At: Fri, 18 Nov 2016 16:48:29 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111744 Archived-At: Hello, I was looking for a way to make linum mode like the relative numbers in some vim videos I have seen, since it makes it very easy to do some stuff really quick! I found this (the first answer) http://stackoverflow.com/questions/6874516/relative-line-numbers-in-emacs and it pretty much works as expected, but I want one thing to change. Instead of showing 0 at the current line I want to show the actual line number. I figured I could use what-line to get "Line %d" as a result and then split it and the the 2nd half with the number and use this. I don't know lisp, so I can't do this! Any help would be appreciated!