From 250e62d0c0fbe31787f66daa1155e0a784bc98d0 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Tue, 19 Nov 2024 12:45:08 +0700 Subject: [PATCH] Separating the the packages setup --- init.el | 43 ++-------------------------------- lisp/setup-packages.el | 53 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 41 deletions(-) create mode 100644 lisp/setup-packages.el diff --git a/init.el b/init.el index 0c30182..cd28e5c 100644 --- a/init.el +++ b/init.el @@ -1,45 +1,6 @@ -(require 'package) -(package-initialize) -(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) -(unless (package-installed-p 'use-package) - (package-install 'use-package)) -(require 'use-package) +(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory)) +(load-file (expand-file-name "setup-packages.el" (concat user-emacs-directory "lisp"))) -(use-package rainbow-mode :ensure t) -(use-package treemacs - :ensure t - :config - (treemacs-follow-mode t) ;; Enable follow mode - (setq treemacs-show-hidden-files t) ;; Show hidden files (optional) - (treemacs-fringe-indicator-mode t) ;; Show fringe indicators - (treemacs-git-mode 'deferred) ;; Enable Git integration - (global-set-key (kbd "C-c \\" ) 'treemacs ) ;; Tree Toggle - (global-set-key (kbd "C-c C-\\" ) 'treemacs-select-window ) ;; Tree Focus - (global-set-key (kbd "C-c M-`" ) 'treemacs-edit-workspaces ) - (global-set-key (kbd "C-c TAB" ) 'treemacs-next-workspace ) - ) -(use-package multiple-cursors - :ensure t - :config - (global-set-key (kbd "C-c ") 'mc/mark-next-like-this) - (global-set-key (kbd "C-c ") 'mc/mark-previous-like-this) - ) - -(use-package highlight-indent-guides - :ensure t - :hook ((prog-mode . highlight-indent-guides-mode) ; Enable in programming modes - (treemacs-mode . (lambda () (highlight-indent-guides-mode -1)))) ; Disable in Treemacs - :config - (setq highlight-indent-guides-method 'character) ; Choose method: 'character', 'fill', or 'column' - (setq highlight-indent-guides-auto-enabled t) - (setq highlight-indent-guides-responsive 'top) - (setq highlight-indent-guides-character ?\|)) ; Character to display as indent guide - - -(use-package company - :ensure t - :config - (global-company-mode t)) (custom-set-variables ;; custom-set-variables was added by Custom. diff --git a/lisp/setup-packages.el b/lisp/setup-packages.el new file mode 100644 index 0000000..9352ce7 --- /dev/null +++ b/lisp/setup-packages.el @@ -0,0 +1,53 @@ +(require 'package) + +(package-initialize) + +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) + +(unless (package-installed-p 'use-package) + (package-install 'use-package)) + +(require 'use-package) + +(use-package rainbow-mode :ensure t) + +(use-package treemacs + :ensure t + :config + (treemacs-follow-mode t) ;; Enable follow mode + (setq treemacs-show-hidden-files t) ;; Show hidden files (optional) + (treemacs-fringe-indicator-mode t) ;; Show fringe indicators + (treemacs-git-mode 'deferred) ;; Enable Git integration + (global-set-key (kbd "C-c \\" ) 'treemacs ) ;; Tree Toggle + (global-set-key (kbd "C-c C-\\" ) 'treemacs-select-window ) ;; Tree Focus + (global-set-key (kbd "C-c M-`" ) 'treemacs-edit-workspaces ) + (global-set-key (kbd "C-c TAB" ) 'treemacs-next-workspace ) + ;(global-set-key (kbd "M-`" ) 'treemacs-switch-workspace ) + ;(global-set-key (kbd "C-x w ." ) 'treemacs-next-workspace ) + ;(global-set-key (kbd "C-x w ," ) 'treemacs-previous-workspace ) + ) + +(use-package multiple-cursors + :ensure t + :config + ;(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) + (global-set-key (kbd "C-c ") 'mc/mark-next-like-this) + (global-set-key (kbd "C-c ") 'mc/mark-previous-like-this) + ;(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) + ;(global-set-key (kbd "C-S-") 'mc/add-cursor-on-click) + ) + +(use-package highlight-indent-guides + :ensure t + :hook ((prog-mode . highlight-indent-guides-mode) ; Enable in programming modes + (treemacs-mode . (lambda () (highlight-indent-guides-mode -1)))) ; Disable in Treemacs + :config + (setq highlight-indent-guides-method 'character) ; Choose method: 'character', 'fill', or 'column' + (setq highlight-indent-guides-auto-enabled t) + (setq highlight-indent-guides-responsive 'top) + (setq highlight-indent-guides-character ?\|)) ; Character to display as indent guide + +(use-package company + :ensure t + :config + (global-company-mode t))