Some fairly minimal changes
This commit is contained in:
0
.config.d/.gitignore
vendored
Normal file
0
.config.d/.gitignore
vendored
Normal file
@@ -85,17 +85,6 @@
|
||||
emacs)
|
||||
("https://planet.emacslife.com/atom.xml"
|
||||
emacs)
|
||||
("https://ria.ru/export/rss2/archive/index.xml"
|
||||
ru-news)
|
||||
("https://rssexport.rbc.ru/rbcnews/news/30/full.rss"
|
||||
ru-news)
|
||||
("https://lenta.ru/rss"
|
||||
ru-news)
|
||||
("https://rg.ru/xml/index.xml"
|
||||
ru-news)
|
||||
("https://portamur.ru/news/rss.php"
|
||||
ru-news
|
||||
local-news)
|
||||
("https://kagi.com/smallweb/appreciated"
|
||||
small-web)
|
||||
("https://kagi.com/api/v1/smallweb/feed/?gh"
|
||||
@@ -108,13 +97,6 @@
|
||||
;; into kill ring before replacing it.
|
||||
(setq save-interprogram-paste-before-kill t)
|
||||
|
||||
;; Windmove family of commands allow easy navigation when there is more than two
|
||||
;; buffers on screen.
|
||||
(keymap-global-set "C-S-<left>" 'windmove-left)
|
||||
(keymap-global-set "C-S-<right>" 'windmove-right)
|
||||
(keymap-global-set "C-S-<up>" 'windmove-up)
|
||||
(keymap-global-set "C-S-<down>" 'windmove-down)
|
||||
|
||||
;; Compile command allows to easily run noninteractive commands, among other
|
||||
;; things, like, you know, compiling stuff.
|
||||
(keymap-global-set "C-c l" 'compile)
|
||||
|
||||
68
.config.d/05-tatoeba.el
Normal file
68
.config.d/05-tatoeba.el
Normal file
@@ -0,0 +1,68 @@
|
||||
;;; 05-tatoeba.el --- Tatoeba utilities. -*- no-byte-compile: t; lexical-binding: t; -*-
|
||||
|
||||
;;; Description:
|
||||
;; This file contains my utilities for the tatoeba website.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun tatoeba--request-word-data (word)
|
||||
"Gets raw senteces from the tatoeba api"
|
||||
(request-response-data
|
||||
(request
|
||||
(format
|
||||
"https://tatoeba.org/eng/api_v0/search?from=deu&has_audio=&list=&native=&original=&orphans=no&query=%s&sort=relevance&sort_reverse=&tags=&to=eng&trans_filter=limit&trans_has_audio=&trans_link=&trans_orphan=no&trans_to=&trans_unapproved=no&trans_user=&unapproved=no&user=&word_count_max=&word_count_min=2"
|
||||
word)
|
||||
:parser 'json-read
|
||||
:sync t)))
|
||||
|
||||
(defun tatoeba--get-eng-translations (translations)
|
||||
"Converts the translations list into the (id . translation) form"
|
||||
(let* ((translation-list (append
|
||||
(aref translations 0)
|
||||
(aref translations 1)
|
||||
'())))
|
||||
(mapcar
|
||||
(lambda (x)
|
||||
(if (equal (cdr (assoc 'lang x))
|
||||
"eng")
|
||||
(cons
|
||||
(cdr (assoc 'id x))
|
||||
(cdr (assoc 'text x)))))
|
||||
translation-list)))
|
||||
|
||||
(defun tatoeba--get-sentence-list (word)
|
||||
"Requests sentences and transforms them into an easy to use form."
|
||||
(let* ((raw-data (tatoeba--request-word-data
|
||||
word))
|
||||
(results (cdadr raw-data)))
|
||||
(mapcar
|
||||
(lambda (x)
|
||||
(list
|
||||
(assoc 'id x)
|
||||
(cons 'user (cdadr (assoc 'user x)))
|
||||
(assoc 'text x)
|
||||
(cons 'translations
|
||||
(tatoeba--get-eng-translations
|
||||
(cdr (assoc 'translations x))))))
|
||||
results)))
|
||||
|
||||
(defun tatoeba-get-capture-template ()
|
||||
"Returns a template for the org-capture"
|
||||
(let* ((word (read-string "Word: "))
|
||||
(sentence-list (tatoeba--get-sentence-list
|
||||
word)))
|
||||
(with-output-to-string
|
||||
(princ
|
||||
(format "\n** %s\n" word))
|
||||
(dolist (sentence sentence-list)
|
||||
(if (not (eq (cdadr
|
||||
(assoc 'translations sentence))
|
||||
nil))
|
||||
(princ
|
||||
(format
|
||||
"*** %s\n%s\n\n"
|
||||
(cdr (assoc 'text sentence))
|
||||
(cdadr
|
||||
(assoc 'translations sentence)))))))))
|
||||
|
||||
;;; 05-tatoeba.el ends here
|
||||
@@ -41,6 +41,12 @@
|
||||
(global-corfu-mode t)
|
||||
(corfu-popupinfo-mode t))
|
||||
|
||||
;; This package provides icons to corfu completions. Requires nerd fonts to be
|
||||
;; installed to work.
|
||||
(use-package nerd-icons-corfu
|
||||
:config
|
||||
(add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter))
|
||||
|
||||
;; Cape provides Completion At Point Extensions which can be used in
|
||||
;; combination with Corfu, Company or the default completion UI. The
|
||||
;; completion backends used by completion-at-point are so called
|
||||
|
||||
@@ -115,4 +115,28 @@
|
||||
|
||||
(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
|
||||
|
||||
;; This package adds indent bars. Currently only configured for rust and python.
|
||||
(use-package indent-bars
|
||||
:ensure t
|
||||
:defer t
|
||||
:custom
|
||||
(indent-bars-no-descend-lists t) ; no extra bars in continued func arg lists
|
||||
(indent-bars-treesit-support t)
|
||||
(indent-bars-treesit-ignore-blank-lines-types '("module"))
|
||||
;; Add other languages as needed
|
||||
(indent-bars-treesit-scope '((python function_definition class_definition for_statement
|
||||
if_statement with_statement while_statement)
|
||||
(rust trait_item impl_item
|
||||
macro_definition macro_invocation
|
||||
struct_item enum_item mod_item
|
||||
const_item let_declaration
|
||||
function_item for_expression
|
||||
if_expression loop_expression
|
||||
while_expression match_expression
|
||||
match_arm call_expression
|
||||
token_tree token_tree_pattern
|
||||
token_repetition)))
|
||||
(indent-bars-treesit-wrap '((rust arguments parameters)))
|
||||
:hook ((python-base-mode yaml-mode rust-mode) . indent-bars-mode))
|
||||
|
||||
;;; 15-lsp.el end here
|
||||
|
||||
25
.config.d/20-window-management.el
Normal file
25
.config.d/20-window-management.el
Normal file
@@ -0,0 +1,25 @@
|
||||
;;; 20-window-management.el --- Setup concerning windowing. -*- no-byte-compile: t; lexical-binding: t; -*-
|
||||
|
||||
;; Treemacs is a package that provides a tree view of the current project.
|
||||
(use-package treemacs
|
||||
:ensure t
|
||||
:defer t
|
||||
:commands (treemacs))
|
||||
|
||||
;; Windmove family of commands allow easy navigation when there is more than two
|
||||
;; buffers on screen. The bindings are the Vim movement commands with the
|
||||
;; Control+Shift modifiers, adjusted for the workman layout and shifted a bit
|
||||
;; down and to the left.
|
||||
(keymap-global-set "C-S-k" #'windmove-left)
|
||||
(keymap-global-set "C-S-l" #'windmove-down)
|
||||
(keymap-global-set "C-<" #'windmove-up)
|
||||
(keymap-global-set "C->" #'windmove-right)
|
||||
|
||||
;; Still thinking on this one
|
||||
;; (setq
|
||||
;; display-buffer-alist
|
||||
;; `(("\\*vterm\\*" display-buffer-in-side-window
|
||||
;; (side . bottom) (slot . 0) (window-height . fit-window-to-buffer)
|
||||
;; (preserve-size . (nil . t)) '(window-parameters . ((no-delete-other-windows . t))))))
|
||||
|
||||
;;; 20-window-management.el ends here
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,8 +4,8 @@
|
||||
!init.el
|
||||
!.github/
|
||||
!.LICENSE
|
||||
|
||||
!custom.el
|
||||
!pre-early-init.el
|
||||
!post-init.el
|
||||
!.config.d/
|
||||
!.config.d/*
|
||||
|
||||
Reference in New Issue
Block a user