Gravity Playground Mac OS

broken image


This is a short post detailing how I installed Emacs and configured an environment for maintaining multiple configurations (on my MacBook Pro).I wanted to write the post because I have been on a roller coaster getting an Emacs install that provides all of the functionality that I want (maybe even need!).

  1. Gravity Playground Mac Os Download
  2. Gravity Playground Mac Os X

Some Emacs installs (e.g. emacs from homebrew) are not recognised by the yabai tiling window manager and don't tile properly.This really started to bug me so I invested a hefty chunk of time (in classic Emacs style) to find a solution.I stumbled across Emacs-plus which solved the issue but left me with another…I use the pdf-tools package through the pdf-tools spacemacs layer for viewing all my pdfs; writing LaTeX docs (using org-mode and/or auctex), reading books, reading papers (using org-ref) etc.Unfortunately, both of these installs don't support retina pdf quality in PDFView (pdf-tools).So I set out on a second mission to get my myself a high res pdf viewing experience within Emacs.

Many GitHub issues later and The Emacs Mac Port came to the rescue.This is an excellent blog post detailing how The Emacs Mac Port (which I installed using Homebrew from this repo) greatly improves Emacs' functionality with MacOS.In particular, it provides a lot of native GUI support.

I personally don't like having a title bar on my beautiful editor so I choose not to install it.I think I read somewhere that it might interfere with tiling window managers as well and we can't be having that, so let's install it without,

and to make sure that we are using the right install be sure to link emacs-mac with,

Gravity Playground Mac OS

Hey, thanks for watching! Everything that you'll needis and will be down below! (Music, Links, Discords, etc)Also, Calamari is for windows aswell!If you want. Operating systems Windows 10 or later, macOS Catalina, Linux and Chrome OS: Chrome v8 engine version 7.2.502 or later. Online version (web app): Chrome or Firefox are recommended on desktop computers, Safari for iOS, Chrome for Android. Desktop computers with 2 GB RAM and a CPU with 2.2 GHz. In case Matlab has trouble finding a specific library, a workaround is to launch it preloading the variable LDPRELOAD (or DYLDINSERTLIBRARIES on Mac OS X) with the location of the missing library. On Linux you might also have trouble with libstdc.so since Matlab comes with its own.

Gravity Playground Mac Os Download

Now that we are using The Emacs Mac Port we need to add the following to our config file (user-config in spacemacs) if we want to enjoy the fruits of our labour,

I also like PDFView to open with the pdf fit to the screen (show 1 page) so I also added the following,

Chemacs

Chemacs is an Emacs profile switcher that makes it easy to run multiple Emacs configs side by side.I am currently running six Emacs configurations,

  1. New Spacemacs Base (Develop Branch)
    • This is a new config that I am setting up using just spacemacs-base instead of full spacemacs. I want to understand all of the packages I am using and install only the ones I need, thus avoiding a lot of bloat.
  2. New Spacemacs Base (Master Branch)
    • This is the same config file but running on spacemacs master instead of the develop branch.
  3. Literate Org Config File
    • This is the same configuration but written in an Org file with lots of documentation. I use tangle/detangle to produce emacs lisp files from the org file. I haven't decided if I want to fully invest in a literate config file so this is a nice way to experiment.
  4. Vanilla Emacs
    • Although I love spacemacs I am eager to build a full Emacs config from scratch and this config is my attempt.
  5. Spacemacs Old Develop
    • This is my old (full) spacemacs config running on the develop branch.
  6. Spacemacs Old Master
    • This is my old spacemacs config running on master.

It's super easy to setup, just clone the repo and run the install script.I don't think I need to repeat the instructions that are listed in their README.Once you have it setup the main functionality comes from two files.First there is the ~/.emacs-profiles.el file where you define all of your different configurations.This is what my ~/.emacs-profiles.el file looks like,

  1. Chemacs will load the init.el file from the user-emacs-directory,
    • you can change the file name/path by setting the cutom-file variable.
  2. You can set each configuration file to use a different server name with the server-name variable,
    • this is super useful if you want to exploit emacsclient for a speedy startup, something I am currently working on!
  3. A set of environment variables with env,
    • I use this to set the SPACEMACSDIR variable which tells spacemacs where to look for extra customisation's.

Gravity Playground Mac Os X

The other Chemacs file is the ~/.emacs-profile file where you set the default config to use.Mine is currently,

Another great benefit of Chemacs is that it also makes it super easy to version control all of your emacs configuration files, layers, snippets etc.I keep all of mine in my version controlled ~/.dotfiles folder with their own dedicated folders.For example I have put all of my snippets (for use with yasnippet) inside a private folder~/.dotfiles/spacemacs-base-new/private/snippets and all of my layers are inside ~/.dotfiles/spacemacs-base-new/layers.To make my configs more portable I also set the layer path variable in the dotspacemacs/layers function using,

and set any references to the private directory with something like,

Emacs Server/Client

The Emacs server is super useful if your config file takes a couple of seconds to load.I know that some of mine do and I hate waiting…

