From: Damien Wyart <damien.wyart@free.fr>
To: help-gnu-emacs@gnu.org
Subject: Re: Setting up Emacs tabs like my Vim config
Date: Mon, 30 Dec 2013 21:39:48 +0100 [thread overview]
Message-ID: <52c1da15$0$2244$426a74cc@news.free.fr> (raw)
In-Reply-To: mailman.10722.1388434857.10748.help-gnu-emacs@gnu.org
* "William G. Gardella" <wgg2@member.fsf.org> 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
next prev parent reply other threads:[~2013-12-30 20:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-30 18:42 Setting up Emacs tabs like my Vim config Some Developer
2013-12-30 20:19 ` William G. Gardella
[not found] ` <mailman.10722.1388434857.10748.help-gnu-emacs@gnu.org>
2013-12-30 20:39 ` Damien Wyart [this message]
2013-12-30 20:49 ` Bob Proulx
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='52c1da15$0$2244$426a74cc@news.free.fr' \
--to=damien.wyart@free.fr \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).