summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Kosarek <matthew.kosarek@vention.cc>2023-03-26 08:26:45 -0400
committerMatthew Kosarek <matthew.kosarek@vention.cc>2023-03-26 08:26:45 -0400
commit8a9b9d83d17ccd59bbefe2da3cd2e79c0d363025 (patch)
tree4b24cf552a27808ee51786062563188b76ebd9cd
parent371b1723f317f56dcc010f47e5f456315fbd236f (diff)
Improvements to org-mode and performance
-rw-r--r--examples/test.py4
-rw-r--r--init.el6
-rw-r--r--lisp/general.el46
-rw-r--r--lisp/org-custom.el9
-rw-r--r--lisp/python-custom.el25
-rw-r--r--lisp/text.el3
-rw-r--r--lisp/web.el10
7 files changed, 72 insertions, 31 deletions
diff --git a/examples/test.py b/examples/test.py
new file mode 100644
index 0000000..3cb554e
--- /dev/null
+++ b/examples/test.py
@@ -0,0 +1,4 @@
+
+
+def funct(a, b):
+ pass
diff --git a/init.el b/init.el
index d923196..445f0bc 100644
--- a/init.el
+++ b/init.el
@@ -29,6 +29,9 @@
(doom-themes-org-config)
)
+(set-frame-parameter (selected-frame) 'alpha '(90 90))
+(add-to-list 'default-frame-alist '(alpha 90 90))
+
(require 'general)
(require 'cpp)
(require 'go)
@@ -54,7 +57,8 @@
'(org-agenda-files (list org-directory))
'(org-directory "~/OrgRoam")
'(package-selected-packages
- '(rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box eglot drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2)))
+ '(magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box eglot drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2))
+ '(safe-local-variable-values '((js-indent-level . 4))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/lisp/general.el b/lisp/general.el
index 52f276a..8f4f92e 100644
--- a/lisp/general.el
+++ b/lisp/general.el
@@ -30,6 +30,9 @@
(global-set-key (kbd "C-c C-l") 'reload-init-file)
+(setq-default header-line-format mode-line-format) ; Copy mode-line
+(setq-default mode-line-format nil) ; Remove mode-line
+
;; Tab mode
(global-tab-line-mode t)
@@ -89,9 +92,10 @@
)
(use-package helm-posframe
- :ensure t
- :config
- (helm-posframe-enable))
+ :ensure t
+ :config
+ (helm-posframe-enable)
+ (setq helm-posframe-poshandler 'posframe-poshandler-frame-top-center))
;; Projectile for project navigation
(use-package projectile
@@ -154,7 +158,7 @@
:ensure t
:hook (prog-mode . git-gutter-mode)
:config
- (setq git-gutter:update-interval 0.02)
+ (setq git-gutter:update-interval 1)
(setq git-gutter:window-width 1))
(use-package git-gutter-fringe
@@ -178,8 +182,8 @@
;; Global key binds
(require 'eglot)
(bind-key* (kbd "<f2>") #'eglot-rename)
-;(bind-key* (kbd "C-x C-f") 'helm-find-files)
-;(bind-key* (kbd "C-s") 'helm-do-grep-ag)
+(bind-key* (kbd "C-x C-f") 'helm-find-files)
+(bind-key* (kbd "C-s") 'helm-do-grep-ag)
(bind-key* (kbd "M-x") 'helm-M-x)
(bind-key* (kbd "M-.") 'xref-find-definitions)
(bind-key* (kbd "C-x k") 'kill-this-buffer)
@@ -239,7 +243,7 @@
:defer t
:init (add-hook 'after-init-hook 'global-company-mode)
:config
- (setq company-idle-delay 0.1
+ (setq company-idle-delay 0.5
company-minimum-prefix-length 2
company-tooltip-limit 20
company-backends '((company-capf company-gtags company-elisp company-css company-dabbrev))
@@ -263,20 +267,20 @@
(set-face-underline 'eglot-highlight-symbol-face t)
-(use-package tree-sitter
- :ensure t
- :defer t
- :config
- ;; use treesitter when possible
- (global-tree-sitter-mode)
- ;; overwrite the default syntax-highlighting (from major modes)
- (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
- :hook
- (prog-mode . tree-sitter-mode))
-
-(use-package tree-sitter-langs
- :ensure t
- :defer t)
+;; (use-package tree-sitter
+;; :ensure t
+;; :defer t
+;; :config
+;; ;; use treesitter when possible
+;; (global-tree-sitter-mode)
+;; ;; overwrite the default syntax-highlighting (from major modes)
+;; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
+;; :hook
+;; (prog-mode . tree-sitter-mode))
+
+;; (use-package tree-sitter-langs
+;; :ensure t
+;; :defer t)
;; Highlight similar text
(use-package highlight-thing
diff --git a/lisp/org-custom.el b/lisp/org-custom.el
index 9b60cf6..ea826bd 100644
--- a/lisp/org-custom.el
+++ b/lisp/org-custom.el
@@ -59,9 +59,12 @@
(flyspell-mode 1)
)
-(custom-set-variables
- '(org-directory "~/OrgRoam")
- '(org-agenda-files (list org-directory)))
+(setq org-directory "~/OrgRoam")
+
+(setq org-agenda-files '("~/OrgRoam" "~/OrgRoam/daily"))
+
+;(setq org-agenda-files
+; (find-lisp-find-files "~/OrgRoam" "\.org$"))
(setq org-todo-keywords
'((sequence "TODO" "PROGRESS" "VERIFY" "|" "DONE" "ABANDONED")))
diff --git a/lisp/python-custom.el b/lisp/python-custom.el
index 432ad48..10c4cfc 100644
--- a/lisp/python-custom.el
+++ b/lisp/python-custom.el
@@ -9,5 +9,30 @@
:hook
((python-mode . eglot-ensure)))
+(defun python-args-to-google-docstring (text &optional make-fields)
+ "Return a reST docstring format for the python arguments in yas-text."
+ (let* ((indent (concat "\n" (make-string (current-column) 32)))
+ (args (python-split-args text))
+ (nr 0)
+ (formatted-args
+ (mapconcat
+ (lambda (x)
+ (concat " " (nth 0 x)
+ (if make-fields (format " ${%d:arg%d}" (cl-incf nr) nr))
+ (if (nth 1 x) (concat " \(default " (nth 1 x) "\)"))))
+ args
+ indent)))
+ (unless (string= formatted-args "")
+ (concat
+ (mapconcat 'identity
+ (list "" "Args:" formatted-args)
+ indent)
+ "\n"))))
+
+(use-package yasnippet
+ :ensure t
+ :config
+ (yas-global-mode 1))
+
(provide 'python-custom)
;;; python-custom.el ends here
diff --git a/lisp/text.el b/lisp/text.el
index 2438b7d..3ee8e33 100644
--- a/lisp/text.el
+++ b/lisp/text.el
@@ -16,7 +16,8 @@
(use-package perfect-margin
:ensure t
:config
- (add-hook 'text-mode-hook 'my-perfect-margin-mode-hook))
+ (add-hook 'text-mode-hook 'my-perfect-margin-mode-hook)
+ (add-hook 'org-mode-hook 'perfect-margin-mode))
(add-hook 'text-mode-hook 'setup-text-mode)
(use-package ispell
diff --git a/lisp/web.el b/lisp/web.el
index 73f3935..b92507b 100644
--- a/lisp/web.el
+++ b/lisp/web.el
@@ -38,11 +38,11 @@
)
;; TSX
-(use-package tree-sitter-langs
- :config
- (tree-sitter-require 'tsx)
- (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
- )
+;; (use-package tree-sitter-langs
+;; :config
+;; (tree-sitter-require 'tsx)
+;; (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))
+;; )
(define-derived-mode typescript-tsx-mode web-mode "TypeScript[tsx]")
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-tsx-mode))