Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'exercise': 0.04; 'api.': 0.05; 'postfix': 0.07; 'cursor': 0.09; 'line:': 0.09; 'repeated': 0.09; "they've": 0.09; 'cc:addr:python-list': 0.11; 'mostly': 0.14; 'editor,': 0.16; 'evaluating': 0.16; 'luckily': 0.16; 'numbered': 0.16; 'numbering': 0.16; 'python-based': 0.16; 'tool.': 0.16; 'extensions': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'do.': 0.18; 'looked': 0.18; 'bit': 0.19; 'normally': 0.19; 'seems': 0.21; '>>>': 0.22; 'select': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; '(by': 0.24; 'cc:2**0': 0.24; 'nearly': 0.26; 'this:': 0.26; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'external': 0.29; 'feature': 0.29; "doesn't": 0.30; 'primarily': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'comments': 0.31; 'lists': 0.32; 'text': 0.33; 'actual': 0.34; "i'd": 0.34; 'tool': 0.35; 'something': 0.35; 'editor': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doubt': 0.36; 'i.e.': 0.36; 'should': 0.36; 'effort': 0.37; 'example,': 0.37; 'too': 0.37; 'turn': 0.37; 'list': 0.37; 'christian': 0.38; 'sometimes': 0.38; 'either': 0.39; 'users': 0.40; 'how': 0.40; 'even': 0.60; 'money.': 0.60; 'truly': 0.60; 'august': 0.61; 'numbers': 0.61; 'times': 0.62; 'costs': 0.63; 'happen': 0.63; 'more': 0.64; 'press': 0.70; 'wish': 0.70; 'special': 0.74; 'fragment': 0.84; 'keystrokes': 0.84; 'presumably': 0.84; 'relation.': 0.84; 'sublime': 0.84; 'subject:Global': 0.91; 'thing,': 0.91; 'colleagues': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=fwej/gHqva5Vpi7EWu1U0V1x5Z3T4ImEmMjkGIHsU0M=; b=e3gnjiNZRdPYtNsybvV6qrzk+iuWJTwAw2oH1i4t1LcrZL05r4IJtD3Mcjnb9XnXy1 HnxHVMXHQwI0kO9CMGzn/m8eQXRHChIXc6iVGM3/IbqPy3qgPqYO6g0n3kZB/F1YIWA6 Xk8hqrpUYdokVKinXFeHwvE0rdPR0PQrWxDe5xzruPsarZlHqQnVfXeocULaf1uGVXpg YUBdwmbeTFo3r8sn44pBnwnwxuOLzpLyNko0sPE0ucZ+Jsy4qM0hYHiU1Vf+jOkB0HFE aVR7EqQt8hDUntwZ3BYBjmu0ldjSYzREpwkf0chGYUrUsbravMwsYhyDA4i5RXOYeBaT yNMg== X-Received: by 10.112.253.165 with SMTP id ab5mr11261538lbd.1.1408827517336; Sat, 23 Aug 2014 13:58:37 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: References: <20140822125414.1fe9eb5c@rg.highlandtechnology.com> <87oavc9tde.fsf@elektro.pacujo.net> <53f859fb$0$29983$c3e8da3$5496439d@news.astraweb.com> From: Joshua Landau Date: Sat, 23 Aug 2014 21:57:56 +0100 X-Google-Sender-Auth: rkTUxe30S1WI3m2aC3ZWMmUS9UQ Subject: Re: Global indent To: Christian Gollwitzer Content-Type: text/plain; charset=UTF-8 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 54 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408827519 news.xs4all.nl 2947 [2001:888:2000:d::a6]:49961 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76900 On 23 August 2014 17:17, Christian Gollwitzer wrote: > Am 23.08.14 16:19, schrieb Joshua Landau: >> >> On 23 August 2014 10:41, Christian Gollwitzer wrote: >>> >>> Sometimes I impress my colleagues with what they call "magic", i.e. >>> creating >>> special repeated lists of numbers by a few keystrokes in gvim, and that >>> has >>> triggered the request from them to learn a bit of (g)vim. >> >> >> I have yet to be truly impressed by Vim, in that Sublime Text with a >> few extensions seems to do the same things just as easily. I find that >> Vim and Emacs users consistently underrate the powers of these >> editors, presumably because they've never put nearly as much effort >> into them as they have into their Vim or Emacs. > > > I never looked into Sublime, because it costs money. But no doubt it is a > powerful editor, judging from comments of other people. Ay, so is any editor with an API. I use Sublime mostly because it's pretty, fast and has a Python-based API. The only actual feature it has that some others don't is multiple selections, and even then a lot do. My point is more about how using Emacs or Vim and having a powerful editor is mostly the symptom of the same thing, not a causal relation. >> For example, to make a numbered list in (my) Sublime Text (fully >> custom shortcuts ahead): >> >> [ ... some keystrokes ...] > > I'd actually do this in gvim to put numbers at each line: > > - Select text (by mouse, or v + cursor movements) > - ! awk '{print NR ". " $0}' > > Yes, it is cheating, it pipes the selected text through an external tool. > But why should I do the tedious exercise of constructing an editor macro, > when an external tool like awk can do the same so much easier? Because it normally happens more like this: Move to copy something that I wish to postfix with a number Ctrl-d a few times to select copies of that fragment Write $ and select it Press Ctrl-e to turn "$"s into numbers Luckily that one doesn't happen too often either because numbering things sequentially is better left to loops. The key binding is primarily used for evaluating snippets of code inline.