mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-07-09 19:24:24 +02:00
add csv mode (wip), add lsp support to python-mode
This commit is contained in:
2
init.el
2
init.el
@@ -113,6 +113,7 @@
|
|||||||
(require 'init-rust)
|
(require 'init-rust)
|
||||||
(require 'init-shellscript)
|
(require 'init-shellscript)
|
||||||
(require 'init-perl)
|
(require 'init-perl)
|
||||||
|
(require 'init-python)
|
||||||
(require 'init-go)
|
(require 'init-go)
|
||||||
(require 'init-c)
|
(require 'init-c)
|
||||||
(require 'init-lua)
|
(require 'init-lua)
|
||||||
@@ -159,6 +160,7 @@
|
|||||||
;; (require 'init-audio) nope, I'm just not using it anymore
|
;; (require 'init-audio) nope, I'm just not using it anymore
|
||||||
(require 'init-daemonde)
|
(require 'init-daemonde)
|
||||||
(require 'init-matrix)
|
(require 'init-matrix)
|
||||||
|
;; (require 'init-csv)
|
||||||
|
|
||||||
;; emacs configuration
|
;; emacs configuration
|
||||||
(require 'init-windowmgmt)
|
(require 'init-windowmgmt)
|
||||||
|
|||||||
19
lisp/init-csv.el
Normal file
19
lisp/init-csv.el
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
(defun tvd/csv-mode-setup ()
|
||||||
|
(csv-align-mode t)
|
||||||
|
(toggle-truncate-lines 1)
|
||||||
|
(csv-header-line t))
|
||||||
|
|
||||||
|
(use-package csv-mode
|
||||||
|
:mode "\\.csv\\'"
|
||||||
|
:config
|
||||||
|
(setq
|
||||||
|
toggle-truncate-lines 1
|
||||||
|
csv-header-line t)
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(csv-mode . csv-align-mode))
|
||||||
|
|
||||||
|
(provide 'init-csv)
|
||||||
|
;;; init-csv.el ends here
|
||||||
|
|
||||||
|
;; FIXME: create my own mode, convert CSV into org-table, edit it and convert back to CSV on save with a hook
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
;; maintain daemon.de jekyll website
|
;; maintain daemon.de hugo website
|
||||||
|
|
||||||
;; (require 'subr-x)
|
;; (require 'subr-x)
|
||||||
(setq daemon-de-site "~/dev/web/daemon.de")
|
(setq daemon-de-site "~/dev/daemon.de")
|
||||||
|
|
||||||
(setq daemon-de-template "---
|
(setq daemon-de-template "---
|
||||||
layout: post
|
title: \"%s\"
|
||||||
title: %s
|
draft: false
|
||||||
|
date: %s
|
||||||
tags:
|
tags:
|
||||||
- %s
|
- %s
|
||||||
---
|
---
|
||||||
@@ -20,30 +21,13 @@ tags:
|
|||||||
(replace-regexp-in-string "[[:nonascii:]]" "" (replace-regexp-in-string " " "-" (downcase title)))
|
(replace-regexp-in-string "[[:nonascii:]]" "" (replace-regexp-in-string " " "-" (downcase title)))
|
||||||
".md"))
|
".md"))
|
||||||
|
|
||||||
(defun daemon-de-new-blogpost(title category)
|
(defun daemon-de-new-blogpost(title tag)
|
||||||
"Create a new blog posting for daemon.de"
|
"Create a new blog posting for daemon.de"
|
||||||
(interactive "sEnter blog post title: \nsEnter a category: ")
|
(interactive "sEnter blog post title: \nsEnter a tag: ")
|
||||||
(find-file
|
(find-file
|
||||||
(format "%s/_posts/%s" daemon-de-site (daemon-de-title2slug title)))
|
(format "%s/content/posts/%s" daemon-de-site (daemon-de-title2slug title)))
|
||||||
(insert (format daemon-de-template title category))
|
(setq timestamp (format-time-string "%Y-%m-%dT%H:%M:%S+0100"))
|
||||||
)
|
(insert (format daemon-de-template title timestamp tag)))
|
||||||
|
|
||||||
(defun --daemon-de-new-blogpost(title category)
|
|
||||||
"Create a new blog posting for daemon.de"
|
|
||||||
(interactive "sEnter blog post title: \nsEnter a category: ")
|
|
||||||
(let ((cwd default-directory)
|
|
||||||
(path ""))
|
|
||||||
(cd daemon-de-site)
|
|
||||||
(find-file
|
|
||||||
(string-trim-right
|
|
||||||
(shell-command-to-string
|
|
||||||
(format "./newblog.sh '%s' '%s'" title category))))
|
|
||||||
(cd cwd)))
|
|
||||||
|
|
||||||
(defun daemon-de-publish()
|
|
||||||
"build and publish jekyll site using git"
|
|
||||||
(interactive)
|
|
||||||
(magit-status daemon-de-site))
|
|
||||||
|
|
||||||
(provide 'init-daemonde)
|
(provide 'init-daemonde)
|
||||||
;;; init-daemonde.el ends here
|
;;; init-daemonde.el ends here
|
||||||
|
|||||||
@@ -3,7 +3,11 @@
|
|||||||
:config
|
:config
|
||||||
(lsp-register-custom-settings
|
(lsp-register-custom-settings
|
||||||
'(("gopls.completeUnimported" t t)
|
'(("gopls.completeUnimported" t t)
|
||||||
("gopls.staticcheck" t t)))
|
("gopls.staticcheck" t t)
|
||||||
|
("pyls.plugins.pyls_mypy.enabled" t t)
|
||||||
|
("pyls.plugins.pyls_mypy.live_mode" nil t)
|
||||||
|
("pyls.plugins.pyls_black.enabled" t t)
|
||||||
|
("pyls.plugins.pyls_isort.enabled" t t)))
|
||||||
|
|
||||||
;; disable infantile nonsense
|
;; disable infantile nonsense
|
||||||
(setq lsp-headerline-breadcrumb-enable nil
|
(setq lsp-headerline-breadcrumb-enable nil
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
:mode ("\\.py\\'" . python-mode)
|
:mode ("\\.py\\'" . python-mode)
|
||||||
:interpreter ("python" . python-mode)
|
:interpreter ("python" . python-mode)
|
||||||
:mode "\\.py\\'"
|
:mode "\\.py\\'"
|
||||||
:hook
|
:config
|
||||||
(function
|
(defun tvd-python-hook()
|
||||||
(lambda()
|
|
||||||
(local-set-key [delete] 'py-electric-delete)
|
(local-set-key [delete] 'py-electric-delete)
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil)
|
||||||
(setq mode-name "PY")
|
(setq mode-name "PY")
|
||||||
(outline-minor-mode 0) ;; turn off outline here. FIXME: find out where it's turned on!
|
(outline-minor-mode 0) ;; turn off outline here. FIXME: find out where it's turned on!
|
||||||
)))
|
(lsp))
|
||||||
|
|
||||||
|
:hook ((python-mode . tvd-python-hook)))
|
||||||
|
|
||||||
(provide 'init-python)
|
(provide 'init-python)
|
||||||
;;; init-python.el ends here
|
;;; init-python.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user