From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Damien Wyart Newsgroups: gmane.emacs.help Subject: Re: Setting up Emacs tabs like my Vim config Date: Mon, 30 Dec 2013 21:39:48 +0100 Organization: Serveur de News Free Message-ID: <52c1da15$0$2244$426a74cc@news.free.fr> References: <52C1BEA6.6000902@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388436014 18897 80.91.229.3 (30 Dec 2013 20:40:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2013 20:40:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 30 21:40:22 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VxjdL-0006xw-OV for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 21:40:19 +0100 Original-Received: from localhost ([::1]:59733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxjdL-00072Z-8d for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Dec 2013 15:40:19 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp5-1.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 Original-Lines: 40 Original-NNTP-Posting-Date: 30 Dec 2013 21:39:49 CET Original-NNTP-Posting-Host: 213.41.244.197 Original-X-Trace: 1388435989 news-3.free.fr 2244 213.41.244.197:50012 Original-X-Complaints-To: abuse@proxad.net Original-Xref: usenet.stanford.edu gnu.emacs.help:202937 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95206 Archived-At: * "William G. Gardella" in gnu.emacs.help: > A rough equivalent to your code could be something like this: > --8<---------------cut here---------------start------------->8--- > (defun tab-is-tab-is-tab () > "Configure tab-related settings and ensure that TAB is > `tab-to-tab-stop' in the local map." > (setq tab-width 4 > tab-stop-list (loop for i to 120 by 4 collect i) > indent-tabs-mode t) > (local-set-key (kbd "TAB") 'tab-to-tab-stop)) > --8<---------------cut here---------------end--------------->8--- I do not think this will be equivalent to the OP's vim settings, because expandtab inserts spaces instead of a tab. So I would rather go with (setq tab-width 4 indent-tabs-mode nil) but this doesn't get the effect of backspace going back to the previous tab stop. I do not know a way to get this when using spaces (when using tabs, this can be approached with http://www.emacswiki.org/emacs/BackspaceWhitespaceToTabStop) To get something stronger that the default of DEL removing one space, hungry delete might be used, but it will often be too strong (removing all whitespace instead of going back to previous tab stop). Hungry delete from CC mode can be used, or there is also a dedicated minor mode : http://stackoverflow.com/questions/5045820/how-to-bind-hungry-delete-for-clojure-in-emacs https://github.com/nflath/hungry-delete delete-horizontal-space is also somehow usable, but with a dedicated key sequence (C-u M-\). -- DW