Compare commits

..

3 Commits

Author SHA1 Message Date
3eeead29fd company mode 2024-11-18 11:34:03 +07:00
9f3a05e500 Clipboard integration 2024-11-18 11:32:41 +07:00
629baa89b3 Add indent guides 2024-11-18 11:30:11 +07:00

36
init.el
View File

@ -25,6 +25,22 @@
(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 was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
@ -72,6 +88,26 @@ version 2022-06-09"
;; Disable line numbers for Treemacs
(add-hook 'treemacs-mode-hook (lambda () (display-line-numbers-mode 0)))
;; Clipboard integration (Not work in terminal)
(setq select-enable-clipboard t)
(setq select-enable-primary t)
;; Clipboard integration for terminal (Need xclip)
(when (not (display-graphic-p)) ;; Check if Emacs is running in the terminal
(defun my-copy-to-clipboard ()
"Copy region to clipboard using xclip."
(interactive)
(if (use-region-p)
(let ((text (buffer-substring-no-properties (region-beginning) (region-end))))
(with-temp-buffer
(insert text)
(call-process-region (point-min) (point-max) "xclip" nil 0 nil "-selection" "clipboard"))
(message "Copied to clipboard"))
(message "No region selected.")))
(global-set-key (kbd "C-c M-w") 'my-copy-to-clipboard))
;; For example, set the default tab width to 4 spaces
(setq-default tab-width 4)
;; For Python mode, set the indentation style