Mac

Hey, thanks for watching! Everything that you'll needis and will be down below! (Music, Links, Discords, etc)Also, Calamari is for windows aswell!If you want. Operating systems Windows 10 or later, macOS Catalina, Linux and Chrome OS: Chrome v8 engine version 7.2.502 or later. Online version (web app): Chrome or Firefox are recommended on desktop computers, Safari for iOS, Chrome for Android. Desktop computers with 2 GB RAM and a CPU with 2.2 GHz. In case Matlab has trouble finding a specific library, a workaround is to launch it preloading the variable LDPRELOAD (or DYLDINSERTLIBRARIES on Mac OS X) with the location of the missing library. On Linux you might also have trouble with libstdc.so since Matlab comes with its own.

Gravity Playground Mac Os Download

Now that we are using The Emacs Mac Port we need to add the following to our config file (user-config in spacemacs) if we want to enjoy the fruits of our labour,

I also like PDFView to open with the pdf fit to the screen (show 1 page) so I also added the following,

Chemacs

Chemacs is an Emacs profile switcher that makes it easy to run multiple Emacs configs side by side.I am currently running six Emacs configurations,

  1. New Spacemacs Base (Develop Branch)
    • This is a new config that I am setting up using just spacemacs-base instead of full spacemacs. I want to understand all of the packages I am using and install only the ones I need, thus avoiding a lot of bloat.
  2. New Spacemacs Base (Master Branch)
    • This is the same config file but running on spacemacs master instead of the develop branch.
  3. Literate Org Config File
    • This is the same configuration but written in an Org file with lots of documentation. I use tangle/detangle to produce emacs lisp files from the org file. I haven't decided if I want to fully invest in a literate config file so this is a nice way to experiment.
  4. Vanilla Emacs
    • Although I love spacemacs I am eager to build a full Emacs config from scratch and this config is my attempt.
  5. Spacemacs Old Develop
    • This is my old (full) spacemacs config running on the develop branch.
  6. Spacemacs Old Master
    • This is my old spacemacs config running on master.

It's super easy to setup, just clone the repo and run the install script.I don't think I need to repeat the instructions that are listed in their README.Once you have it setup the main functionality comes from two files.First there is the ~/.emacs-profiles.el file where you define all of your different configurations.This is what my ~/.emacs-profiles.el file looks like,

  1. Chemacs will load the init.el file from the user-emacs-directory,
    • you can change the file name/path by setting the cutom-file variable.
  2. You can set each configuration file to use a different server name with the server-name variable,
    • this is super useful if you want to exploit emacsclient for a speedy startup, something I am currently working on!
  3. A set of environment variables with env,
    • I use this to set the SPACEMACSDIR variable which tells spacemacs where to look for extra customisation's.

Gravity Playground Mac Os X

The other Chemacs file is the ~/.emacs-profile file where you set the default config to use.Mine is currently,

Another great benefit of Chemacs is that it also makes it super easy to version control all of your emacs configuration files, layers, snippets etc.I keep all of mine in my version controlled ~/.dotfiles folder with their own dedicated folders.For example I have put all of my snippets (for use with yasnippet) inside a private folder~/.dotfiles/spacemacs-base-new/private/snippets and all of my layers are inside ~/.dotfiles/spacemacs-base-new/layers.To make my configs more portable I also set the layer path variable in the dotspacemacs/layers function using,

and set any references to the private directory with something like,

Emacs Server/Client

The Emacs server is super useful if your config file takes a couple of seconds to load.I know that some of mine do and I hate waiting…

Luckily we can run an Emacs server with the first instance we open and then connect to this server using emacsclient when 'opening' subsequent instances.These new instances open almost instantaneously for me.

To get this working you first have to start the server.I have been struggling to get it setup with the spacemacs server config so I turn off all of the spacemacs server functionality,

and start my own by adding,

to my user-config.

We now need to know if an Emacs server is running so that we can either connect to it or start a new Emacs instance if not.To get this working I use the following shell script.

You might have to change the EMACS and EMACS_CLIENT variables depending where brew linked your install.Let's give our shell script permissions,

and set an alias e 'emacs' by executing the following (assuming you use zsh),

If you use bash then it will be,

but you should consider switching!We can now open new Emacs instances by typing e or simply e into terminal.

I take this one step further as I use skhd (a simple hotkey daemon for macOS) to open my default Emacs config (utilising emacsclient) with a simple keybinding.Creating an extra script was probably overkill but it works so I am happy.The only difference here is that no filename is passed to emacsclient so we instead ask it to open a new frame.

Again let's give it permissions,

I then set CMD m to run the shell script by placing the following in my ~/.config/skhd/skhdrc file,

This will either connect to the server of a previously running instance and open a new frame or open a new Emacs instance and start a server.

Fantastic, we now have a super speedy Emacs setup that we can easily use with six different configurations.If anyone has any great ideas for improving anything I have shown here I am all ears 👂.Happy hacking..

Related





broken image