SlideShare a Scribd company logo
( P e rfe c t?

E n v ir o n m e
       nt)

C – means control key, M – means meta key
ClojureMadeSimple.co.uk
 Information covered in this presentation is also detailed on my website




           C – means control key, M – means meta key
slideshare.net/jr0cket
  This slide deck is available to follow along with on slideshare.net




          C – means control key, M – means meta key
Something simple
  to start with


   C – means control key, M – means meta key
C – means control key, M – means meta key
A taste of things
    to come


   C – means control key, M – means meta key
C – means control key, M – means meta key
Get Emacs
        (sorry vi people)




C – means control key, M – means meta key
Download & Install Emacs
Linux
sudo apt-add-repository
  ppa:cassou/emacs
sudo apt-get update
sudo apt-get install emacs-snapshot
Mac                                          Windows
EmacsForMacOSX.com                           Use Cygwin?


         C – means control key, M – means meta key
In the meantime: Usual Suspects

Netbeans
IntelliJ
Eclipse




           C – means control key, M – means meta key
Configure emacs
… you will have an .el of a time




  C – means control key, M – means meta key
Configs live in ~/.emacs.d folder

~/.emacs.d
    folder created when Emacs first run


~/.emacs.d/init.el
  main configuration file for Emacs
  You can define multiple .el config files as long as they are on the
 Emacs load path. init.el is the read first.




              C – means control key, M – means meta key
Give Emacs a
     Clojure injection
… lots of starter-kits, only one for Clojure




        C – means control key, M – means meta key
Automatic Clojure install
    … get your Clojure fix quickly




     C – means control key, M – means meta key
Add the package repository
;; Add Marmalade package archive for Emacs starter kit
;; and tonnes of other packages to your .emacs.d/init.el


