Code Monkey home page Code Monkey logo

emacs-config's Introduction

BannerImg

Arsenic’s Emacs

The configuration is mostly inspired from David willson’s emacs from scratch series and Mingde (Matthew) Zeng’s M-Emacs, plus some extensions to make it fit for my personal workflow and C/C++ development needs.

most of the packages are set up using use-package declarations, and should make sure to download and install the packages before using it, so you don’t have to do it manually. This also means that it might take a lot of time the first time you try to set it up.

I personally use emacs-plus with support for native compilation and Xwidgets support enabled, the configuration should not break otherwise also so if it does, please report it via opening an issue.

Requirements

Repository structure

emacs-config
├── elisp/
│   └── init-<package-name>.el
├── non-melpa-elisp/
│   └──  packages that are not installed from MELPA
└── init.el
  • Initialization for similar modes exist in their own ./elisp/init-<package-name>.el file which is then loaded by the main init.el
  • init.el only initializes the load path and then loads all the configurations from ./elisp/ directory using (require 'init-<package-name>)
  • All The packages download from elpa repositories ( MELPA or GNU-ELPA ) should exist in their default location ( generally ./elpa/ )
  • All the packages that are not available on ELPA repository but are used by this config exist in =./non-melpa-elisp/= directory

Screenshots

./images/ss1.png ./images/ss2.png

How to use it ?

  1. clone/download
    • Non MELPA packages are provided with the repository as git submodules, you may use --recurse-submodules to initialize and update those submodules at the time of pulling.
    • MELPA packages are not provided and should be installed by (use-package) at the time of initial startup in the appropriate directory ( generally in elpa/ )
    • Here is how the sequence of commands should look like
      git clone --recurse-submodules https://github.com/Arsenic-ATG/Emacs-config.git
      cd Emacs-config
              
  2. load the init file:
    Now you would want to use the provided init file (init.el) instead of using it’s own default init file which could be either ~/.emacs.el or another .init.el file, check this link for more information about how to locate your initialization file . This can be done in 2 ways
    • Replace your default user directory (~/.emacs.d) with repository ( you might want to keep a backup of your old config if you go for this option).
    • Prevent emacs to load your local init file and use this file instead ( using -q and -u switches )

    read this official doc for more detailed info about the same.

  3. Start your Emacs:
    When launched for the first time, it might take more time than expected as on initial startup (use-package) will download and install all the packages ( so make sure to have stable connection to MELPA/GNU-ELPA package repositories )
  4. (optional) Restart Emacs:
    When all the packages are installed then you may restart the emacs to make sure (use-package) did it job correctly.

Doubts / Query

feel free to open an issue on GitHub if you face any issue during the installation or have any query regarding the configuration.

Suggestions for possible improvements ?

You are more than welcome to leave your suggestions via an Issue or a Pull Request, I would love to hear from you experts out there.

License

All code found in this repository is licensed under GPL v3.

emacs-config's People

Contributors

arsenic-atg avatar pscoder10462 avatar shivam-mittal01 avatar tj2001-cp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

emacs-config's Issues

`tab-bar-new-button` and `tab-bar-close-button` are reconfigured by emacs-plus

tab-bar-new-button and tab-bar-close-button, desipite being set to nill in elisp/init-tab-bar.el` are being reset by emacs-plus natively compiled configuration showing those annoying close button and new-tab button on tab bar.

Screenshot 2023-01-14 at 4 22 00 PM

I could just remove the configuration set by emacs-plus, but I am pretty sure there is a bit more elegant solution of the problem than that.

diminish a bunch of modes

not all the modes need to be showed in modeline, the config already uses diminish to declutter the modeline but still the modeline becomes very cluttered very soon, maybe a bit more packages need to be diminished.

beacon color is static cyan

Problem

currently the beacon color is set to static cyan which although might work for flate theme but would cause problems with other themes.

Possible fix

the beacon color should change according to the theme ( most likely the highlight color of the theme )

Configure ERC mode

despite being old technology, a lot of organisations ( especially open source ones ) still use IRC channels for general communication.
Though Emacs support IRC natively via ERC mode, it need a slight configuration for more productivity.

need an easier way to change the size of split buffers.

currently the default way to change the width/height of split buffer is to use the following functions

C-x ^ to make the current window taller (‘enlarge-window’)
C-x } to make it wider (‘enlarge-window-horizontally’)
C-x { to make it narrower (‘shrink-window-horizontally’)

though we can use universal arguments to to repeat this command multiple number of times, I am looking for a more interactive way.

currently thought is to either use hydra, use custom package or make a custom function for the same.

flickering issue in buffer list

buffer list automatically refreshes after a small interval, causing working on it almost impossible and extremely annoying task.

I guess enabling auto revert mode have something to do with it

Magit get's loaded at startup time

Problem Description

Magit is getting loaded at startup time and is taking a fair bit of startup time even though it is not needed at startup time.

Possible Fix

load magit when we first time need it ( maybe when calling magit-status function for the first time ), as magit's config is wrapped in use-package block, i should be as simple as adding such functions in :commands section of it.

(use-package magit
  :commands magit-status
.... )

Files of possible interest

Change cursor type to bar

I personally think that "bar" cursor looks much better and modern compared to classical "box" cursor which is there by default.

Create .gitignore files to ignore unimportant files

Currently there are a lot of files and directories that are not meant to be tracked by git right, creating a lot of noise in git-status ( magit-status buffer ) .
the repository should have a .gitignore file with all those entires to make git ignore all of them.

Always render emacs in full-screen mode ?

I currently use emacs mostly in full screen mode and barely switches back to windowed mode.

the config should start with toggle-frame-fullscreen as set.
This should most probably fit either in early config (which is yet to be populated) or in UI config (check elisp/init-ui-config.el )

Set up lsp for C++

Overview

The config needs lsp to give full IDE like experience, currently I am planning to only configure it for C++ as that is the environment I develop the most.

file/s of interest :

Setting up configuration to make use of xwidgets support for Emacs

Emacs can be built with xwidgets support which makes it possible for Emacs to render webkit based content, and thus allowing us to perform general web-browsing right from Emacs.

This not only includes rebuilding the Emacs with xwidget support but also change the documentation to contain information about the same.

use "use-package" for old config

currently the majority of the old config is set up rationally ( without use-package ), I think the entire config should be consistent and should use "use-package" for those also.

Org noter loads on startup

org noter is loading on Emacs startups, practically increasing the startup time of emacs.

Ideally we would only need org noter mode whenever we are in an org mode buffer, so it should be loaded after org or more preferably on first "org-noter" command.

install and configure cmake-mode

my workflow involves working with cmake files and cmake-mode helps in providing proper syntax highlighting and indentation in cmake files.

the configuration should be in init-cc.el file.

Install and configure web-mode

after a bit of experimenting around, I found out that web-mode is much more better when working with php files with embedded HTML in it.

Maybe there is a way to make php-mode and web-mode work hand in hand otherwise I would preffer to stick with web-mode instead of php-mode

Org-mode gets loaded at startup

Problem description

Org mode is a heavy package to load and we don't always need it at the time of startup.

Though the package is configured to be launched when we open an org file, org-tempo is being loaded at startup time which in-turn requires org mode to be loaded ( increasing the startup time by a lot )

Possible fix

setting org-temp code block to be evaluated after loading org mode should most probably fix this issue

(with-eval-after-load 'org
  ;; This is needed as of Org 9.2
  (require 'org-tempo)
  (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
  (add-to-list 'org-structure-template-alist '("py" . "src python"))
  (add-to-list 'org-structure-template-alist '("cpp" . "src cpp")))

Files of possible interest

Related issue #13

configure tab-bar-mode

since emacs 27.1 and above, we have got in-build support for tab bar mode.

The default configured tab bar is not very good, the config already have some basic config set up in init-ui-config.el, but I think this should get it's own separate configuration file ( init-tab-bar.el )

Add a readme file

The repo needs some kind of docs to introduce and guide others ( or even future me) around the repo

update screenshots with new theme in README.md

screenshots of readme.md are outdated ( especially the theme )

since #49 ,The configuration now uses a custom doom-theme (inspired from flate) which changes the looks of the editor enough to call for a screenshot replacement.

change dashboard-footer-icon

currently the dashboard icon is set to the following property

(:family "file-icons" :height 1.32 :inherit font-lock-keyword-face)

causing the following inconsistent coloration on dashboard with flate theme

Screenshot 2022-11-24 at 5 36 59 PM

It should either inherit face attributes from dashboard headings or from header to match their colors instead.

Add org noter

Add org noter to effortlessly take notes from PDF documents.

s-w keybinding bound twice

s-w key-combo is already bound to closing frame on emacs ( on macOS at-least ), and then bound again in tab-bar mode config on line 54

("s-w" . tab-bar-close-tab)

possible fix

simply unbound S-w in global config where all other keybindings are unbound.

 ;; Unbind unneeded keys
+(global-set-key (kbd "s-w") nil)
 (global-set-key (kbd "C-z") nil)
 (global-set-key (kbd "M-z") nil)
 (global-set-key (kbd "C-x C-z") nil)

files of interest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.