Separating the the packages setup

This commit is contained in:
Dita Aji Pratama 2024-11-19 12:45:08 +07:00
parent 3eeead29fd
commit 250e62d0c0
2 changed files with 55 additions and 41 deletions

43
init.el
View File

@ -1,45 +1,6 @@
(require 'package) (add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
(package-initialize) (load-file (expand-file-name "setup-packages.el" (concat user-emacs-directory "lisp")))
(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 )
)
(use-package multiple-cursors
:ensure t
:config
(global-set-key (kbd "C-c <down>") 'mc/mark-next-like-this)
(global-set-key (kbd "C-c <up>") '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
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.

53
lisp/setup-packages.el Normal file
View File

@ -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 <down>") 'mc/mark-next-like-this)
(global-set-key (kbd "C-c <up>") 'mc/mark-previous-like-this)
;(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
;(global-set-key (kbd "C-S-<mouse-1>") '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))