From b19f730b6f778032b2c0b997a7b3cea3c01c2018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurij=20Podgor=C5=A1ek?= Date: Thu, 16 Feb 2023 19:09:11 +0100 Subject: [PATCH] Emacs config apdejt! <3 --- .emacs.d/init.el | 721 ++++++++++++++++++++++++++++------------------- 1 file changed, 429 insertions(+), 292 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index f4c61cd..3b1e580 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -2,309 +2,379 @@ ;; PAKETI ;; ;;;;;;;;;;;; -;; Set up package.el to work with MELPA -(require 'package) -;; Sekvence n'shiat -(require 'seq) +;(setq use-package-compute-statistics t) + +(setq debug-on-error t) ;; Loudamo melpa paketice (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) -;; Kaj vse naj bo namesceno? -(setq paketi '(;; Use package - konfiguracijski macro - use-package - ;; Lazji keybindi - general - ;; Evil mode - evil - evil-collection - evil-org - ;; Global undo tree - undo-tree - ;; Gruvbox tema - gruvbox-theme - ;; Hemisu tema - hemisu-theme - ;; Doom themes - doom-themes - ;; Oblikovanje teksta - editorconfig - ;; Projekti - projectile - ;; Completion - company - ;; Completion2 - ivy - ;; Iskanje - swiper - ;; Izboljsani default ukazi bolj prijazni - counsel - ;; Iskanje po fajlih - rg - ;; Modeline - status bar spodaj (+ ikonice) - doom-modeline - ;; Lepe ikone :) - all-the-icons - ;; Pomoch - helpful - ;; Prikazi nedavne ukaze visje - smex - ;; Programiranje javascripta - js2-mode - rjsx-mode - ;; Vue - vue-mode - vue-html-mode - ;; Vue / js - lsp-mode - ;; Clojure language support - clojure-mode - ;; Guile language support - geiser - geiser-guile - paredit - rainbow-delimiters - gdscript-mode - php-mode - fennel-mode - arduino-mode - markdown-mode - yaml-mode - extempore-mode - ;; Checker za syntax? - flycheck - ;; Lepšanje fajlov na webu - web-beautify - ;; Tab alignment - smart-tabs-mode - ;; Dreva fajlov - treemacs - treemacs-projectile - treemacs-evil - ;; Pomoc za keybinde - which-key - ;; Git paket - magit - ;; dr00pal moud - drupal-mode - ;; Mermaid v orgmode - ob-mermaid - )) +;; Set up package.el to work with MELPA +(require 'package) -(setq nema (seq-filter (lambda (p) (not (package-installed-p p))) paketi)) -(when nema - (package-initialize) - (package-refresh-contents) - (dolist (p nema) - (package-install p))) +(package-initialize) + +;; Stare funkcije za namescanje paketov. Od use-package z :ensure naprej vec ne +;; Sekvence n'shiat +;(require 'seq) +;; Kaj vse naj bo namesceno? +;(setq paketi '()) +;(setq nema (seq-filter (lambda (p) (not (package-installed-p p))) paketi)) +;(when nema +; (package-initialize) +; (package-refresh-contents) +; (dolist (p nema) +; (package-install p))) + + +;(use-package benchmark-init +; :ensure t +; :config +; :disabled t +; (benchmark-init/activate) +; (add-hook 'after-init-hook 'benchmark-init/deactivate)) ;;;;;;;;;; ;; EVIL ;; ;;;;;;;;;; -(setq evil-want-integration t) ;; This is optional since it's already set to t by default. -(setq evil-want-keybinding nil) -(require 'evil) -;; Dodatni keybindi (dired, drugje) -(evil-collection-init) -(defvar my-leader-map (make-sparse-keymap) - "Mapiranje za evil bliznjice (leader trigger)") +(use-package evil + :ensure t + :init (setq evil-want-integration t + evil-want-keybinding nil) + :config + (evil-mode 1) + (defvar my-header-map (make-sparse-keymap) + "Mapiranje za evil bliznjice (leader trigger)") -;; Dodatki za orgmode / agenda podporo -(require 'evil-org) -(add-hook 'org-mode-hook 'evil-org-mode) -(evil-org-set-key-theme '(navigation insert textobjects additional calendar)) -(require 'evil-org-agenda) -(evil-org-agenda-set-keys) -(setq org-agenda-files (list "~/rs/org" - "~/Dokumenti")) + ;; Keybindings! + (defvar my-leader-map (make-sparse-keymap) + "Mapiranje za evil bliznjice (leader trigger)") -;; WINDOW ukazi -(define-prefix-command 'evil-window-map) -(define-key evil-window-map "j" 'windmove-down) -(define-key evil-window-map "k" 'windmove-up) -(define-key evil-window-map "h" 'windmove-left) -(define-key evil-window-map "l" 'windmove-right) -(define-key evil-window-map "s" 'split-window-below) -(define-key evil-window-map "v" 'split-window-right) + ;; WINDOW ukazi + (define-prefix-command 'evil-window-map) + (define-key evil-window-map "j" 'windmove-down) + (define-key evil-window-map "k" 'windmove-up) + (define-key evil-window-map "h" 'windmove-left) + (define-key evil-window-map "l" 'windmove-right) + (define-key evil-window-map "s" 'split-window-below) + (define-key evil-window-map "v" 'split-window-right) -;; BUFFER ukazi -(define-prefix-command 'evil-buffer-map) -(define-key evil-buffer-map "b" 'ivy-switch-buffer) -(define-key evil-buffer-map "p" 'previous-buffer) -(define-key evil-buffer-map "n" 'next-buffer) -(define-key evil-buffer-map "e" 'eval-buffer) -(defun switch-to-scratch () (interactive) (switch-to-buffer "*scratch*")) -(define-key evil-buffer-map "s" 'switch-to-scratch) -(defun switch-to-home () (interactive) (switch-to-buffer "*GNU Emacs*")) -(define-key evil-buffer-map "h" 'switch-to-home) -(defun open-config () (interactive) (find-file-literally "~/.emacs.d/init.el")) -(define-key evil-buffer-map "c" 'open-config) + ;; BUFFER ukazi + (define-prefix-command 'evil-buffer-map) + (define-key evil-buffer-map "b" 'ivy-switch-buffer) + (define-key evil-buffer-map "p" 'previous-buffer) + (define-key evil-buffer-map "n" 'next-buffer) + (define-key evil-buffer-map "e" 'eval-buffer) + (defun switch-to-scratch () (interactive) (switch-to-buffer "*scratch*")) + (define-key evil-buffer-map "s" 'switch-to-scratch) + (defun switch-to-home () (interactive) (switch-to-buffer "*GNU Emacs*")) + (define-key evil-buffer-map "h" 'switch-to-home) + (defun open-config () (interactive) (find-file-literally "~/.emacs.d/init.el")) + (define-key evil-buffer-map "c" 'open-config) -;; EVAL ukazi -(define-prefix-command 'eval-buffer-map) -(define-key evil-eval-map "b" 'eval-buffer) -(define-key evil-eval-map "e" 'eval-expression) -(define-key evil-eval-map "r" 'eval-region) + ;; EVAL ukazi + (define-prefix-command 'eval-buffer-map) + (define-key evil-eval-map "b" 'eval-buffer) + (define-key evil-eval-map "e" 'eval-expression) + (define-key evil-eval-map "r" 'eval-region) -;; FILE ukazi -(define-prefix-command 'evil-file-map) -(define-key evil-file-map "f" 'counsel-find-file) -(defun load-config () (interactive) (find-file "~/.emacs.d/init.el")) -(define-key evil-file-map "c" 'load-config) + ;; FILE ukazi + (define-prefix-command 'evil-file-map) + (define-key evil-file-map "f" 'counsel-find-file) + (defun load-config () (interactive) (find-file "~/.emacs.d/init.el")) + (define-key evil-file-map "c" 'load-config) -;; Mapiranje ukazov -;(define-key evil-normal-state-map (kbd "SPC") my-leader-map) -;(evil-global-set-key 'motion (kbd "SPC") my-leader-map) -;(evil-local-set-key 'motion (kbd "SPC") my-leader-map) -;(define-key evil-normal-state-map (kbd "SPC") my-leader-map) -(define-key my-leader-map "w" 'evil-window-map) -(define-key my-leader-map "b" 'evil-buffer-map) -(define-key my-leader-map "f" 'evil-file-map) -(define-key my-leader-map "e" 'evil-eval-map) + ;; Mapiranje ukazov + ;(define-key evil-normal-state-map (kbd "SPC") my-leader-map) + ;(evil-global-set-key 'motion (kbd "SPC") my-leader-map) + ;(evil-local-set-key 'motion (kbd "SPC") my-leader-map) + ;(define-key evil-normal-state-map (kbd "SPC") my-leader-map) + (define-key my-leader-map "w" 'evil-window-map) + (define-key my-leader-map "b" 'evil-buffer-map) + (define-key my-leader-map "f" 'evil-file-map) + (define-key my-leader-map "e" 'evil-eval-map) -;; Projectile map! -(define-key my-leader-map "p" 'projectile-command-map) + ;; Odpri bookmarke + (define-key evil-normal-state-map (kbd "RET") 'org-open-at-point) -(require 'general) -(general-evil-setup) -(general-nmap - :prefix "SPC" - :prefix-map 'my-leader-map - ;; Hitri buffer shortcuti - "[" 'previous-buffer - "]" 'next-buffer - "," 'ivy-switch-buffer - "RET" 'counsel-bookmark - "/" 'counsel-rg - "t" 'treemacs-add-and-display-current-project) -(general-nmap - :prefix "SPC" - :states 'normal - :keymaps 'dired-mode-map - :prefix-map 'my-leader-map - ;; Hitri buffer shortcuti - "[" 'previous-buffer - "]" 'next-buffer - "," 'ivy-switch-buffer - "RET" 'counsel-bookmark - "/" 'counsel-rg - "t" 'treemacs-add-and-display-current-project) + ;; Projectile map! + (define-key my-leader-map "p" 'projectile-command-map)) -;; y/n namesto yes / no -(fset 'yes-or-no-p 'y-or-n-p) +(use-package general + :ensure t + :after evil + :config + (general-evil-setup) + (general-nmap + :prefix "SPC" + :prefix-map 'my-leader-map + ;; Hitri buffer shortcuti + "[" 'previous-buffer + "]" 'next-buffer + "," 'ivy-switch-buffer + "RET" 'counsel-bookmark + "/" 'counsel-rg + "t" 'treemacs-add-and-display-current-project) + (general-nmap + :prefix "SPC" + :states 'normal + :keymaps 'dired-mode-map + :prefix-map 'my-leader-map + ;; Hitri buffer shortcuti + "[" 'previous-buffer + "]" 'next-buffer + "," 'ivy-switch-buffer + "RET" 'counsel-bookmark + "/" 'counsel-rg + "t" 'treemacs-add-and-display-current-project)) -;;;;;;;;;;;;;;;;;;; -;; Custom (tema) ;; -;;;;;;;;;;;;;;;;;;; -(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-safe-themes - '("db3e80842b48f9decb532a1d74e7575716821ee631f30267e4991f4ba2ddf56e" "d14f3df28603e9517eb8fb7518b662d653b25b26e83bd8e129acea042b774298" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default)) - '(iswitchb-mode t) - '(package-selected-packages - '(extempore-mode ob-mermaid use-package lsp-mode yaml-mode drupal-mode magit markdown-mode flycheck arduino-mode rjsx-mode gdscript-mode rainbow-delimiters which-key paredit geiser-guile geiser web-beautify vue-mode treemacs-evil treemacs-projectile treemacs smart-tabs-mode smart-tabs js2-mode smex clojure-mode helpful doom-themes counsel swiper all-the-icons doom-modeline evil-collection fennel-mode rg ivy company projectile evil)) - '(tool-bar-mode nil) - '(which-key-mode t)) -(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. - '(default ((t (:family "Iosevka SS05" :foundry "BE5N" :slant normal :weight semi-bold :height 120 :width normal))))) +;; Dodatne evil bližnjice +(use-package evil-collection + :ensure t + :after evil + :config + (evil-collection-init)) -;;;;;;;;;;;;;;;; -;; UI cleanup ;; -;;;;;;;;;;;;;;;; +;; Evil orgmode +(use-package evil-org + :ensure t + :after (evil org) + :hook ((org-mode . (lambda () evil-org-mode))) + :init + (setq org-src-fontify-natively t) + :config + (require 'evil-org-agenda) + (evil-org-set-key-theme '(navigation insert textobjects additional calendar)) + (evil-org-agenda-set-keys)) + +(use-package treemacs-evil :ensure t :after treemacs) + + + +;;;;;;;;; +;; GUI ;; +;;;;;;;;; ;; Menu bar off (menu-bar-mode -1) (tool-bar-mode -1) -;; No dialog box plx -(setq use-dialog-box nil) - ;; Brez ikon zgoraj (setq ns-use-proxy-icon nil) (setq frame-title-format nil) - -;; Undo tree -(global-undo-tree-mode) -(evil-set-undo-system 'undo-tree) -(setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))) - -;; Theme ; Skrij scrollbar (scroll-bar-mode -1) +;; Razmiki med okni (setq window-divider-default-bottom-width 3) (window-divider-mode t) -(load-theme 'gruvbox-dark-medium t) -;(load-theme 'hemisu-light t) +;; No dialog box plx +(setq use-dialog-box nil) + +;; Barvna tema +(use-package gruvbox-theme + :ensure t + :config + (load-theme 'gruvbox-dark-medium t)) +;(load-theme 'hemisu-light t) ;; hemisu-theme paket ;(require 'doom-themes) ;(setq doom-themes-enable-bold t ; if nil, bold is universally disabled ; doom-themes-enable-italic t) ; if nil, italics is universally disabled ;(load-theme 'doom-gruvbox t) ;(doom-themes-org-config) -;;;;;;;;;; -;; Text ;; -;;;;;;;;;; +;; Doom modeline - lepsi status bar spodaj +(use-package doom-modeline + :ensure t +; :disabled t + :config + (doom-modeline-mode)) + +;; Lepse ikone! +(use-package all-the-icons :ensure t) +;; !!! ;; +;; !!! Pognat je treba (1x) all-the-icons-install-fonts !!! ;; +;; !!! ;; + +;; y/n namesto yes / no +(fset 'yes-or-no-p 'y-or-n-p) + +;; Oooo gladko skrolanje! (Emacs 29+) +(pixel-scroll-precision-mode) + + + +;;;;;;;;;;; +;; TEKST ;; +;;;;;;;;;;; + ;; Sirina taba ter spejsi kot distancniki (setq-default tab-width 2) (setq-default indent-tabs-mode nil) + ;; Editorconfig formatiranje fajlov -(editorconfig-mode 1) +(use-package editorconfig + :ensure t + :config + (editorconfig-mode 1)) + ;; Text wrap na sirino oken (global-visual-line-mode) ;; Stevilke vrstic (global-display-line-numbers-mode) -;; Brez stevilk vrstic v file drevesu! -(add-hook 'treemacs-mode-hook (lambda () (display-line-numbers-mode -1))) +;; Lepse file drevo +(use-package treemacs + :ensure t + :defer t + :hook ((treemacs-mode . (lambda () ;; Brez stevilk vrstic v file drevesu! + (display-line-numbers-mode -1))))) +(use-package treemacs-projectile :ensure t :after treemacs) ;; Evil mode toggle <3 (evil-mode) -;; PhP ko je treba -(add-to-list 'auto-mode-alist '("\\.php$" . php-mode)) +;; Uporabi drevesne razveljavitve, undo tree +(use-package undo-tree + :ensure t + :config + (global-undo-tree-mode) + (evil-set-undo-system 'undo-tree) + ;; Drevo razveljavitev shrani v emacsov folder + (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo")))) -;; Org tudi kdaj -(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) +;; Markdown podpora +(use-package markdown-mode :ensure t) + + + +;;;;;;;;;;;;;;;;;;; +;; PROGRAMIRANJE ;; +;;;;;;;;;;;;;;;;;;; + +;; Twig nacin (in drug web) +(use-package web-mode :ensure t) + +;; Lepšanje web kode +(use-package web-beautify :ensure t) + +;; Kompletiranje ukazov +(use-package company + :ensure t + :defer t + :config + (setq lsp-completion-provider :capf) + (company-mode)) ;; Vue nacin ;; LSP potrebuje dependency iz npm: "sudo npm install -g vue-language-server -(use-package lsp-mode) -;; autocomplete -; (use-package company-lsp -; :after lsp-mode -; :config (push 'company-lsp company-backends)) +(use-package lsp-mode + :ensure t + :after company) + +;; Vuejs moud (use-package vue-mode - :mode "\\.vue\\'" - :config (add-hook 'vue-mode-hook #'lsp)) + :ensure t + :mode "\\.vue\\'" + :config (add-hook 'vue-mode-hook #'lsp)) + +;; PHP ko je treba +(use-package php-mode + :ensure t + :mode "\\.(php|module)\\'") ;; Guile scheme -(setq scheme-program-name "guile") +(use-package geiser + :ensure t + :mode "\\.scm\\'") +(use-package geiser-guile + :ensure t + :after geiser + :init (setq scheme-program-name "guile")) + +;; Racket podpora +(use-package racket-mode + :ensure t + :mode "\\.rkt\\'") ;; Rainbowz -(add-hook 'prog-mode-hook #'rainbow-delimiters-mode) +(use-package rainbow-delimiters + :ensure t + :hook ((prog-mode . rainbow-delimiters-mode))) -;; Boljse urejanje lispy jezikov -(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) -(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) -(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode) -(add-hook 'ielm-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-mode-hook #'enable-paredit-mode) -(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode) -(add-hook 'scheme-mode-hook #'enable-paredit-mode) +;; YAML konfiguracije +(use-package yaml-mode + :ensure t + :mode "\\.yaml\\'") + +;; Extempore lajv kodiranje! +(use-package extempore-mode + :ensure t + :mode "\\.xtm\\'") + +;; Syntax checker +(use-package flycheck + :ensure t + :defer t) + +;; Vmesnik za GIT +(use-package magit + :ensure t + :defer t) + +;; Drupal pomocnik +(use-package drupal-mode + :ensure t + :after php-mode) + +;; Oblikovanje kode za razne jezike +(use-package format-all :ensure t) + +;; Tidal cycles live coding +(use-package tidal + :ensure t + :defer t + :init + ;; Tidal cycles lokacija + (setq tidal-boot-script-path "~/.cabal/store/ghc-9.0.2/tidal-1.9.2-8e9cf9a217d87a6950880512f51893a6434970cd0690e831c563fc64ebd5de8f/share/BootTidal.hs")) + +;;;;;;;;;;;;; +;; ORGMODE ;; +;;;;;;;;;;;;; ;; Stanja taskov (setq org-todo-keywords '((sequence "TODO" "V DELU" "TESTIRANJE" "DOKUMENTIRANJE" "KONČANO"))) +;; Aktiviraj ob .org fajlih +(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) + +;; CalDav v orgmode! +(use-package org-caldav + :ensure t + :after org-mode + :config + (setq org-caldav-calendars + '((:calendar-id "riz0m" + :files ("~/org/koledar.org") + :inbox "~/org/koledar-in.org")))) + +;; Nacin za pisanje brez distrakcij +(use-package writeroom-mode + :ensure t + :config + :hook ((org-mode . (lambda () + (display-line-numbers-mode -1))))) + +;; HTMLize za barvanje kode v org izvozu v HTML +(use-package htmlize + :after org-mode + :ensure t) + +;; Lokacije ORG agenda vnosov +(setq org-agenda-files (list "~/rs/org" "~/Dokumenti")) + ;; DOT diagrami (org-babel-do-load-languages 'org-babel-load-languages @@ -315,65 +385,91 @@ 'org-babel-load-languages '((ditaa . t))) -;; Mermaid v orgmode -;; sudo npm install -g @mermaid-js/mermaid-cli -(setq ob-mermaid-cli-path "/usr/local/bin/mmdc") -(org-babel-do-load-languages - 'org-babel-load-languages - '((mermaid . t) - (scheme . t))) +;; Mermaid v orgmode (diagrami) +(use-package ob-mermaid + :ensure t + :defer t + :config + ;; sudo npm install -g @mermaid-js/mermaid-cli + (setq ob-mermaid-cli-path "/usr/local/bin/mmdc") + (org-babel-do-load-languages + 'org-babel-load-languages + '((mermaid . t) + (scheme . t)))) + +;; Pametni tabi +(use-package smart-tabs-mode + :ensure t + :disabled t + :config + ;(smart-tabs-insinuate javascript scheme) + ;; Pametni tabi za js2-mode + (smart-tabs-advice js2-indent-line js2-basic-offset)) ;; js2 za javascript -(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) -(setq js2-strict-missing-semi-warning nil) -(setq js2-missing-semi-one-line-override nil) -(setq js2-basic-offset 2) -(setq js-indent-level 2) -;; Pametni tabi za js2-mode -(smart-tabs-advice js2-indent-line js2-basic-offset) +(use-package js2-mode + :ensure t + :mode "\\.js\\'" + :disabled t + :config + ;(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) + (setq js2-strict-missing-semi-warning nil) + (setq js2-missing-semi-one-line-override nil) + (setq js2-basic-offset 2) + (setq js-indent-level 2)) + +;; Še en mode za JS, bolj react +(use-package rjsx-mode + :ensure t + :after js2-mode) ;; css indent (setq css-indent-level 2) (setq css-indent-offset 2) -;; Kompletiranje ukazov -(company-mode) - ;; IVY -(ivy-mode) -(setq ivy-use-virtual-buffers t) -(setq enable-recursive-minibuffers t) -(local-set-key (kbd "C-j") 'ivy-next-line) -(local-set-key (kbd "C-k") 'ivy-prevous-line) +(use-package ivy + :ensure t + :config + (ivy-mode) + (setq ivy-use-virtual-buffers t) + (setq enable-recursive-minibuffers t) + (local-set-key (kbd "C-j") 'ivy-next-line) + (local-set-key (kbd "C-k") 'ivy-prevous-line) + (global-set-key (kbd "C-c C-r") 'ivy-resume) + (global-set-key (kbd "") 'ivy-resume)) -;; Swiper search, counsel bliznjice -(global-set-key "\C-s" 'swiper) -(define-key evil-normal-state-map (kbd "RET") 'org-open-at-point) -(global-set-key (kbd "C-c C-r") 'ivy-resume) -(global-set-key (kbd "") 'ivy-resume) -(global-set-key (kbd "M-x") 'counsel-M-x) -(global-set-key (kbd "C-x C-f") 'counsel-find-file) -(global-set-key (kbd " f") 'counsel-describe-function) -(global-set-key (kbd " v") 'counsel-describe-variable) -(global-set-key (kbd " o") 'counsel-describe-symbol) -(global-set-key (kbd " l") 'counsel-find-library) -(global-set-key (kbd " i") 'counsel-info-lookup-symbol) -(global-set-key (kbd " u") 'counsel-unicode-char) -(global-set-key (kbd "C-c g") 'counsel-git) -(global-set-key (kbd "C-c j") 'counsel-git-grep) -(global-set-key (kbd "C-c k") 'counsel-ag) -(global-set-key (kbd "C-x l") 'counsel-locate) -(global-set-key (kbd "C-S-o") 'counsel-rhythmbox) -(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history) +;; Swiper search +(use-package swiper + :ensure t + :config + (global-set-key "\C-s" 'swiper)) + +;; Izboljsani default ukazi bolj prijazni +(use-package counsel + :ensure t + :config + (global-set-key (kbd "M-x") 'counsel-M-x) + (global-set-key (kbd "C-x C-f") 'counsel-find-file) + (global-set-key (kbd " f") 'counsel-describe-function) + (global-set-key (kbd " v") 'counsel-describe-variable) + (global-set-key (kbd " o") 'counsel-describe-symbol) + (global-set-key (kbd " l") 'counsel-find-library) + (global-set-key (kbd " i") 'counsel-info-lookup-symbol) + (global-set-key (kbd " u") 'counsel-unicode-char) + (global-set-key (kbd "C-c g") 'counsel-git) + (global-set-key (kbd "C-c j") 'counsel-git-grep) + (global-set-key (kbd "C-c k") 'counsel-ag) + (global-set-key (kbd "C-x l") 'counsel-locate) + (global-set-key (kbd "C-S-o") 'counsel-rhythmbox) + (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)) ;; Iskanje po fajlih (fulltext) -(rg-enable-default-bindings) - -;; Modeline / statusbar -(require 'all-the-icons) -;; Pognat je treba (1x) all-the-icons-install-fonts -;(require 'doom-modeline) -(doom-modeline-init) +(use-package rg + :ensure t + :defer t + :config + (rg-enable-default-bindings)) ;;;;;;;;;;; @@ -384,17 +480,27 @@ (setq vc-follow-symlinks t) ;; Projektni mgmt -(projectile-mode t) +(use-package projectile + :ensure t + :config (projectile-mode t)) ;; Pomoc -;(require 'helpful) -;; Allow C-h to trigger which-key before it is done automatically -(setq which-key-show-early-on-C-h t) -;; make sure which-key doesn't show normally but refreshes quickly after it is -;; triggered. -(setq which-key-idle-delay 0.4) -(setq which-key-idle-secondary-delay 0.05) -(which-key-mode) +;(use-package 'helpful :ensure t) + +;; Prikazi nedavne ukaze prej v M-x +(use-package smex :ensure t) + +;; Pomoc za keybinde +(use-package which-key + :ensure t + :config + ;; Allow C-h to trigger which-key before it is done automatically + (setq which-key-show-early-on-C-h t) + ;; make sure which-key doesn't show normally but refreshes quickly after it is + ;; triggered. + (setq which-key-idle-delay 0.4) + (setq which-key-idle-secondary-delay 0.05) + (which-key-mode)) ;; Prikazi startup time (add-to-list 'after-init-hook @@ -415,3 +521,34 @@ ;; Ne delaj lock fajlov (smetijo namrec) (setq create-lockfiles nil) + +;; File asociacije +(use-package openwith + :ensure t + :config + (setq openwith-associations '(("\\.pdf\\'" "xdg-open" (file)))) + (openwith-mode t)) + + + +;;;;;;;;;;;; +;; CUSTOM ;; +;;;;;;;;;;;; +(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-safe-themes + '("db3e80842b48f9decb532a1d74e7575716821ee631f30267e4991f4ba2ddf56e" "d14f3df28603e9517eb8fb7518b662d653b25b26e83bd8e129acea042b774298" "7661b762556018a44a29477b84757994d8386d6edee909409fabe0631952dad9" default)) + '(iswitchb-mode t) + '(package-selected-packages + '(openwith evil-org-agenda company-org-block org-block-capf writeroom-mode racket-mode htmlize company-lsp web-mode tidal org-caldav format-all company-phpactor phpactor extempore-mode ob-mermaid use-package lsp-mode yaml-mode drupal-mode magit markdown-mode flycheck arduino-mode rjsx-mode gdscript-mode rainbow-delimiters which-key paredit geiser-guile geiser web-beautify vue-mode treemacs-evil treemacs-projectile treemacs smart-tabs-mode smart-tabs js2-mode smex clojure-mode helpful doom-themes counsel swiper all-the-icons doom-modeline evil-collection fennel-mode rg ivy company projectile evil)) + '(tool-bar-mode nil) + '(which-key-mode t)) +(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. + '(default ((t (:family "Iosevka SS05" :foundry "BE5N" :slant normal :weight semi-bold :height 120 :width normal)))))