Welcome to my Emacs config file!
(fset 'yes-or-no-p 'y-or-n-p)
(global-auto-revert-mode)
(fringe-mode '(nil . 0))
(show-paren-mode t)
(size-indication-mode t)
(scroll-bar-mode -1)
(menu-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(column-number-mode t)
(electric-layout-mode t)
(electric-pair-mode t)
(set-face-attribute 'default nil
:height 90
:family "Fira Code Retina")
(use-package all-the-icons
:ensure t)
(use-package doom-modeline
:ensure t
:defer t
:hook (after-init . doom-modeline-mode)
:config
(setq doom-modeline-height 10
doom-modeline-buffer-file-name-style 'truncate-from-project
doom-modeline-icon t
doom-modeline-major-mode-icon t
doom-modeline-minor-modes nil
doom-modeline-lsp nil
doom-modeline-github t
doom-modeline-github-interval (* 30 60)))
esto es un apaño del doom-modeline con emacsclient
(if (daemonp)
(add-hook 'after-make-frame-functions
(setq doom-modeline-icon t)))
(use-package doom-themes
:ensure t
:config
(doom-themes-visual-bell-config)
(doom-themes-neotree-config) ; all-the-icons fonts must be installed!
(doom-themes-org-config)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
)
(use-package kaolin-themes
:ensure t
:init (load-theme 'kaolin-dark t))
(use-package company
:diminish
:ensure t
:init (global-company-mode)
:config
(setq company-auto-complete t
company-auto-complete-chars '(40 34 60)
company-idle-delay 0
company-minimum-prefix-length 3)
(company-quickhelp-mode))
(use-package company-quickhelp
:ensure t)
(use-package company-quickhelp-terminal
:ensure t)
;; not supported anymore
;;(use-package company-lsp
;; :ensure t
;; :commands company-lsp)
(use-package dashboard
:ensure t
:config
;;(add-hook 'after-init-hook 'dashboard-refresh-buffer)
(add-hook 'dashboard-mode-hook (lambda () (page-break-lines-mode 1)))
(add-hook 'dashboard-mode-hook (lambda () (nlinum-mode -1)))
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
(setq dashboard-items
'(
(recents . 5)
(bookmarks . 5)
(projects . 5)
))
(setq dashboard-center-content t)
(setq recentf-exclude '("^/var/folders\\.*"
"COMMIT_EDITMSG\\'"
".*-autoloads\\.el\\'"
"[/\\]\\.elpa/"))
(setq dashboard-set-init-info t)
(setq dashboard-set-footer t)
(setq dashboard-show-shortcuts t)
;;(setq dashboard-page-separator "\n\f\n")
(setq dashboard-set-navigator t)
(setq dashboard-navigator-buttons
`(;; line1
((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
"Homepage"
""
(lambda (&rest _) (browse-url "https://github.com")))
(,(all-the-icons-fileicon "emacs" :height 1.1 :v-adjust 0.0)
"Emacs Config"
""
(lambda (&rest _) (find-file "~/.emacs.d/emacs.org")))
)))
(dashboard-setup-startup-hook)
)
(use-package dimmer
:ensure t
:config
(require 'dimmer)
(dimmer-configure-which-key)
(dimmer-configure-helm)
(dimmer-mode t)
(setq dimmer-fraction 0.58))
(use-package flycheck
:ensure t
:init (global-flycheck-mode t))
(use-package flycheck-rust
:ensure t
:config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
(use-package ivy
:ensure t)
(use-package helm
:ensure t
:init (helm-mode 1)
:bind (("<menu>" . helm-M-x)
("M-x" . helm-M-x)
("C-x r b" . helm-filtered-bookmarks)
("C-x C-f" . helm-find-files)
("C-x b" . helm-mini)
("C-x C-b". helm-buffers-list))
:config
(helm-autoresize-mode 1))
(use-package helm-tramp
:ensure t
:bind ("M-s h" . helm-tramp)
:config (setq tramp-default-method "ssh"))
(use-package lsp-mode
:ensure t
:init (setq lsp-keymap-prefix "C-c l")
(add-to-list 'exec-path "~/elixir_ls")
:hook ((lsp-mode . lsp-enable-which-key-integration)
(sh-mode . lsp)
(python-mode . lsp)
(cc-mode . lsp)
(arduino-mode . lsp)
(rust-mode . lsp)
(elixir-mode . lsp)
(typescript-mode . lsp))
:commands lsp)
;; python server
(use-package lsp-pyright
:ensure t
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or lsp-deferred
LSP UI for doc windows
(use-package lsp-ui
:ensure t
:bind (("C-c l i" . lsp-ui-imenu)
("C-c l f" . lsp-ui-doc-focus-frame)
("C-c l u" . lsp-ui-doc-unfocus-frame))
:init
(lsp-ui-mode)
(lsp-ui-doc-mode)
(setq lsp-ui-doc-delay 1)
(setq lsp-ui-doc-position 'at-point)
(setq lsp-ui-doc-show-with-cursor t)
:commands lsp-ui-mode)
(use-package neotree
:ensure t
:init
:config
(setq-default neo-show-hidden-files t)
(setq neo-smart-open t)
(setq projectile-switch-project-action 'neotree-projectile-action)
(global-set-key [f8] 'neotree-toggle)
;; Disable line-numbers minor mode for neotree
(add-hook 'neo-after-create-hook
;;(lambda (&rest _) (display-line-numbers-mode -1))))
(lambda (&rest _) (nlinum-mode -1))))
(use-package nlinum
:ensure t
:config
(global-nlinum-mode))
(use-package org
:ensure t
:if window-system
:config
(require 'org-beautify-theme)
(setq org-support-shift-select 'always
org-src-tab-acts-natively 'always))
(use-package page-break-lines
:ensure t
:config
(setq page-break-lines-char 45
page-break-lines-max-width 0))
(use-package projectile
:ensure t
:bind (("M-p" . projectile-command-map))
:init (projectile-mode)
(setq projectile-enable-caching t
projectile-indexing-method 'alien
projectile-sort-order 'recently-active
projectile-completion-system 'ivy))
(use-package rainbow-delimiters
:ensure t
:init
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode 1))
i think its cool but i don’t use it at all on emacs lol
(use-package ranger
:ensure t
:bind (("<f9>" . ranger)))
(use-package which-key
:ensure t
:config (which-key-mode))
(use-package yasnippet
:ensure t
:init (yas-global-mode t)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil))
(use-package yasnippet-snippets
:ensure t)
(use-package telega
:ensure t
:commands (telega)
:defer t
:config
(setq telega-emoji-company-backend 'telega-company-emoji)
;; Code blocks
(require 'telega-mnz)
;; Chats in Emacs Dashboard
(require 'telega-dashboard)
(add-to-list 'dashboard-items '(telega-chats . 3))
;; Emacs Stories
(require 'telega-stories)
(telega-stories-mode 1)
(define-key telega-root-mode-map (kbd "v e") 'telega-view-emacs-stories)
)
;; Chatbuf completion
;; (add-hook 'telega-chat-mode-hook
;; (lambda ()
;; (set (make-local-variable 'company-backends)
;; (append '(telega-company-emoji
;; telega-company-username
;; telega-company-hashtag)
;; (when (telega-chat-bot-p telega-chatbuf--chat)
;; '(telega-company-botcmd))))
;; (company-mode 1)))
(use-package cc-mode
:ensure t
:config
(add-hook 'c-mode-hook (lambda () (c-set-style "user"))))
Useful for Arduino stuff!
It doesn’t work out of the box since for some reason it won’t detect the root directory of a PlatformIO project, so you might want to add an empty .projectile
file
manually in the root directory in order to work properly (AND also to have proper integration with Projectile :) )
(use-package platformio-mode
:ensure t
:commands (platformio-conditionally-enable))
(use-package poly-markdown
:ensure t)
(use-package poly-org
:ensure t)
(use-package polymode
:ensure t
:mode ("\.md$" . poly-markdown-mode)
:mode ("\.org$" . poly-org-mode)
:config
(define-hostmode poly-emacs-lisp-hostmode :mode 'emacs-lisp-mode))
(use-package toml-mode
:ensure t)
(use-package cargo
:ensure t
:hook (rust-mode . cargo-minor-mode))