(require 'package)
(add-to-list
   'package-archives
       '("marmalade" .
       "http://marmalade-
  repo.org/packages/"))
               C – means control key, M – means meta key
Specify package to load
(when (not package-archive-contents)
   (package-refresh-contents))


(defvar my-packages '(starter-kit
 starter-kit-lisp
                             starter-kit-
 eshell
                             starter-kit-
 bindings
                             clojure-mode
 clojure-test-mode M – means meta key
        C – means control key,
Didn't get all that typed??
 Clone my Emacs Clojure Kickstart repository on
  github.com/jr0cket


 git clone
  https://jr0cket@github.com/
     jr0cket/Emacs-clojure-
    kickstart.git
           ~/.emacs.d
The git clone command should all be on one line, but would not be as readable on the slide


                    C – means control key, M – means meta key
Re-start Emacs
… watch clojure and other goodies be
automatically downloaded and added.




     C – means control key, M – means meta key
In the meantime, Clooj

Clojure IDE in Clojure


github.com/arthuredelstein/clooj




         C – means control key, M – means meta key
github.com/arthuredelstein/clooj




      C – means control key, M – means meta key
Back to Emacs
… keyboard on stun !!




C – means control key, M – means meta key
Editing text...

...should be easy, right?



   C – means control key, M – means meta key
Using a mouse is bad for your
           health




     C – means control key, M – means meta key
C – means control key, M – means meta key
Moving along a line

     C – a
Go to start of a line


     C – e
 Go to end of a line


C – means control key, M – means meta key
Searching for something...

        C – s
          Search forward


        C – r
       Search backwards


   C – means control key, M – means meta key
Select / Copy / Paste



       C – @
Or to select, use the mouse, Luke




  C – means control key, M – means meta key
Select / Copy / Paste

     C – k
             cut line


     C – w
         cut selected


C – means control key, M – means meta key
Select / Copy / Paste


    C – y
Yank that text into your code




       C – means control key, M – means meta key
Undo / Redo



     C - _
Go back change by change




C – means control key, M – means meta key
Undo / Redo



C - ???
Go forward change by change




 C – means control key, M – means meta key
Some core keyboard
   commands



   C – means control key, M – means meta key
C – g
Hit as many times as necessary to
    cancel a keyboard command

       C – means control key, M – means meta key
Getting help with
keyboard commands



   C – means control key, M – means meta key
Just the bindings,
              ma'am


       C – h                                          b
List all the current keyboard bindings configured
                      in Emacs




          C – means control key, M – means meta key
Just the modes,
             ma'am


      C – h                                         m
Modes can be either major or minor and many
          can be used together.




        C – means control key, M – means meta key
Function keys Help

         F1 – b
         F1 – m
F1 function key is the same as help C - h


      C – means control key, M – means meta key
Funky stuff




C – means control key, M – means meta key
Transpose characters

                C – t
Swap the current character with the previous one
              - good for erratic typing




          C – means control key, M – means meta key
Coding Demo? – Super-size it!

               C – +
               C – -
Make your text big for the people at the back of
                    the room


         C – means control key, M – means meta key
Clojure project
 management



C – means control key, M – means meta key
Leiningen
… more fun than maven




C – means control key, M – means meta key
le in in g e n
   Leiningen
                                               .o rg




lein new              Create a new clojure project
lein deps             Download all dependencies
lein repl             Start the interactive shell (repl)
lein jack-in          Start repl server
            C – means control key, M – means meta key
Create a new project

lein new my-project
cd my-project
lein deps



    C – means control key, M – means meta key
Open project in emacs

cd my-project
emacs project.clj




    C – means control key, M – means meta key
Default project definition




   C – means control key, M – means meta key
Add a REPL server




C – means control key, M – means meta key
Dev Dependencies




Add libraries only needed for development
Not packaged when deployed

          C – means control key, M – means meta key
C – means control key, M – means meta key
Clojure project
management
   in Emacs


C – means control key, M – means meta key
Find file in project

        C – c f
Select one of the files available in the current
                Clojure project
 - the file doesnt have to be open in Emacs




        C – means control key, M – means meta key
Fire up the REPL

  M – x
clojure-
 jack-in
C – means control key, M – means meta key
Define your own Global short-cut
Open your .emacs.d/init.el file and add:

(global-set-key
    (kbd "C-c C-j") 'clojure-jack-
 in)

In Emacs, start the REPL with

  C – c                           C – j
         C – means control key, M – means meta key
More Cool short-cuts
       later

… but its easy, right!


   C – means control key, M – means meta key
Navigating functions
  (s-expressions)



   C – means control key, M – means meta key
Jump around in functions

C – M – f
C – M – b
C – M – u
   C – means control key, M – means meta key
Jump between function
         definitions

C – M – Home
C – M – End
Skip through your code function by function




       C – means control key, M – means meta key
Jump between function
           definitions

     C – M – a
     C – M – e
Jump to the start or end of a function definintion




          C – means control key, M – means meta key
Keep balanced,

                use

          ParEdit


C – means control key, M – means meta key
ParEdit matches ( [ { ' ”
Prevents unbalanced parents and quotes
Example
  Cant delete either parens that surround characters
   (fubar) without first deleting all the characters
  Pull code into brackets
  Reorganise code around brackets




           C – means control key, M – means meta key
Pull code in



        M – )
Pull the next block of code inside




   C – means control key, M – means meta key
Push code in



             M – (
Push the next block of code outside ??????




        C – means control key, M – means meta key
Clojure related commands
C-c TAB: Autocomplete symbol at point
C-x C-e: Eval the form under the point
C-c C-k: Compile the current buffer
 C-c C-l: Load current buffer and force
dependent namespaces to reload
M-.: Jump to the definition of a var
C-c S-i: Inspect a value
C-c C-m: Macroexpand the call under the point

         C – means control key, M – means meta key
Auto-complete




C – means control key, M – means meta key
The easy way
Clone Sam Aarons Live Coding repository
github.com/overtone/emacs-live




         C – means control key, M – means meta key
The manual way
Add the auto-complete package dependencies to
 ~/.emacs.d/init.el
popup


Download the Git repository
 https://github.com/m2ym/auto-complete
M – x load-file
      autocomplete/etc/install.el

           C – means control key, M – means meta key
Other cool stuff to help
 you discover Clojure



    C – means control key, M – means meta key
ClojureAtlas.com




C – means control key, M – means meta key
Light Table (On Kickstarter)




    C – means control key, M – means meta key
Th a n k yo u
   London Cl oj ur i ans



               @ r 0c ket
                 j
Cl oj ur eMadeSi m e. c o
                   pl
                      . uk
      C – means control key, M – means meta key

More Related Content

PDF
88 c-programs
PDF
Chapter 13.1.11
PDF
Compiler tricks
PDF
Reactive Design Patterns
PDF
GNU Emacs Reference Card.pdf
PDF
Emacs Key Bindings
PPT
Emacs tutorial
PDF
unix-editors.pdf
88 c-programs
Chapter 13.1.11
Compiler tricks
Reactive Design Patterns
GNU Emacs Reference Card.pdf
Emacs Key Bindings
Emacs tutorial
unix-editors.pdf

Similar to Perfect? clojure environment (20)

DOC
control key.doc
PDF
vi cheat sheet
PDF
Kick my mouse away
PPT
Linux history & features
PDF
PDF
PDF
Emacs Cheatsheet
PDF
VIM for Programmers
PPTX
Эффективная работа с рутинными задачами
PDF
Notesheet emacs
PDF
Emacs intro
PDF
Get the most out of your Mac OS X
PDF
Congfigure python as_ide
PDF
Productive text editing with Vim
PDF
Emacs talk
PPT
Unix Lec2
ODP
Learn Linux: Emacs
KEY
Rails development environment talk
PPT
Emacs, a performant IDE for Perl
PDF
蔡学镛 Rebol漫谈
control key.doc
vi cheat sheet
Kick my mouse away
Linux history & features
Emacs Cheatsheet
VIM for Programmers
Эффективная работа с рутинными задачами
Notesheet emacs
Emacs intro
Get the most out of your Mac OS X
Congfigure python as_ide
Productive text editing with Vim
Emacs talk
Unix Lec2
Learn Linux: Emacs
Rails development environment talk
Emacs, a performant IDE for Perl
蔡学镛 Rebol漫谈
Ad

More from John Stevenson (20)

PDF
ClojureX Conference 2017 - 10 amazing years of Clojure
PDF
Confessions of a developer community builder
PDF
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
PDF
Introduction to Functional Reactive Web with Clojurescript
PDF
Thinking Functionally with Clojure
PDF
Communication improbable
PDF
Getting into public speaking at conferences
PDF
Functional web with clojure
PDF
Get into Functional Programming with Clojure
PDF
Guiding people into Clojure
PDF
Git and github - Verson Control for the Modern Developer
PDF
Get Functional Programming with Clojure
PDF
So you want to run a developer event, are you crazy?
PPTX
Trailhead live - Overview of Salesforce App Cloud
PDF
Clojure for Java developers
PPTX
Introducing the Salesforce platform
PPT
Dreamforce14 Metadata Management with Git Version Control
ODP
Getting started with Clojure
PPT
Salesforce Summer of Hacks London - Introduction
PPTX
Heroku Introduction: Scaling customer facing apps & services
ClojureX Conference 2017 - 10 amazing years of Clojure
Confessions of a developer community builder
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Introduction to Functional Reactive Web with Clojurescript
Thinking Functionally with Clojure
Communication improbable
Getting into public speaking at conferences
Functional web with clojure
Get into Functional Programming with Clojure
Guiding people into Clojure
Git and github - Verson Control for the Modern Developer
Get Functional Programming with Clojure
So you want to run a developer event, are you crazy?
Trailhead live - Overview of Salesforce App Cloud
Clojure for Java developers
Introducing the Salesforce platform
Dreamforce14 Metadata Management with Git Version Control
Getting started with Clojure
Salesforce Summer of Hacks London - Introduction
Heroku Introduction: Scaling customer facing apps & services
Ad

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
sap open course for s4hana steps from ECC to s4
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Approach and Philosophy of On baking technology

Perfect? clojure environment

  • 1. ( P e rfe c t? E n v ir o n m e nt) C – means control key, M – means meta key
  • 2. ClojureMadeSimple.co.uk Information covered in this presentation is also detailed on my website C – means control key, M – means meta key
  • 3. slideshare.net/jr0cket This slide deck is available to follow along with on slideshare.net C – means control key, M – means meta key
  • 4. Something simple to start with C – means control key, M – means meta key
  • 5. C – means control key, M – means meta key
  • 6. A taste of things to come C – means control key, M – means meta key
  • 7. C – means control key, M – means meta key
  • 8. Get Emacs (sorry vi people) C – means control key, M – means meta key
  • 9. Download & Install Emacs Linux sudo apt-add-repository ppa:cassou/emacs sudo apt-get update sudo apt-get install emacs-snapshot Mac Windows EmacsForMacOSX.com Use Cygwin? C – means control key, M – means meta key
  • 10. In the meantime: Usual Suspects Netbeans IntelliJ Eclipse C – means control key, M – means meta key
  • 11. Configure emacs … you will have an .el of a time C – means control key, M – means meta key
  • 12. Configs live in ~/.emacs.d folder ~/.emacs.d folder created when Emacs first run ~/.emacs.d/init.el main configuration file for Emacs You can define multiple .el config files as long as they are on the Emacs load path. init.el is the read first. C – means control key, M – means meta key
  • 13. Give Emacs a Clojure injection … lots of starter-kits, only one for Clojure C – means control key, M – means meta key
  • 14. Automatic Clojure install … get your Clojure fix quickly C – means control key, M – means meta key
  • 15. Add the package repository ;; Add Marmalade package archive for Emacs starter kit ;; and tonnes of other packages to your .emacs.d/init.el (require 'package) (add-to-list 'package-archives '("marmalade" . "http://marmalade- repo.org/packages/")) C – means control key, M – means meta key
  • 16. Specify package to load (when (not package-archive-contents) (package-refresh-contents)) (defvar my-packages '(starter-kit starter-kit-lisp starter-kit- eshell starter-kit- bindings clojure-mode clojure-test-mode M – means meta key C – means control key,
  • 17. Didn't get all that typed?? Clone my Emacs Clojure Kickstart repository on github.com/jr0cket git clone https://jr0cket@github.com/ jr0cket/Emacs-clojure- kickstart.git ~/.emacs.d The git clone command should all be on one line, but would not be as readable on the slide C – means control key, M – means meta key
  • 18. Re-start Emacs … watch clojure and other goodies be automatically downloaded and added. C – means control key, M – means meta key
  • 19. In the meantime, Clooj Clojure IDE in Clojure github.com/arthuredelstein/clooj C – means control key, M – means meta key
  • 20. github.com/arthuredelstein/clooj C – means control key, M – means meta key
  • 21. Back to Emacs … keyboard on stun !! C – means control key, M – means meta key
  • 22. Editing text... ...should be easy, right? C – means control key, M – means meta key
  • 23. Using a mouse is bad for your health C – means control key, M – means meta key
  • 24. C – means control key, M – means meta key
  • 25. Moving along a line C – a Go to start of a line C – e Go to end of a line C – means control key, M – means meta key
  • 26. Searching for something... C – s Search forward C – r Search backwards C – means control key, M – means meta key
  • 27. Select / Copy / Paste C – @ Or to select, use the mouse, Luke C – means control key, M – means meta key
  • 28. Select / Copy / Paste C – k cut line C – w cut selected C – means control key, M – means meta key
  • 29. Select / Copy / Paste C – y Yank that text into your code C – means control key, M – means meta key
  • 30. Undo / Redo C - _ Go back change by change C – means control key, M – means meta key
  • 31. Undo / Redo C - ??? Go forward change by change C – means control key, M – means meta key
  • 32. Some core keyboard commands C – means control key, M – means meta key
  • 33. C – g Hit as many times as necessary to cancel a keyboard command C – means control key, M – means meta key
  • 34. Getting help with keyboard commands C – means control key, M – means meta key
  • 35. Just the bindings, ma'am C – h b List all the current keyboard bindings configured in Emacs C – means control key, M – means meta key
  • 36. Just the modes, ma'am C – h m Modes can be either major or minor and many can be used together. C – means control key, M – means meta key
  • 37. Function keys Help F1 – b F1 – m F1 function key is the same as help C - h C – means control key, M – means meta key
  • 38. Funky stuff C – means control key, M – means meta key
  • 39. Transpose characters C – t Swap the current character with the previous one - good for erratic typing C – means control key, M – means meta key
  • 40. Coding Demo? – Super-size it! C – + C – - Make your text big for the people at the back of the room C – means control key, M – means meta key
  • 41. Clojure project management C – means control key, M – means meta key
  • 42. Leiningen … more fun than maven C – means control key, M – means meta key
  • 43. le in in g e n Leiningen .o rg lein new Create a new clojure project lein deps Download all dependencies lein repl Start the interactive shell (repl) lein jack-in Start repl server C – means control key, M – means meta key
  • 44. Create a new project lein new my-project cd my-project lein deps C – means control key, M – means meta key
  • 45. Open project in emacs cd my-project emacs project.clj C – means control key, M – means meta key
  • 46. Default project definition C – means control key, M – means meta key
  • 47. Add a REPL server C – means control key, M – means meta key
  • 48. Dev Dependencies Add libraries only needed for development Not packaged when deployed C – means control key, M – means meta key
  • 49. C – means control key, M – means meta key
  • 50. Clojure project management in Emacs C – means control key, M – means meta key
  • 51. Find file in project C – c f Select one of the files available in the current Clojure project - the file doesnt have to be open in Emacs C – means control key, M – means meta key
  • 52. Fire up the REPL M – x clojure- jack-in C – means control key, M – means meta key
  • 53. Define your own Global short-cut Open your .emacs.d/init.el file and add: (global-set-key (kbd "C-c C-j") 'clojure-jack- in) In Emacs, start the REPL with C – c C – j C – means control key, M – means meta key
  • 54. More Cool short-cuts later … but its easy, right! C – means control key, M – means meta key
  • 55. Navigating functions (s-expressions) C – means control key, M – means meta key
  • 56. Jump around in functions C – M – f C – M – b C – M – u C – means control key, M – means meta key
  • 57. Jump between function definitions C – M – Home C – M – End Skip through your code function by function C – means control key, M – means meta key
  • 58. Jump between function definitions C – M – a C – M – e Jump to the start or end of a function definintion C – means control key, M – means meta key
  • 59. Keep balanced, use ParEdit C – means control key, M – means meta key
  • 60. ParEdit matches ( [ { ' ” Prevents unbalanced parents and quotes Example Cant delete either parens that surround characters (fubar) without first deleting all the characters Pull code into brackets Reorganise code around brackets C – means control key, M – means meta key
  • 61. Pull code in M – ) Pull the next block of code inside C – means control key, M – means meta key
  • 62. Push code in M – ( Push the next block of code outside ?????? C – means control key, M – means meta key
  • 63. Clojure related commands C-c TAB: Autocomplete symbol at point C-x C-e: Eval the form under the point C-c C-k: Compile the current buffer C-c C-l: Load current buffer and force dependent namespaces to reload M-.: Jump to the definition of a var C-c S-i: Inspect a value C-c C-m: Macroexpand the call under the point C – means control key, M – means meta key
  • 64. Auto-complete C – means control key, M – means meta key
  • 65. The easy way Clone Sam Aarons Live Coding repository github.com/overtone/emacs-live C – means control key, M – means meta key
  • 66. The manual way Add the auto-complete package dependencies to ~/.emacs.d/init.el popup Download the Git repository https://github.com/m2ym/auto-complete M – x load-file autocomplete/etc/install.el C – means control key, M – means meta key
  • 67. Other cool stuff to help you discover Clojure C – means control key, M – means meta key
  • 68. ClojureAtlas.com C – means control key, M – means meta key
  • 69. Light Table (On Kickstarter) C – means control key, M – means meta key
  • 70. Th a n k yo u London Cl oj ur i ans @ r 0c ket j Cl oj ur eMadeSi m e. c o pl . uk C – means control key, M – means meta key