-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rajkumar Natarajan
committed
Feb 10, 2023
1 parent
673dc14
commit 46e78b6
Showing
7 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
;;; early-init.el --- Emacs early init -*- lexical-binding: t; -*- | ||
|
||
;;; Commentary: | ||
|
||
;; Emacs 27 introduced early-init.el, which is run before init.el, before | ||
;; package and UI initialization happens. | ||
|
||
;;; Code: | ||
|
||
(defconst emacs-start-time (current-time)) | ||
|
||
;; Uncomment this to debug. | ||
;; (setq init-file-debug t) | ||
;; (setq messages-buffer-max-lines 100000) | ||
|
||
;; If an `.el' file is newer than its corresponding `.elc', load the `.el'. | ||
(setq load-prefer-newer t) | ||
|
||
;; improve startup time by pausing garbage collection during init | ||
(setq gc-cons-threshold most-positive-fixnum) | ||
(setq gc-cons-percentage 0.6) | ||
|
||
;; Write any customizations to a temp file so they are discarded. | ||
(setq custom-file (make-temp-file "custom-" nil ".el")) | ||
|
||
;; Faster to disable these here (before they've been initialized) | ||
(push '(menu-bar-lines . 0) default-frame-alist) | ||
(push '(tool-bar-lines . 0) default-frame-alist) | ||
(push '(vertical-scroll-bars) default-frame-alist) | ||
|
||
;; Give the frame basic coloring while waiting for the theme to load. The main | ||
;; purpose of this is to not blind me when it's dark by flashing a screen full | ||
;; of white. These colors are from doom-one. | ||
(set-face-attribute 'default nil :background "#282c34" :foreground "#bbc2cf") | ||
;; Default frame settings. This is actually maximized, not full screen. | ||
(push '(fullscreen . maximized) initial-frame-alist) | ||
(push '(ns-transparent-titlebar . t) default-frame-alist) | ||
|
||
;; Resizing the Emacs frame can be a terribly expensive part of changing the | ||
;; font. By inhibiting this, we easily halve startup times with fonts that are | ||
;; larger than the system default. | ||
(setq frame-inhibit-implied-resize t | ||
frame-resize-pixelwise t) | ||
|
||
;; Ignore X resources; its settings would be redundant with the other settings | ||
;; in this file and can conflict with later config (particularly where the | ||
;; cursor color is concerned). | ||
(advice-add #'x-apply-session-resources :override #'ignore) | ||
|
||
;; These are good notes on optimizing startup performance: | ||
;; https://github.com/hlissner/doom-emacs/wiki/FAQ#how-is-dooms-startup-so-fast | ||
|
||
;; Unset `file-name-handler-alist' too (temporarily). Every file opened and | ||
;; loaded by Emacs will run through this list to check for a proper handler for | ||
;; the file, but during startup, it won’t need any of them. | ||
(defvar file-name-handler-alist-old file-name-handler-alist) | ||
(setq file-name-handler-alist nil) | ||
(add-hook 'emacs-startup-hook | ||
(lambda () | ||
(setq file-name-handler-alist file-name-handler-alist-old))) | ||
|
||
;; Disable `package' in favor of `straight'. | ||
(setq package-enable-at-startup nil) | ||
|
||
|
||
;; Allow loading from the package cache. | ||
(setq package-quickstart nil) | ||
|
||
(menu-bar-mode -1) | ||
(tool-bar-mode -1) | ||
(scroll-bar-mode -1) | ||
|
||
(provide 'early-init) | ||
;;; early-init.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
;; sample `helm' configuration use https://github.com/emacs-helm/helm/ for details | ||
(helm-mode) | ||
|
||
(use-package helm | ||
:ensure t | ||
:init | ||
(helm-mode 1) | ||
(progn (setq helm-buffers-fuzzy-matching t)) | ||
:bind | ||
(("C-c h" . helm-command-prefix)) | ||
(("M-x" . helm-M-x)) | ||
(("C-x C-f" . helm-find-files)) | ||
(("C-x b" . helm-buffers-list)) | ||
(("C-c b" . helm-bookmarks)) | ||
(("C-c f" . helm-recentf)) ;; Add new key to recentf | ||
(("C-c g" . helm-grep-do-git-grep))) ;; Search using grep in a git project | ||
|
||
(use-package helm-descbinds | ||
:ensure t | ||
:bind ("C-h b" . helm-descbinds)) | ||
|
||
|
||
|
||
(use-package helm-swoop | ||
:ensure t | ||
:chords | ||
("js" . helm-swoop) | ||
("jp" . helm-swoop-back-to-last-point) | ||
:init | ||
(bind-key "M-m" 'helm-swoop-from-isearch isearch-mode-map) | ||
|
||
;; If you prefer fuzzy matching | ||
(setq helm-swoop-use-fuzzy-match t) | ||
|
||
;; Save buffer when helm-multi-swoop-edit complete | ||
(setq helm-multi-swoop-edit-save t) | ||
|
||
;; If this value is t, split window inside the current window | ||
(setq helm-swoop-split-with-multiple-windows nil) | ||
|
||
;; Split direction. 'split-window-vertically or 'split-window-horizontally | ||
(setq helm-swoop-split-direction 'split-window-vertically) | ||
|
||
;; If nil, you can slightly boost invoke speed in exchange for text color | ||
(setq helm-swoop-speed-or-color nil) | ||
|
||
;; ;; Go to the opposite side of line from the end or beginning of line | ||
(setq helm-swoop-move-to-line-cycle t)) | ||
|
||
(require 'helm-xref) | ||
(define-key global-map [remap find-file] #'helm-find-files) | ||
(define-key global-map [remap execute-extended-command] #'helm-M-x) | ||
(define-key global-map [remap switch-to-buffer] #'helm-mini) | ||
|
||
|
||
|
||
(use-package lsp-ui | ||
:ensure t | ||
:after (lsp-mode) | ||
:bind (:map lsp-ui-mode-map | ||
([remap xref-find-definitions] . lsp-ui-peek-find-definitions) | ||
([remap xref-find-references] . lsp-ui-peek-find-references)) | ||
:init (setq lsp-ui-doc-delay 1.5 | ||
lsp-ui-doc-position 'bottom | ||
lsp-ui-doc-max-width 100)) | ||
|
||
(use-package helm-lsp | ||
:ensure t | ||
:after (lsp-mode) | ||
:commands (helm-lsp-workspace-symbol) | ||
:init (define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
;;; lsp.el --- setup common lsp config here | ||
;;; commentary: | ||
;;; code: | ||
|
||
(use-package lsp-mode | ||
:ensure t) | ||
|
||
(use-package yasnippet | ||
:ensure t) | ||
|
||
(use-package lsp-ui | ||
:ensure t | ||
:commands lsp-ui-mode) | ||
|
||
|
||
(use-package lsp-mode | ||
:ensure t | ||
:hook ( | ||
(lsp-mode . lsp-enable-which-key-integration) | ||
(java-mode . #'lsp-deferred)) | ||
:init (setq | ||
lsp-keymap-prefix "C-c l" ; this is for which-key integration documentation, need to use lsp-mode-map | ||
lsp-enable-file-watchers nil | ||
read-process-output-max (* 1024 1024) ; 1 mb | ||
lsp-completion-provider :capf | ||
lsp-idle-delay 0.500) | ||
:config | ||
(setq lsp-intelephense-multi-root nil) ; don't scan unnecessary projects | ||
(with-eval-after-load 'lsp-intelephense | ||
(setf (lsp--client-multi-root (gethash 'iph lsp-clients)) nil)) | ||
(define-key lsp-mode-map (kbd "C-c l") lsp-command-map)) | ||
|
||
;; Enable nice rendering of documentation on hover | ||
;; Warning: on some systems this package can reduce your emacs responsiveness significally. | ||
;; (See: https://emacs-lsp.github.io/lsp-mode/page/performance/) | ||
;; In that case you have to not only disable this but also remove from the packages since | ||
;; lsp-mode can activate it automatically. | ||
(use-package lsp-ui) | ||
|
||
;; lsp-mode supports snippets, but in order for them to work you need to use yasnippet | ||
;; If you don't want to use snippets set lsp-enable-snippet to nil in your lsp-mode settings | ||
;; to avoid odd behavior with snippets and indentation | ||
(use-package yasnippet) | ||
|
||
;; Add company-lsp backend for metals. | ||
;; (depending on your lsp-mode version it may be outdated see: | ||
;; https://github.com/emacs-lsp/lsp-mode/pull/1983) | ||
;;(use-package company-lsp) | ||
|
||
;; Use the Debug Adapter Protocol for running tests and debugging | ||
;; Posframe is a pop-up tool that must be manually installed for dap-mode | ||
(use-package posframe) | ||
|
||
(use-package lsp-ivy | ||
:ensure t) | ||
|
||
(use-package lsp-treemacs | ||
:ensure t | ||
:bind (("M-<f7>" . lsp-find-references))) | ||
|
||
(use-package dap-mode | ||
:hook | ||
(lsp-mode . dap-mode) | ||
(lsp-mode . dap-ui-mode)) | ||
|
||
|
||
(provide 'lsp.el) | ||
;;; lsp.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
;; Bottom of Emacs will show what branch you're on | ||
;; and whether the local file is modified or not. | ||
(use-package magit | ||
:init (require 'magit-files) | ||
:bind (("C-c M-g" . magit-file-dispatch)) | ||
:custom ;; Do not ask about this variable when cloning. | ||
(magit-clone-set-remote.pushDefault t)) | ||
|
||
;; When we invoke magit-status, show green/red the altered lines, with extra | ||
;; green/red on the subparts of a line that got alerted. | ||
;;(system-packages-ensure "git-delta") | ||
|
||
(use-package magit-delta | ||
:ensure t | ||
:hook (magit-mode . magit-delta-mode)) | ||
|
||
|
||
;; MA: The todo keywords work in code too! | ||
(use-package magit-todos | ||
:after magit | ||
:after hl-todo | ||
;; :hook (org-mode . magit-todos-mode) | ||
:config | ||
;; For some reason cannot use :custom with this package. | ||
(custom-set-variables | ||
'(magit-todos-keywords (list "TODO" "FIXME" "MA" "WK" "JC"))) | ||
;; Ignore TODOs mentioned in exported HTML files; they're duplicated from org src. | ||
(setq magit-todos-exclude-globs '("*.html")) | ||
(magit-todos-mode)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
;; This package requires the fonts included with all-the-icons to be installed. Run M-x all-the-icons-install-fonts to do so. | ||
;; The modeline looks really nice with doom-themes, e.g., doom-solarised-light. | ||
(use-package doom-modeline | ||
:config (doom-modeline-mode)) | ||
|
||
;; Use minimal height so icons still fit; modeline gets slightly larger when | ||
;; buffer is modified since the "save icon" shows up. Let's disable the icon. | ||
;; Let's also essentially disable the hud bar, a sort of progress-bar on where we are in the buffer. | ||
(setq doom-modeline-height 1) | ||
(setq doom-modeline-buffer-state-icon nil) | ||
(setq doom-modeline-hud t) | ||
(setq doom-modeline-bar-width 1) | ||
|
||
;; Show 3 Flycheck numbers: “red-error / yellow-warning / green-info”, which | ||
;; we can click to see a listing. | ||
;; If not for doom-modeline, we'd need to use flycheck-status-emoji.el. | ||
(setq doom-modeline-checker-simple-format nil) | ||
|
||
;; Don't display the buffer encoding, E.g., “UTF-8”. | ||
(setq doom-modeline-buffer-encoding nil) | ||
|
||
;; Inactive buffers' modeline is greyed out. | ||
;; (let ((it "Source Code Pro Light" )) | ||
;; (set-face-attribute 'mode-line nil :family it :height 100) | ||
;; (set-face-attribute 'mode-line-inactive nil :family it :height 100)) | ||
|
||
|
||
(setq doom-modeline-minor-modes t) | ||
(use-package minions | ||
:init (minions-mode)) | ||
|
||
;; A quick hacky way to add stuff to doom-modeline is to add to the mode-line-process list. | ||
;; E.g.: (add-to-list 'mode-line-process '(:eval (format "%s" (count-words (point-min) (point-max))))) | ||
;; We likely want to add this locally, to hooks on major modes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
;;; -*- lisp-data -*- | ||
(("/Users/rnatarajan/Documents/Coding/ekata/identity-check-ng/")) |