Czyszczenie i optymalizacja
This commit is contained in:
parent
52a7f580a4
commit
a084af12a3
81
init.el
81
init.el
|
@ -444,85 +444,6 @@ Missing packages are automatically installed."
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; ;; Obsługa wirtualnych środowisk Python (pyvenv)
|
||||
;; ;; ----------------------------
|
||||
;; (use-package pyvenv
|
||||
;; :ensure t
|
||||
;; :config
|
||||
;; ;; Automatyczna aktywacja środowiska venv w katalogu projektu
|
||||
;; (defun my-auto-activate-venv ()
|
||||
;; "Automatycznie aktywuj venv w bieżącym katalogu projektu."
|
||||
;; (let ((venv-path (locate-dominating-file default-directory "venv")))
|
||||
;; (when venv-path
|
||||
;; (pyvenv-activate (expand-file-name "venv" venv-path))
|
||||
;; (setq lsp-pyright-python-executable-cmd (expand-file-name "bin/python" venv-path)))))
|
||||
;; (add-hook 'python-mode-hook #'my-auto-activate-venv)
|
||||
|
||||
|
||||
|
||||
|
||||
;; ;; (use-package pyvenv
|
||||
;; ;; :ensure t
|
||||
;; ;; :config
|
||||
;; ;; (defun my-auto-activate-venv ()
|
||||
;; ;; "Automatycznie aktywuj venv zależnie od systemu operacyjnego."
|
||||
;; ;; (let ((venv-path
|
||||
;; ;; (cond
|
||||
;; ;; ((eq system-type 'gnu/linux) "/home/pali112/venv")
|
||||
;; ;; ((eq system-type 'windows-nt) "C:/Users/paluc/OneDrive/Dokumenty/venv"))))
|
||||
;; ;; (when (and venv-path (file-directory-p venv-path))
|
||||
;; ;; (pyvenv-activate venv-path)
|
||||
;; ;; (setq lsp-pyright-python-executable-cmd
|
||||
;; ;; (expand-file-name
|
||||
;; ;; (if (eq system-type 'windows-nt)
|
||||
;; ;; "Scripts/python.exe"
|
||||
;; ;; "bin/python")
|
||||
;; ;; venv-path)))))
|
||||
;; ;; (add-hook 'python-mode-hook #'my-auto-activate-venv))
|
||||
|
||||
;; (use-package pyvenv
|
||||
;; :ensure t
|
||||
;; :config
|
||||
;; (defun my-auto-activate-venv ()
|
||||
;; "Automatycznie aktywuj venv zależnie od systemu operacyjnego."
|
||||
;; (let ((venv-path
|
||||
;; (cond
|
||||
;; ((eq system-type 'gnu/linux) "/home/pali112/venv")
|
||||
;; ((eq system-type 'windows-nt) "C:/Users/paluc/OneDrive/Dokumenty/venv"))))
|
||||
;; (when (and venv-path (file-directory-p venv-path))
|
||||
;; (pyvenv-activate venv-path)
|
||||
;; (setq lsp-pyright-python-executable-cmd
|
||||
;; (expand-file-name
|
||||
;; (if (eq system-type 'windows-nt)
|
||||
;; "Scripts/python.exe"
|
||||
;; "bin/python")
|
||||
;; venv-path)))))
|
||||
;; (add-hook 'python-mode-hook #'my-auto-activate-venv))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; ;; Dodanie informacji o aktywnym venv do modeline
|
||||
;; (defun my-get-current-venv ()
|
||||
;; "Zwraca nazwę aktywnego środowiska wirtualnego."
|
||||
;; (if (and (boundp 'pyvenv-virtual-env) pyvenv-virtual-env)
|
||||
;; (propertize (concat "venv: " (file-name-nondirectory (directory-file-name pyvenv-virtual-env)))
|
||||
;; 'face '(:foreground "green"))
|
||||
;; "No venv"))
|
||||
|
||||
;; (setq-default mode-line-format
|
||||
;; (append mode-line-format
|
||||
;; '((:eval (my-get-current-venv))))))
|
||||
|
||||
|
||||
;; ----------------------------------
|
||||
;; Obsługa venv z automatyczną aktywacją (Linux / Windows)
|
||||
;; ----------------------------------
|
||||
|
@ -905,7 +826,7 @@ Missing packages are automatically installed."
|
|||
(interactive)
|
||||
(let ((file-path (if (eq system-type 'windows-nt)
|
||||
"C:/Users/paluc/OneDrive/Dokumenty/venv/voskpl.py"
|
||||
"~/vosk/voskpl.py")))
|
||||
"~/venv/voskpl.py")))
|
||||
;; Przejdź do voskpl.py
|
||||
(find-file file-path)
|
||||
;; Otwórz eshell i uruchom vosk
|
||||
|
|
394
init.el~
394
init.el~
|
@ -1,13 +1,244 @@
|
|||
;; ----------------------------
|
||||
;; Podstawowa konfiguracja pakietów i MELPA
|
||||
;; ----------------------------
|
||||
|
||||
(require 'package)
|
||||
|
||||
;; Dodaj repozytoria
|
||||
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
||||
("gnu" . "https://elpa.gnu.org/packages/")))
|
||||
("gnu" . "https://elpa.gnu.org/packages/")
|
||||
("org" . "https://orgmode.org/elpa/")))
|
||||
|
||||
;; Inicjalizuj system pakietów
|
||||
(package-initialize)
|
||||
|
||||
;; Odśwież listę pakietów, jeśli jest pusta
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
||||
|
||||
;; Funkcja do instalowania pakietów
|
||||
(defun ensure-package-installed (&rest packages)
|
||||
"Ensure that the given PACKAGES are installed.
|
||||
Missing packages are automatically installed."
|
||||
(dolist (package packages)
|
||||
(unless (package-installed-p package)
|
||||
(package-install package))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; Instalacja wymaganych pakietów
|
||||
(ensure-package-installed
|
||||
'use-package
|
||||
'magit
|
||||
'blacken
|
||||
'lsp-mode
|
||||
'lsp-ui
|
||||
'flycheck
|
||||
'org-roam
|
||||
'company
|
||||
'jupyter
|
||||
'treemacs
|
||||
'yasnippet
|
||||
'winum
|
||||
'lsp-treemacs)
|
||||
|
||||
;; Wczytaj i skonfiguruj `use-package`
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-install 'use-package))
|
||||
(require 'use-package)
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Podstawowa konfiguracja Org-Roam
|
||||
;; ----------------------------
|
||||
|
||||
;; Definicja ścieżek dla Org-roam
|
||||
(setq my-org-roam-windows-path "C:/Users/paluc/Nextcloud/todo/roam/")
|
||||
(setq my-org-roam-linux-path "~/Nextcloud/todo/roam/")
|
||||
|
||||
(defun my-set-org-roam-directory ()
|
||||
"Ustaw katalog Org-roam w zależności od systemu operacyjnego."
|
||||
(setq org-roam-directory
|
||||
(file-truename
|
||||
(if (eq system-type 'windows-nt)
|
||||
my-org-roam-windows-path
|
||||
my-org-roam-linux-path))))
|
||||
|
||||
;; Wywołaj funkcję przy starcie Emacs
|
||||
(my-set-org-roam-directory)
|
||||
|
||||
;; Konfiguracja Org-roam
|
||||
(use-package org-roam
|
||||
:ensure t
|
||||
:bind (("C-c n l" . org-roam-buffer-toggle) ;; Bufor backlinków
|
||||
("C-c n f" . org-roam-node-find) ;; Wyszukiwanie notatek
|
||||
("C-c n g" . org-roam-graph) ;; Graf powiązań
|
||||
("C-c n c" . org-roam-capture)) ;; Tworzenie nowej notatki
|
||||
:config
|
||||
(org-roam-db-autosync-mode)) ;; Automatyczna synchronizacja bazy danych
|
||||
;; Ścieżka do programu "dot" (Graphviz)
|
||||
(setq org-roam-graph-executable "dot")
|
||||
|
||||
;; Format pliku wyjściowego
|
||||
(setq org-roam-graph-output "png") ;; Możliwe opcje: "svg", "png", "pdf"
|
||||
|
||||
;; Dodatkowe opcje dla generowanego grafu
|
||||
(setq org-roam-graph-extra-config
|
||||
'(("overlap" . "scale") ;; Unikaj nakładania się węzłów
|
||||
("splines" . "true") ;; Pokaż linie jako krzywe
|
||||
("sep" . "25"))) ;; Odstępy między węzłami
|
||||
(setq org-roam-graph-file
|
||||
(expand-file-name "org-roam-graph.png" org-roam-directory))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Winum
|
||||
;; ----------------------------
|
||||
|
||||
;; Przełączanie się między oknami
|
||||
(use-package winum
|
||||
:ensure t
|
||||
:config
|
||||
(winum-mode))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Konfiguracja yasnippet
|
||||
;; ----------------------------
|
||||
|
||||
(use-package yasnippet
|
||||
:ensure t
|
||||
:config
|
||||
(yas-global-mode 1)) ;; Włącz YASnippet globalnie
|
||||
(setq yas-snippet-dirs '("~/.emacs.d/snippets")) ;; Ścieżka do własnych snippetów
|
||||
|
||||
(use-package yasnippet-snippets
|
||||
:ensure t
|
||||
:after yasnippet) ;; Wymaga załadowanego yasnippet
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Konfiguracja org-mode
|
||||
;; ----------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
(setq org-file-apps
|
||||
`((auto-mode . emacs)
|
||||
("\\.pdf\\'" . ,(if (eq system-type 'windows-nt)
|
||||
"C:/Users/paluc/AppData/Local/SumatraPDF/SumatraPDF.exe %s"
|
||||
"xdg-open %s"))))
|
||||
|
||||
;; Automatyczne generowanie linku
|
||||
(setq org-attach-directory "files")
|
||||
(setq org-attach-automatic-link t)
|
||||
;; Definicja ścieżek dla Windows i Linux
|
||||
(setq my-org-agenda-windows-path "C:/Users/paluc/Nextcloud/todo/")
|
||||
(setq my-org-agenda-linux-path "~/Nextcloud/todo/")
|
||||
|
||||
;; Definicja ścieżek do pliku todo.org
|
||||
(setq my-todo-file-windows "C:/Users/paluc/Nextcloud/todo/todo.org")
|
||||
(setq my-todo-file-linux "~/Nextcloud/todo/todo.org")
|
||||
(setq my-note-file-windows "C:/Users/paluc/Nextcloud/todo/notatki.org")
|
||||
(setq my-note-file-linux "~/Nextcloud/todo/notatki.org")
|
||||
|
||||
;; Funkcja ustawiająca odpowiednią ścieżkę na podstawie systemu
|
||||
(defun my-set-org-agenda-files ()
|
||||
"Ustaw pliki agendy Org w zależności od systemu operacyjnego."
|
||||
(setq org-agenda-files
|
||||
(directory-files-recursively
|
||||
(if (eq system-type 'windows-nt)
|
||||
my-org-agenda-windows-path
|
||||
my-org-agenda-linux-path)
|
||||
"\\.org$")))
|
||||
|
||||
;; Wywołaj funkcję przy starcie Emacs
|
||||
(my-set-org-agenda-files)
|
||||
|
||||
;; Funkcja otwierająca plik todo.org
|
||||
(defun my-open-todo-file ()
|
||||
"Otwórz plik todo.org w zależności od systemu operacyjnego."
|
||||
(interactive)
|
||||
(let ((note-file (if (eq system-type 'windows-nt)
|
||||
my-todo-file-windows
|
||||
my-todo-file-linux)))
|
||||
(if (file-exists-p note-file)
|
||||
(find-file note-file)
|
||||
(message "Plik todo.org nie istnieje: %s" note-file))))
|
||||
|
||||
|
||||
(defun my-open-note-file ()
|
||||
"Otwórz plik todo.org w zależności od systemu operacyjnego."
|
||||
(interactive)
|
||||
(let ((todo-file (if (eq system-type 'windows-nt)
|
||||
my-note-file-windows
|
||||
my-note-file-linux)))
|
||||
(if (file-exists-p todo-file)
|
||||
(find-file todo-file)
|
||||
(message "Plik todo.org nie istnieje: %s" todo-file))))
|
||||
|
||||
|
||||
|
||||
;; Włącz org-mode automatycznie dla plików .org
|
||||
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
|
||||
|
||||
;; Włącz folding w org-mode (skróty klawiszowe)
|
||||
(setq org-startup-folded t) ;; Start with folded headlines
|
||||
(setq org-hide-leading-stars t) ;; Ukrywanie gwiazdek poza pierwszym poziomem
|
||||
(setq org-ellipsis "⤵") ;; Znak na końcu zwiniętych sekcji
|
||||
|
||||
|
||||
;; Ustawienia klawisza TAB w org-mode przy użyciu Evil
|
||||
(add-hook 'org-mode-hook
|
||||
(lambda ()
|
||||
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
|
||||
(evil-define-key 'normal org-mode-map (kbd "S-TAB") 'org-shifttab)))
|
||||
|
||||
|
||||
;; Podświetlanie składni i elementów w org-mode
|
||||
(setq org-fontify-whole-heading-line t) ;; Podświetlaj cały nagłówek
|
||||
(setq org-fontify-done-headline t) ;; Podświetlaj ukończone nagłówki
|
||||
(setq org-fontify-quote-and-verse-blocks t) ;; Podświetlaj bloki cytatów i wierszy
|
||||
|
||||
;; Automatyczne podświetlanie kodu w blokach źródłowych
|
||||
(setq org-src-fontify-natively t)
|
||||
(setq org-src-tab-acts-natively t)
|
||||
|
||||
;; Wsparcie dla hierarchicznego folding w org-mode
|
||||
(setq org-cycle-separator-lines 2) ;; Próg zwijania między sekcjami
|
||||
|
||||
;; Wygląd i czytelność w org-mode
|
||||
(setq org-hide-emphasis-markers t) ;; Ukryj znaki formatowania (*bold*, /italic/)
|
||||
(setq org-pretty-entities t) ;; Wyświetl symbole matematyczne jako unicode
|
||||
(setq org-highlight-latex-and-related '(latex script entities)) ;; Podświetlaj LaTeX
|
||||
|
||||
;; Współpraca z tytułami i nagłówkami
|
||||
(setq org-startup-indented t) ;; Włącz automatyczne wcięcia
|
||||
(setq org-indent-mode-turns-on-hiding-stars t) ;; Ukryj gwiazdki w nagłówkach
|
||||
|
||||
;; Funkcje dodatkowe
|
||||
(setq org-log-done 'time) ;; Zapisuj czas oznaczenia zadania jako DONE
|
||||
(setq org-return-follows-link t) ;; ENTER podąża za linkami
|
||||
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Instalacja i konfiguracja LSP dla Python
|
||||
;; ----------------------------
|
||||
|
@ -17,20 +248,19 @@
|
|||
:commands lsp
|
||||
:config
|
||||
;; Ustawienia LSP
|
||||
(setq-default flycheck-disabled-checkers '(python-pylint python-flake8))
|
||||
(setq lsp-headerline-breadcrumb-enable t) ;; Breadcrumb w nagłówku
|
||||
(setq lsp-completion-provider :capf) ;; Włączenie podpowiedzi capf
|
||||
(setq lsp-enable-snippet t) ;; Włączenie snippetów w podpowiedziach
|
||||
(setq lsp-pyright-auto-import-completions t) ;; Automatyczne podpowiedzi importów
|
||||
(setq lsp-pyright-diagnostic-mode "workspace") ;; Diagnostyka w kontekście projektu
|
||||
(setq lsp-pylsp-plugins-pyflakes-enabled nil) ;; Wyłącz pyflakes
|
||||
(setq lsp-pylsp-plugins-flake8-enabled t) ;; Użyj flake8 zamiast pyflakes
|
||||
(setq lsp-diagnostics-provider :none) ;; Wyłącz diagnostykę LSP na rzecz Flycheck
|
||||
(setq lsp-pylsp-plugins-flake8-ignore ["F405" "F403" "E231" "E303" "E302" "E305" "E501" "D100"]) ;; Ignorowanie błędów w flake8
|
||||
(setq lsp-pylsp-plugins-ruff-enabled t) ;; Użyj flake8 zamiast pyflakes
|
||||
|
||||
|
||||
|
||||
;; Ścieżka do interpretera Python
|
||||
;; Ignorowanie błędów w pylint
|
||||
(setq lsp-pylsp-plugins-pylint-args [
|
||||
"--disable=wrong-import-order,missing-module-docstring,invalid-name"
|
||||
])
|
||||
(setq lsp-pyright-python-executable-cmd "python3"))
|
||||
|
||||
|
||||
|
@ -66,8 +296,14 @@
|
|||
(defun set-flycheck-executables ()
|
||||
"Set Flycheck executables to use from the active Python virtual environment."
|
||||
(when (and (boundp 'pyvenv-virtual-env) pyvenv-virtual-env)
|
||||
(let ((flake8-path (concat pyvenv-virtual-env "/Scripts/flake8.exe")) ; Ścieżka na Windows
|
||||
(pylint-path (concat pyvenv-virtual-env "/Scripts/pylint.exe"))) ; Ścieżka na Windows
|
||||
(let* ((flake8-path (concat pyvenv-virtual-env
|
||||
(if (eq system-type 'windows-nt)
|
||||
"/Scripts/flake8.exe" ; Ścieżka na Windows
|
||||
"/bin/flake8"))) ; Ścieżka na Linux/Mac
|
||||
(pylint-path (concat pyvenv-virtual-env
|
||||
(if (eq system-type 'windows-nt)
|
||||
"/Scripts/pylint.exe" ; Ścieżka na Windows
|
||||
"/bin/pylint")))) ; Ścieżka na Linux/Mac
|
||||
(when (file-executable-p flake8-path)
|
||||
(flycheck-set-checker-executable 'python-flake8 flake8-path))
|
||||
(when (file-executable-p pylint-path)
|
||||
|
@ -125,6 +361,8 @@
|
|||
(setq company-minimum-prefix-length 1) ;; Minimalna długość prefiksu dla podpowiedzi
|
||||
(setq company-selection-wrap-around t)) ;; Zawijanie w menu podpowiedzi
|
||||
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Magit i zarządzanie projektami
|
||||
;; ----------------------------
|
||||
|
@ -173,17 +411,69 @@
|
|||
(evil-leader/set-leader "<SPC>")
|
||||
(evil-leader/set-key
|
||||
"g g" 'magit-status
|
||||
"o o" 'my-open-todo-file
|
||||
"o n" 'my-open-note-file
|
||||
"o t" 'org-toggle-inline-images
|
||||
"o f" 'org-overview
|
||||
"o c" 'org-insert-link
|
||||
"o l" 'org-agenda-list
|
||||
"o i" 'org-clock-in
|
||||
"o s" 'org-clock-out
|
||||
"o r" 'org-clock-report
|
||||
"g a" 'magit-remote-add
|
||||
"f f" 'find-file
|
||||
"b b" 'switch-to-buffer
|
||||
"b m" 'buffer-menu
|
||||
"b l" 'ibuffer
|
||||
"b w" 'buffer-menu-open
|
||||
"t t" 'treemacs
|
||||
"t a" 'treemacs-add-project-to-workspace
|
||||
"t r" 'treemacs-remove-project-from-workspace
|
||||
"t c" 'treemacs-copy-file
|
||||
"t f" 'treemacs-create-file
|
||||
"t m" 'treemacs-rename-file
|
||||
"l l" 'toggle-truncate-lines
|
||||
"l n" 'display-line-numbers-mode
|
||||
"j s" 'jupyter-run-server-repl
|
||||
"j a" 'jupyter-repl-associate-buffer
|
||||
"s e" 'eshell
|
||||
"e l" 'flycheck-list-errors
|
||||
"n n" 'narrow-to-region
|
||||
"n w" 'widen
|
||||
"a" 'mark-whole-buffer
|
||||
"TAB" (lambda () (interactive) (switch-to-buffer (other-buffer)))
|
||||
"1" 'winum-select-window-1
|
||||
"2" 'winum-select-window-2
|
||||
"3" 'winum-select-window-3
|
||||
"4" 'winum-select-window-4
|
||||
"5" 'winum-select-window-5))
|
||||
|
||||
))
|
||||
(which-key-add-key-based-replacements
|
||||
"<SPC> g" "Magit"
|
||||
"<SPC> e" "Errors"
|
||||
"<SPC> n" "Narrow"
|
||||
"<SPC> f" "Files"
|
||||
"<SPC> b" "Buffers"
|
||||
"<SPC> t" "Treemacs"
|
||||
"<SPC> l" "Lines"
|
||||
"<SPC> j" "Jupyter"
|
||||
"<SPC> s" "Shell"
|
||||
"<SPC> o" "Org"
|
||||
)
|
||||
|
||||
|
||||
;; Utwórz mapę klawiszy dla "SPC"
|
||||
(define-prefix-command 'my-space-prefix)
|
||||
(define-key evil-normal-state-map (kbd "SPC") 'my-space-prefix)
|
||||
|
||||
;; Dodaj mapowanie "SPC 0" do Treemacs
|
||||
(define-key my-space-prefix (kbd "0") 'my-treemacs-select-or-open)
|
||||
|
||||
;; Funkcja, która przełącza się na okno Treemacs lub je otwiera
|
||||
(defun my-treemacs-select-or-open ()
|
||||
"Przełącz się na okno Treemacs lub otwórz Treemacs, jeśli nie jest aktywne."
|
||||
(interactive)
|
||||
(if (treemacs-get-local-window)
|
||||
(treemacs-select-window)
|
||||
(treemacs)))
|
||||
|
||||
;; ----------------------------
|
||||
;; Dodanie obsługi komentowania za pomocą "gc"
|
||||
|
@ -230,18 +520,25 @@
|
|||
;; Other keys
|
||||
;; ----------------------------
|
||||
(global-set-key (kbd "C-c e") 'eshell)
|
||||
(global-set-key (kbd "C-c d") 'flymake-show-buffer-diagnostics)
|
||||
(global-set-key (kbd "C-c d") 'flycheck-list-errors)
|
||||
|
||||
(global-set-key (kbd "C-c j s") 'jupyter-run-server-repl) ;; Połącz się z serwerem
|
||||
(global-set-key (kbd "C-c j a") 'jupyter-repl-associate-buffer) ;; Powiąż bufor z REPL
|
||||
(global-set-key (kbd "C-c j b") 'jupyter-eval-buffer) ;; Wykonaj cały bufor
|
||||
|
||||
(setq initial-scratch-message (concat ";; Aby otworzyć org daj na C-c o\n"
|
||||
|
||||
|
||||
(setq initial-scratch-message (concat ";; Aby otworzyć org todo daj na SPC o o \n"
|
||||
";; Aby otworzyć org notatki daj na SPC o n \n"
|
||||
";; Otwarcie menu attachment C-c C-a \n"
|
||||
";; Otwarcie załącznika attachment C-c C-a o \n"
|
||||
";; Otwarcie załącznika attachment C-c C-a o \n"
|
||||
";; Dodanie linku SPC o c \n"
|
||||
";; Aby otworzyć ostatnie pliki daj na C-c r\n"
|
||||
";; Aby otworzyć treemacs daj na C-c t \n"
|
||||
";; Aktywacja środowiska pyenv C-c v a \n"
|
||||
";; Eshell C-c e \n"
|
||||
";; Pokaż błędy flymake C-c d \n"
|
||||
";; Pokaż błędy flycheck C-c d \n"
|
||||
"\n"
|
||||
";;Jupyter \n"
|
||||
";;Wykonaj Połącz się z serwerem C-c j s \n"
|
||||
|
@ -254,10 +551,75 @@
|
|||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages
|
||||
'(evil-commentary yasnippet which-key vterm request pyvenv polymode neotree magit lsp-ui lsp-treemacs jupyter highlight-indentation gruvbox-theme evil-org evil-leader deferred company anaphora)))
|
||||
'(org-roam evil-commentary yasnippet which-key vterm request pyvenv polymode neotree magit lsp-ui lsp-treemacs jupyter highlight-indentation gruvbox-theme evil-org evil-leader deferred company anaphora)))
|
||||
(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.
|
||||
)
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; ----------------------------
|
||||
;; Moje makra
|
||||
;; ----------------------------
|
||||
|
||||
|
||||
|
||||
(defun vosk-start ()
|
||||
(interactive)
|
||||
;; Przejdź do voskpl.py
|
||||
(find-file "~/vosk/voskpl.py") ;; Zmień na poprawną ścieżkę do pliku
|
||||
;; Otwórz eshell 1 i uruchom Jupyter Lab
|
||||
(eshell 100)
|
||||
(insert "python voskpl.py")
|
||||
(eshell-send-input))
|
||||
|
||||
|
||||
|
||||
(defun build123d ()
|
||||
"Automatyzacja workflow: uruchomienie Jupyter Lab, OCP VSCode i konfiguracja REPL."
|
||||
(interactive)
|
||||
;; Przejdź do pliku simrig.py
|
||||
(find-file "~/Dokumenty/simrig2/simrig.py") ;; Zmień na poprawną ścieżkę do pliku
|
||||
;; Otwórz eshell 1 i uruchom Jupyter Lab
|
||||
(eshell 1)
|
||||
(insert "jupyter lab")
|
||||
(eshell-send-input)
|
||||
;; Przejdź do eshell 2 i uruchom Python -m ocp_vscode
|
||||
(eshell 2)
|
||||
(insert "python -m ocp_vscode")
|
||||
(eshell-send-input)
|
||||
;; Powróć do pliku simrig.py
|
||||
(find-file "~/Dokumenty/simrig2/simrig.py")
|
||||
;; Uruchom jupyter-run-server-repl i pozwól użytkownikowi potwierdzić wartości interaktywnie
|
||||
(call-interactively 'jupyter-run-server-repl)
|
||||
;; Powróć do pliku simrig.py
|
||||
(find-file "~/Dokumenty/simrig2/simrig.py")
|
||||
;; Przypisz bufor do Jupyter REPL
|
||||
(call-interactively 'jupyter-repl-associate-buffer))
|
||||
|
||||
|
||||
|
||||
|
||||
;; Funkcja tworząca pusty plik .gitignore w Emacs
|
||||
(defun create-gitignore (directory)
|
||||
"Tworzy pusty plik .gitignore w podanym katalogu DIRECTORY."
|
||||
(interactive "DChoose directory: ")
|
||||
(let ((gitignore-path (expand-file-name ".gitignore" directory)))
|
||||
(if (file-exists-p gitignore-path)
|
||||
(message "Plik .gitignore już istnieje w katalogu %s" directory)
|
||||
(with-temp-file gitignore-path
|
||||
(insert ""))
|
||||
(message "Pusty plik .gitignore został utworzony w katalogu %s" directory))))
|
||||
|
||||
;; Aby użyć tej funkcji, wpisz M-x create-gitignore i wskaż katalog, w którym ma być utworzony pusty plik.
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue