[emacs-berlin] Emacs Starter Kits

Arne Brasseur arne.brasseur at gmail.com
Tue Jul 29 10:31:19 CEST 2014


Hey folks,

Florian, those are some handy commands but they're different from what I
would put into a "reset" script. One of my issues with the starter kits is
that on top of setting some useful defaults, and installing a bunch of
packages, they contain lots of custom commands and tweaks. This usually
makes them too opinionated for experienced users, and the choice of extra
functionality is quite arbitrary, it's whatever the person making the
starter kit considered cool.

So I'd like to split this up:
- "reset" simple sensible defaults
- choice of dependent packages
- extra functionality

The first could be it's own package, possible with a customize interface to
opt in/out of certain settings. If the extra functionality is useful it
should also be packaged.

This way creating a starter emacs config simply becomes choosing a
packaging system, and choosing a curated set of packages, and *maybe* a
very thin layer of tweaks on top of that.

Regarding packaging systems, what Lefteris also asks about, I did a little
write-up for a friend recently. It might not be 100% accurate or
exhaustive, it's what I gathered from my own excursions and from looking at
other people's config.

Hope that helps, looking forward to meeting tomorrow!

Arne




2014-07-26 18:25 GMT+02:00 Lefteris Karapetsas <lefteris at refu.co>:

> Hey all,
>
> I am wondering what kind of package managing method do you use. What do
> you guys use for downloading emacs packages and then managing them?
> I had started by using git submodules and keeping all of my emacs.d there,
> with external packages registered as submodules.
>
> Since I discovered el-get <https://github.com/dimitri/el-get> though I
> have seriously simplified the way that emacs packages are maintained. I
> still keep my .emacs.d in a git repository but all of the external packages
> are managed by el-get and I don't need to worry:
>
> (defvar el-get-packages-list)
> (defvar work-only-packages '(monky protobuf-mode))
> (defvar personal-only-packages '(android-mode ))
> (if *at-work*
>     (setq el-get-packages-list (append common-packages work-only-packages))
>     (setq el-get-packages-list (append common-packages personal-only-packages)))
>
> ;; el-get does its magic to make sure all packages are there
> (el-get 'sync el-get-packages-list)
> (el-get 'sync)
>
>
> So I keep 3 different lists, one for my work computer and one for my
> personal computer where I define the packages I need only in each different
> environment. And the common-packages list is the packages I need
> everywhere. With the last 2 lines el-get makes sure that the aforementioned
> packages are downloaded, built and up to date. Installing my .emacs.d to a
> new computer? Just open emacs and wait until it clones and builds all
> packages. (It will take a long time to do so though)
>
> As for specific packages I could go on and on about useful packages but
> one that I really love using is: *expand-region*. Its source code is here
> <https://github.com/magnars/expand-region.el>. I bind it to M - q and
> it's simply magic. Depending on the language of the file visited by the
> buffer you are in, it will select the current word. The more times you call
> it without moving the point the selected region will expand more and more
> towards greater and greater semantic areas, like variable name, function
> block e.t.c.
>
> So that wraps up some things I discovered after some years of using emacs.
> Hope to see some of you in one of our meetings and discuss more tips and
> tricks in detail.
>
> Best Regards,
>
>
> Lefteris(Eleftherios) Karapetsas  Click here <http://lefteris.refu.co>
> for my CV/portfolio website
> <http://lefteris.refu.co>   Also maintain a blog <http://blog.refu.co>on
> various topics, mostly engineering
>
>
>
> On Sat, Jul 26, 2014 at 4:39 PM, C. Florian Ebeling <
> florian.ebeling at gmail.com> wrote:
>
>>
>> On 26.07.2014, at 15:45, Tilmann Singer <tils at tils.net> wrote:
>>
>> > Arne Brasseur <arne.brasseur at gmail.com> writes:
>> >> For example some of the settings I have so far are:
>> >>
>> >> (setq inhibit-splash-screen t)                  ; no splash screen
>> >> (menu-bar-mode -1)                              ; no menu bar
>> >> (tool-bar-mode -1)                                ; no tool bar
>> >> (scroll-bar-mode -1)                            ; no scroll bar
>> >> (setq initial-scratch-message nil)              ; empty *scratch*
>> buffer
>> >> (setq x-select-enable-clipboard t)
>> >> (require 'uniquify)
>> >> (setq uniquify-buffer-name-style 'post-forward) ; "file.ext|dir"
>> instead of
>> >> "file.ext<2>"
>> >> (fset 'yes-or-no-p 'y-or-n-p)
>> >
>> > Agree with all of them!
>>
>> Yes, I have these too. Another one the I like is to show whitespace
>> mistakes upon toggling with C-x w:
>>
>> (global-set-key (kbd "C-x w") (lambda () (setq 'show-trailing-whitespace
>> t)))
>>
>> All trailing whitespace becomes become redspace! :)
>>
>> I bind C-. to open the string at the cursor, er, point to open in buffer.
>>
>> (global-set-key (kbd "C-.") 'find-file-at-point)
>>
>> Opening Magit is a major things, so I have it on Cmd-return (in Apple
>> keys).
>>
>> (global-set-key (kbd "M-RET") 'magit-status)
>>
>> When writing lots of tests, i.e. when doing Ruby, I fing it useful to be
>> able to touch a file easily. I use my own (googled?) function and put it on
>> Alt-return. Then autotest / guard / grunt can pick it up and rerun. (This
>> is for cases when only changing implementation and not the test.)
>>
>> (defun touch ()
>>   "updates mtime on the file for the current buffer"
>>   (interactive)
>>   (let ((command (concat "touch " (shell-quote-argument
>> (buffer-file-name)))))
>>     (shell-command command)
>>     (clear-visited-file-modtime)
>>     (message command)))
>>
>> (global-set-key (kbd "s-<return>") 'touch)
>>
>> Another thing I'm fond of is toggling between the two topmost buffers,
>> which sits on Ctrl-Shift-Arrow-down:
>>
>> (defun flip-buffer ()
>>   (interactive)
>>   (switch-to-buffer nil))
>>
>> (global-set-key [C-S-down] 'flip-buffer)
>>
>> I'm not sure if all of these deserve immediate premium level starter kit
>> status, but those are at least the ones I still consider good ideas after
>> having them around awhile =)
>>
>> Florian
>>
>>
>> _______________________________________________
>> emacs-berlin mailing list
>> emacs-berlin at emacs-berlin.org
>> https://mailb.org/mailman/listinfo/emacs-berlin
>>
>>
>
> _______________________________________________
> emacs-berlin mailing list
> emacs-berlin at emacs-berlin.org
> https://mailb.org/mailman/listinfo/emacs-berlin
>
>


-- 
| @plexus <https://twitter.com/plexus>  | arnebrasseur.net | The Happy
Lambda <https://leanpub.com/happylambda> |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailb.org/pipermail/emacs-berlin/attachments/20140729/c4c239de/attachment.html>


More information about the emacs-berlin mailing list