An infinite number of monkeys typing into GNU Emacs would never make a good program.
——— Linus Torvalds
- About
- Screenshots
- How to Use This Configuration
- Installation
- Prerequisites
- User Guidance
- Custom Configurations
- Optional
- Recommendations
- Ask Me Anything!
- 📜 License
Emacs changes how you think about programming.
Emacs is totally introspectable. You can always find out what code runs when I press this button?.
Emacs is an incremental programming environment. There’s no edit-compile-run cycle. There isn’t even an edit-run cycle. You can execute snippets of code and gradually turn them into a finished project. There’s no distinction between your editor and your interpreter.
Emacs is a mutable environment. You can set variables, tweak functions with advice, or redefine entire functions. Nothing is off-limits.
Emacs provides functionality without applications. Rather than separate applications, functionality is all integrated into your Emacs instance. Amazingly, this works. Ever wanted to use the same snippet tool for writing C++ classes as well as emails?
Emacs is full of incredible software concepts that haven’t hit the mainstream yet. For example:
- Many platforms have a single item clipboard. Emacs has an infinite clipboard.
- If you undo a change, and then continue editing, you can’t redo the original change. Emacs allows undoing to any historical state, even allowing tree-based exploration of history.
- Emacs supports a reverse variable search: you can find variables with a given value.
- You can perform structural editing of code, allowing you to make changes without breaking syntax. This works for lisps (paredit) and non-lisps (smartparens).
- Many applications use a modal GUI: for example, you can’t do other edits during a find-and-replace operation. Emacs provides recursive editing that allow you to suspend what you’re currently doing, perform other edits, then continue the original task.
Emacs has a documentation culture. Emacs includes a usage manual, a lisp programming manual, pervasive docstrings and even an interactive tutorial.
Emacs has a broad ecosystem. If you want to edit code in a niche language, there’s probably an Emacs package for it.
Emacs doesn’t have a monopoly on good ideas, and there are other great tools out there. Nonetheless, we believe the Emacs learning curve pays off.
This beautifully written About EMACS section credits to Remacs.
Welcome to the Emacs Of Dream. Wait no, I meant the Emacs Operating System.
This repository contains my personal configuration for GNU Emacs that I use on the daily and port around from system to system with me. This is an example of a fully custom Emacs configuration that you can use as inspiration when building your own!
Customization began with single-file ~/.emacs
with few settings and some random snippets. Didn’t took long to become monster. It loved to cherry-picked 🍒 packages literally form anywhere, I was like why don’t you apt-get.
The configuration depends on init.el, my-lisp(dir) and early-init.el (sets up a few initial GUI settings), bootstraps use-package. and loads init.el, which is where the majority of the configuration magic happens.
This is an Emacs distribution that aims to enhance the default Emacs experience. It alters a lot of the default settings, bundles of additional packages and adds its own core library to the mix. The final product offers an easy to use Emacs configuration for Emacs newcomers and lots of additional power for Emacs power users.
It’s able to run on GNU/Linux, macOS and Windows. It is compatible ONLY with GNU Emacs 27.1 and Above. In general you’re advised to always run with the latest stable release - currently 28.2.
Here are some demo…
A dashboard on startup can clean my mind.😌
Center text in the frame, looks nice ;) and =flycheck= with BitMap-Arrow on the right-fringe 😎
default Transparent mode 👍🏻
File navigation with Speed-bar.
feel the Org-mode :D
Company-mode with yasnippet 🔥
This repo is meant to be a companion to the Emacs From Scratch video series, serving as an example of a custom configuration build on top of vanilla Emacs. I give instructions below for how to set it up to try it out, but it isn’t meant to be used as your main configuration! My goal here is to provide a working configuration that you can take inspiration from (and copy from directly).
Just keep in mind that this repo isn’t set up to be used directly as your own configuration! Copy the code to your own dotfiles repository and have fun :)
🧨 DISCLAIMER: 🐒 MAKE SURE YOU HAVE THE BACKUP ⚠ AUTHOR will not be responsible for the 🔥 harm 🔥 cause by using this configuration.
Oh! you wanna use my config! its super duper easy ! may be in
future I’m still trying avoiding make the installer (literally
don’t know how) and just trying to get by my work.
- Install GNU Emacs.
- Move
~/.emacs
or~/.emacs.d
, if you already have it. - Clone this repo to
HOME
or~/
path using git and update all the submodules.
Run this snippets on your terminal:
cd ~
git clone https://github.com/Likhon-baRoy/.emacs.d.git
cd.emacs.d
- Ensure a stable connection to Melpa Packages, then open Emacs.
- Enter
y
when prompted withAuto-update packages now?
, wait for all packages to install. (Ignore the warnings on the first launch.) - In your favorite browser,
Ctrl-f Prerequisite
through this README and follow the Prerequisite instructions. - Restart Emacs and Start using your Dream Emacs! 🎉
There is absolutely no reason for you to use this config, it would be like first time 🏊 swimmer, who mostly likely drown with unnecessary amount of effort. Although I’m great at underwater so to say some what athletic underachievers.
Time 🕥 and time 🕝 again I learned elisp just to forget with endless pondering and compromises, without ✍ jotting things down, it would have been impossible to configure. May be this started for maintenance, now its more of rants taking over the configuration! 😎
If you ask, would I have started with other’s config? I would definitely say YES. But you should understand all-in-one package 📦 or distribution is like bringing gun 🔫 to the fist 👊 fight. You might end up using less than 5 % of the bloat. And if you want to change or fix something it big 😫 pain to pealing layers after layers to find the actual root cause. Yet you might want to try these first
- Doom Emacs
- Spacemacs
- Centaur Emacs
- ergoemacs-mode
- Graphene
- magnars emacs.d
- ohai-emacs
- Prelude
- Radian
- purcell emacs.d
And there configurations too.
- mattduck
- DiegoVicen
- stardiviner
- M-EMACS
- Farlado’s Illiterate GNU Emacs
- Emacs is Agar for Brain Worms
- David Wilson’s config
- rougier
- novoid
While troubleshooting I go though these procedure (may not be in same ordering)
- hate myself when it happens
- REMOVE the damn plugin and GET BACK TO WORK
- throw ERROR MSG at google and try catching relevant pages
- may be waste few hrs with random trials
- set debug variable
(setq debug-on-error 1) (setq debug-on-quit t) ;; C-g
I will be updating My-EMACS from time to time, it is best to git pull
once a while to stay up to date.
Please also execute git submodule update --recursive --remote
to sync with all the submodules.
If you spotted a bug or you have any suggestions, please fill in an issue. If you have something to fix, feel free to create a pull request.
Everyone starts somewhere, and I started here. My heart whelming Thanks 🙏🏽 to you guy’s 💜, who put all their effort always makes Emacs go one-step further.
- UncleDave (GitHub, YouTube)
- Howard Abrams (GitHub, YouTube)
- Mike Zamansky (GitHub, YouTube, Website)
- Mingde (Matthew) Zeng (GitHub)
- System Crafters (Daviwil) (GitHub, YouTube, Website(systemcrafters), Website(daviwil’s))
- Protesilaos Stavrou (GitHub, YouTube, Website)
And many other people from the Internet World. Awesome Emacs has a good list of packages and themes to check out.
Please update this file your personal info.
(setq user-full-name "Your Name"
user-login-name "Login_Name"
user-real-login-name "Real_Login_Name"
user-mail-address "[email protected]")
Also this project relies on the following list of applications:
- Git (
git
) - GnuPG (
gpg
) - GNU GLOBAL (
global
) - Exuberant Ctags (
ctags
) - Install JetBrains Mono, Iosevka Aile (
font
) - Install cmake, clang, llvm, gdb for programming purpose
- Install nerd-icons fonts if already not installed,
M-x nerd-icons-install-fonts
- Install emoji font (Noto Emoji &
noto-cjk
, for all the fonts imaginable) for Linux - Hunspell (
hunspell
) with dictionaries
📝 Note: (for beginners) I’ll be using Ctrl
as C
, Alt
as M
, Shift
as S
, Space
as SPC
and BackSpace
as BS
.
- You must wanna see this documentation 👉🏽 Emacs-user-manual.
After installation process is done. Whenever you open a files within Emacs, the whole file will be opened in folding mode. Which you’ll obviously won’t see until you find the shortcut key-binding. There is a default feature for this which called hs-minor-mode I just change some default key-bindings for more useful.
check this out:
C-c h (hide-all) C-c s (show-all) S-BS (hide-block) C-BS (show-block) C-TAB (toggle-hiding) - fold the current section. S-TAB (hide-level) - fold the sub sections of the current section.
Here is my some personal changes for Emacs which comes default with this configuration.
;;; this is confusion
(global-unset-key (kbd "C-z")) ; unbind (suspend-frame)
;; normal undo and redo
(global-set-key (kbd "C-z") 'undo-only)
(global-set-key (kbd "C-S-z") 'undo-tree-redo)
;; ;;; Shell
(global-set-key (kbd "C-!") 'eshell-here) ; see this function in `shell.el'
(global-set-key "\C-w" 'backward-kill-word)
;; I use `C-h' for backspace in Emacs and move `help-command' elsewhere:
(global-set-key "\^h" 'backward-delete-char)
(define-key isearch-mode-map "\C-h" 'isearch-delete-char)
(global-set-key (kbd "C-S-H") 'kill-whole-line)
;; long lines go-off the side of the screen instead of hosing up the ascii art
(global-set-key "\C-x\C-l" 'toggle-truncate-lines)
;; Rename File
(global-set-key (kbd "C-S-R") 'rename-file)
;; Delete current file
(global-set-key "\C-cD" 'Delete-current-file)
;; kill selected region
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)
;; Duplicate a whole line
(global-set-key "\C-c\C-d" "\C-a\C- \C-n\M-w\C-y")
;; Buffer
(global-set-key "\M-n" 'next-buffer)
(global-set-key "\M-p" 'previous-buffer)
;; Window
(global-set-key "\M-o" 'other-window) ; use with `ace-window'
(global-set-key (kbd "C-.") #'other-window)
(global-set-key (kbd "C-,") #'prev-window)
;; auto-complete
(global-set-key "\M-TAB" 'company-complete-common-or-cycle)
;; Unfill paragraph
;; Might be good. For instance for canceling all of the paragraph quickly or for commenting it away.
(defun unfill-paragraph ()
"Convert a multi-line paragraph into a single line of text."
(interactive)
(let ((fill-column (point-max)))
(fill-paragraph nil)))
;; Handy key definition
(define-key global-map "\M-Q" 'unfill-paragraph)
- Now now, how much you like transparency? With this config this method comes default.
you can toggleon
/off
transparency usingC-c t
keystrokes.
;;________________________________________________________________
;; Transparent Emacs
;;________________________________________________________________
(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
(add-to-list 'default-frame-alist '(alpha . (85 . 50)))
;; (set-frame-parameter (selected-frame) 'alpha '(<active> . <inactive>))
;; (set-frame-parameter (selected-frame) 'alpha <both>)
;; Use the following snippet after you’ve set the alpha as above to assign a toggle to “C-c t”:
(defun toggle-transparency ()
"Crave for transparency!"
(interactive)
(let ((alpha (frame-parameter nil 'alpha)))
(set-frame-parameter
nil 'alpha
(if (eql (cond ((numberp alpha) alpha)
((numberp (cdr alpha)) (cdr alpha))
;; Also handle undocumented (<active> <inactive>) form.
((numberp (cadr alpha)) (cadr alpha)))
100)
'(85 . 50) '(100 . 100)))))
(global-set-key (kbd "C-c t") 'toggle-transparency)
Writing in Bangla using company-wordfreq.
- Install Bangla font Kalpurush
You can put this configuration code to you init.el
file or make an extra separate file and put it in ~/.emacs.d/my-lisp/
directory then Emacs will autoload this file from there.
set your keyboard default layout to Probhat
key-layout.
(setq default-input-method "bengali-probhat")
(set-fontset-font "fontset-default" 'bengali (font-spec :family "Kalpurush" :size 16))
Install the following package for auto suggestions of Bangla word.
(use-package company-wordfreq
:delight " 𝛄")
We need to the set up the following in the local buffer. This can be done by invoking an interactive function as below.
(defun remove-quail-show-guidance ()
nil)
(defun remove-quail-completion ()
(quail-select-current))
(defun bn-company-wordfreq ()
(interactive)
(advice-add 'quail-show-guidance :override #'remove-quail-show-guidance)
(advice-add 'quail-completion :override #'remove-quail-completion)
(setq ispell-local-dictionary "bengali_439")
(setq-local company-backends '(company-wordfreq))
(setq-local company-transformers nil))
And let’s hook them into Text buffer-mode.
(add-hook 'text-mode-hook (lambda ()
(setq-local company-backends '(company-wordfreq))
(setq-local company-transformers nil)))
for more information visit this link here: Typing Bangla in emacs
- Change the input-method using
C-\
- Enable
company-wordfreq
and other changes for a nice experience usingM-x bn-company-wordfreq
Now you can enjoy your Bangla/Bengali lang workflow :D
Here are some general recommendations on Emacs usage that you might find helpful:
Most people don’t use the CapsLock key (unless you like YELLING ON THE INTERNET) so you can use this simple fix to replace it with the CTRL to make your Emacs life easier. Doing this will prevent you from having to bend your pinky down all day long to hit all those fabled Emacs keybindings, allowing you to keep your hands on the home row of the keyboard.
Here’s how to do it across all 3 major operating systems:
Linux X11
There are many ways to accomplish this in Linux, but the easiest (and most repeatable) I’ve found is to use xmodmap. First, create a file named .Xmodmap
in your home folder and populate it like so:
clear lock clear control keycode 66 = Control_L add control = Control_L add Lock = Control_R
This replaces CapsLock with control and also replaces the Ctrl key on the right side with CapsLock just in case you ever need to use it. Most login systems (GDM, KDM, etc) will load this file when you log in so you might not need to do anything extra for it to take effect, just log out and log back in again. If that doesn’t seem to work, you can add this line to one of your startup files (.xinitrc
, .profile
, window manager configuration, etc):
xmodmap ~/.Xmodmap
This beautifully written Replace CapsLock with CTRL section credits to Emacs From Scratch
💬 Ask a question 📖 Read questionsI get questions by email, occasionally. This way anyone can read the answer!
Anything means anything. Personal questions. Money. Work. Life. Code. Cooking. Traveling. Sports. Teaching. Pokémon. Whatever. 😂
This project is open source software licensed under the GNU General Public Licence version 3.
Copyright © 2022-present, Likhon Baroy <[email protected]>.