Skip to content

Commit

Permalink
updated for latest mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajkumar Natarajan committed Jan 11, 2023
1 parent 4eb7349 commit 88e89f7
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 52 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.cache/
cache/
.extension/
elpa/
eshell/
url/
transient/
9 changes: 8 additions & 1 deletion centaur-tabs.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
(use-package centaur-tabs
;;; centaur.el --- add tabs to your emacs editor
;;; commentary:
;;; code:

:(use-package centaur-tabs
:config
(setq centaur-tabs-style "bar"
centaur-tabs-height 32
Expand All @@ -11,3 +15,6 @@
(centaur-tabs-mode t)
(setq uniquify-separator "/")
(setq uniquify-buffer-name-style 'forward))

(provide 'centaur-tabs)
;;; centaur-tabs.el ends here
12 changes: 11 additions & 1 deletion clojure.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; clojure.el --- setup clojure lsp for emacs
;;; commentary:
;;; code:

(setq package-selected-packages '(clojure-mode lsp-mode cider lsp-treemacs flycheck company))

(when (cl-find-if-not #'package-installed-p package-selected-packages)
Expand All @@ -13,7 +17,13 @@
treemacs-space-between-root-nodes nil
company-minimum-prefix-length 1
lsp-lens-enable t
lsp-signature-auto-activate nil
lsp-signature-auto-activate nil
; lsp-enable-indentation nil ; uncomment to use cider indentation instead of lsp
; lsp-enable-completion-at-point nil ; uncomment to use cider completion instead of lsp
)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)


(provide 'clojure)
;;; clojure.el ends here
7 changes: 7 additions & 0 deletions cmake.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; cmake.el --- setup cmake lsp for emacs
;;; commentary:
;;; code:

(use-package lsp-mode
:ensure t)

Expand All @@ -10,3 +14,6 @@
:ensure t
:after cmake-mode
:config (cmake-font-lock-activate))

(provide 'cmake)
;;; cmake.el ends here
7 changes: 7 additions & 0 deletions cpp.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; cpp.el --- set clangd lsp for c/c++
;;; commentary:
;;; code:

(setq package-selected-packages '(lsp-mode yasnippet lsp-treemacs helm-lsp
projectile hydra flycheck company avy which-key helm-xref dap-mode))

Expand Down Expand Up @@ -28,3 +32,6 @@
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
(require 'dap-cpptools)
(yas-global-mode))

(provide 'cpp)
;;; cpp.el ends here
14 changes: 9 additions & 5 deletions golang.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; golang.el --- setup golang lsp for emacs
;;; commentary:
;;; code:

(use-package go-mode
:mode "\\.go\\'"
:hook (before-save . gofmt-before-save))
Expand All @@ -17,8 +21,7 @@
;; disable Yasnippet
(setq lsp-enable-snippet nil)
(setq lsp-prefer-flymake nil) ; Use lsp-ui and flycheck
(setq flymake-fringe-indicator-position 'right-fringe)
)
(setq flymake-fringe-indicator-position 'right-fringe))

(use-package flycheck-golangci-lint
:ensure t)
Expand All @@ -35,12 +38,13 @@
(use-package dap-ui
:ensure nil
:config
(dap-ui-mode 1)
)
)
(dap-ui-mode 1)))

(defun lsp-go-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))

(add-hook 'go-mode-hook #'lsp-go-install-save-hooks)

(provide 'golang)
;;; golang.el ends here
7 changes: 7 additions & 0 deletions haskell.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; haskel.el -- setup haskell lsp for emacs
;;; commentary:
;;; code:

(setenv "PATH" (concat (getenv "HOME") "/.ghcup/bin:" (getenv "HOME") "/.local/bin:" "/usr/local/bin:" (getenv "PATH")))

(setq exec-path
Expand Down Expand Up @@ -34,3 +38,6 @@

(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp)

(provide 'haskell)
;;; haskell.el ends here
46 changes: 42 additions & 4 deletions init.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
(menu-bar-mode -1)
;;; init.el --- setup emacs configs
;;; commentary:
;;; code:

(menu-bar-mode -1)
(tool-bar-mode -1)

;;(setq EMACS_DIR "~/.emacs.d/")
Expand All @@ -15,27 +19,49 @@
(package-install 'use-package))

(eval-when-compile (require 'use-package))

(use-package all-the-icons :ensure t)
(use-package all-the-icons-completion :ensure t)
(use-package all-the-icons-gnus :ensure t)
(use-package all-the-icons-dired :ensure t)
(use-package all-the-icons-ivy :ensure t)
(use-package all-the-icons-ivy-rich :ensure t)
(use-package all-the-icons-ibuffer :ensure t)
(use-package treemacs-all-the-icons :ensure t)
(use-package winum)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-enabled-themes '(doom-palenight))
'(custom-safe-themes
'("c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" default))
'("5f128efd37c6a87cd4ad8e8b7f2afaba425425524a68133ac0efd87291d05874" "c83c095dd01cde64b631fb0fe5980587deec3834dc55144a6e78ff91ebc80b19" default))
'(package-selected-packages
'(helm-swoop lsp-java clojure-mode lsp-mode cider lsp-treemacs flycheck company)))
'(winum rainbow-mode spaceline-all-the-icons all-the-icons-dired all-the-icons-ibuffer all-the-icons-ivy all-the-icons-ivy-rich all-the-icons-completion all-the-icons centaur-tabs kaolin-themes helm-swoop lsp-java clojure-mode lsp-mode cider lsp-treemacs flycheck company rainbow-delimiters)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

(use-package kaolin-themes
:config
(load-theme 'kaolin-dark t)
(kaolin-treemacs-theme))

(when (string= system-type "darwin")
(setq dired-use-ls-dired t
insert-directory-program "~/.homebrew/bin/gls"
dired-listing-switches "-aBhl --group-directories-first"))


(load "~/.emacs.d/centaur-tabs.el")
(load "~/.emacs.d/treemacs.el")
(load "~/.emacs.d/cmake.el")
;;(load "~/.emacs.d/java.el")
(load "~/.emacs.d/java.el")
(load "~/.emacs.d/scala.el")
(load "~/.emacs.d/golang.el")
(load "~/.emacs.d/python.el")
Expand All @@ -47,3 +73,15 @@


(add-hook 'emacs-startup-hook 'treemacs)

(set-face-attribute 'default nil
:family "Monofurbold Nerd Font Mono"
:height 160
:weight 'normal
:width 'normal)

(setq rainbow-delimiters-mode t)
(winum-mode t)

;;; (provide init)
;;; init.el ends here
22 changes: 12 additions & 10 deletions java.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; java.el --- setup java lsp
;;; commentary:
;;; code:

(setq EMACS_DIR "~/.emacs.d/")

;;Set language environment to UTF-8
Expand Down Expand Up @@ -68,8 +72,7 @@
(use-package ansi-color
:ensure t
:config
(add-hook 'compilation-filter-hook 'my/ansi-colorize-buffer)
)
(add-hook 'compilation-filter-hook 'my/ansi-colorize-buffer))

(use-package use-package-chords
:ensure t
Expand Down Expand Up @@ -192,8 +195,7 @@
([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
))
lsp-ui-doc-max-width 100))

(use-package helm-lsp
:ensure t
Expand All @@ -205,22 +207,22 @@
:ensure t
:hook (
(lsp-mode . lsp-enable-which-key-integration)
(java-mode . #'lsp-deferred)
)
(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
)
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)
)
(define-key lsp-mode-map (kbd "C-c l") lsp-command-map))

(use-package lsp-java
:ensure t
:config (add-hook 'java-mode-hook 'lsp))

(provide 'java)
;;; java.el ends here
4 changes: 4 additions & 0 deletions network-security.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;;;; -*- mode: lisp-data -*-
(
(:id "sha1:0674484044c7dcc24a8ac45935baa6fdfadcc8d5" :fingerprints ("sha1:17:e1:8b:27:f1:62:aa:e4:50:60:bf:9c:b2:c4:31:5c:71:b8:51:af") :host "marketplace.visualstudio.com:443" :conditions (:invalid-ocsp-status :invalid :verify-cert))
)
11 changes: 9 additions & 2 deletions python.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; python.el --- setup python lsp
;;; commentary:
;;; code:

(use-package python-mode
:ensure nil
:custom
Expand All @@ -6,5 +10,8 @@
(use-package lsp-mode
:defer t
:commands (lsp lsp-deferred)
:hook (python-mode . lsp-deferred)
)
:hook (python-mode . lsp-deferred))

(provide 'python)
;;; python.el ends here

34 changes: 16 additions & 18 deletions recentf
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
;;; Automatically generated by ‘recentf’ on Sat Mar 6 15:19:30 2021.
;;; Automatically generated by ‘recentf’ on Tue Jan 10 12:48:05 2023.

(setq recentf-list
'(
"/home/rajkumar/Coding/Java/maven-java-demo/my-app/src/main/java/com/mycompany/app/App.java"
"/home/rajkumar/Coding/Java/maven-java-demo/my-app/pom.xml"
"/home/rajkumar/.emacs.d/elpa/yasnippet-snippets-20210105.1346/yasnippet-snippets-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/quickrun-20201130.952/quickrun-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/helm-descbinds-20190501.935/helm-descbinds-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/use-package-chords-20181024.2322/use-package-chords-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/bind-chord-20171204.2010/bind-chord-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/key-chord-20201222.2030/key-chord-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/heaven-and-hell-20190713.1830/heaven-and-hell-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/doom-themes-20210302.1549/doom-themes-autoloads.el"
"/home/rajkumar/.emacs.d/java.el"
"/home/rajkumar/.emacs.d/scala.el"
"/home/rajkumar/.emacs.d/init.el"
"/home/rajkumar/.emacs.d/treemacs.el"
"/home/rajkumar/.emacs.d/tabnine.el"
"/home/rajkumar/.emacs.d/elpa/use-package-ensure-system-package-20180913.1501/use-package-ensure-system-package-autoloads.el"
"/home/rajkumar/.emacs.d/elpa/system-packages-20210103.8/system-packages-autoloads.el"
"/Users/rnatarajan/.emacs.d/centaur-tabs.el"
"/Users/rnatarajan/.emacs.d/clojure.el"
"/Users/rnatarajan/.emacs.d/cmake.el"
"/Users/rnatarajan/.emacs.d/cpp.el"
"/Users/rnatarajan/.emacs.d/golang.el"
"/Users/rnatarajan/.emacs.d/haskell.el"
"/Users/rnatarajan/.emacs.d/init.el"
"/Users/rnatarajan/.emacs.d/java.el"
"/Users/rnatarajan/.emacs.d/treemacs.el"
"/Users/rnatarajan/.emacs.d/tabnine.el"
"/Users/rnatarajan/.emacs.d/scala.el"
"/Users/rnatarajan/.emacs.d/recentf"
"/Users/rnatarajan/.emacs.d/python.el"
"/Users/rnatarajan/.emacs.d/network-security.data"
"/Users/rnatarajan/.emacs.d/url/cookies"
))

(setq recentf-filter-changer-current 'nil)
Expand Down
26 changes: 15 additions & 11 deletions scala.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
;;; scala.el --- setup scala lsp in emacs
;;; commentary:
;;; code:

;; Enable defer and ensure by default for use-package
;; Keep auto-save/backup files separate from source code: https://github.com/scalameta/metals/issues/1027
Expand All @@ -22,8 +25,7 @@
'self-insert-command
minibuffer-local-completion-map)
;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152
(setq sbt:program-options '("-Dsbt.supershell=false"))
)
(setq sbt:program-options '("-Dsbt.supershell=false")))

;; Enable nice rendering of diagnostics like compile errors.
(use-package flycheck
Expand All @@ -41,11 +43,12 @@
;; (setq lsp-idle-delay 0.500)
;; (setq lsp-log-io nil)
;; (setq lsp-completion-provider :capf)
(setq lsp-prefer-flymake nil))

(setq lsp-prefer-flymake nil)
(setq lsp-keep-workspace-alive nil))

;; Add metals backend for lsp-mode
(use-package lsp-metals
:config (setq lsp-metals-treeview-show-when-views-received t))
(use-package lsp-metals)

;; Enable nice rendering of documentation on hover
;; Warning: on some systems this package can reduce your emacs responsiveness significally.
Expand All @@ -62,14 +65,15 @@
;; 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-package company-lsp)

;; Use the Debug Adapter Protocol for running tests and debugging
(use-package posframe
;; Posframe is a pop-up tool that must be manually installed for dap-mode
)
;; Posframe is a pop-up tool that must be manually installed for dap-mode
(use-package posframe)
(use-package dap-mode
:hook
(lsp-mode . dap-mode)
(lsp-mode . dap-ui-mode)
)
(lsp-mode . dap-ui-mode))

(provide 'scala)
;;; scala.el ends here
7 changes: 7 additions & 0 deletions tabnine.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
;;; tabnine.el --- setup tabnine completion for emacs
;;; commentary:
;;; code:

(use-package company-tabnine :ensure t)
;;(add-to-list 'company-backends #'company-tabnine)

Expand All @@ -22,3 +26,6 @@

(advice-add #'company--transform-candidates :around #'my-company--transform-candidates)
(advice-add #'company-tabnine :around #'my-company-tabnine)

(provide 'tabnine)
;;; tabnine.el ends here
Loading

0 comments on commit 88e89f7

Please sign in to comment.