Sql interactive history, fix centaur tabs, mu4e line nums, experiementing
This commit is contained in:
parent
0fd3df7e34
commit
31ec3d89f4
@ -411,9 +411,13 @@ Setup other stuff
|
|||||||
(setq-default display-line-numbers 'relative)
|
(setq-default display-line-numbers 'relative)
|
||||||
(make-variable-buffer-local 'global-hl-line-mode)
|
(make-variable-buffer-local 'global-hl-line-mode)
|
||||||
|
|
||||||
(dolist (mode '( dashboard-mode-hook org-mode-hook term-mode-hook eww-mode-hook vterm-mode-hook dirvish-directory-view-mode-hook
|
(defun joe/disable-line-numbers () (display-line-numbers-mode 0))
|
||||||
eshell-mode-hook dired-mode-hook shell-mode-hook magit-mode-hook compilation-mode-hook))
|
|
||||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
(dolist (mode '( dashboard-mode-hook org-mode-hook term-mode-hook eww-mode-hook
|
||||||
|
vterm-mode-hook dirvish-directory-view-mode-hook eshell-mode-hook
|
||||||
|
dired-mode-hook shell-mode-hook magit-mode-hook compilation-mode-hook
|
||||||
|
mu4e-main-mode-hook))
|
||||||
|
(add-hook mode #'joe/disable-line-numbers))
|
||||||
|
|
||||||
(set-window-margins nil 0)
|
(set-window-margins nil 0)
|
||||||
(setq-default right-fringe-width 10)
|
(setq-default right-fringe-width 10)
|
||||||
@ -874,6 +878,30 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
(global-set-key (kbd "C-x o") #'ace-window)
|
(global-set-key (kbd "C-x o") #'ace-window)
|
||||||
(global-set-key (kbd "C-x C-o") #'ace-swap-window)
|
(global-set-key (kbd "C-x C-o") #'ace-swap-window)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
*** COMMENT Beframe
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defvar consult-buffer-sources)
|
||||||
|
(declare-function consult--buffer-state "consult")
|
||||||
|
|
||||||
|
(with-eval-after-load 'consult
|
||||||
|
(defface beframe-buffer
|
||||||
|
'((t :inherit font-lock-string-face))
|
||||||
|
"Face for `consult' framed buffers.")
|
||||||
|
|
||||||
|
(defvar beframe-consult-source
|
||||||
|
`( :name "Frame-specific buffers (current frame)"
|
||||||
|
:narrow ?F
|
||||||
|
:category buffer
|
||||||
|
:face beframe-buffer
|
||||||
|
:history beframe-history
|
||||||
|
:items ,#'beframe-buffer-names
|
||||||
|
:action ,#'switch-to-buffer
|
||||||
|
:state ,#'consult--buffer-state))
|
||||||
|
|
||||||
|
(add-to-list 'consult-buffer-sources 'beframe-consult-source))
|
||||||
|
|
||||||
|
(require 'beframe)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Popper
|
*** Popper
|
||||||
|
|
||||||
@ -949,8 +977,16 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
(body-function . ,#'select-window))))))
|
(body-function . ,#'select-window))))))
|
||||||
|
|
||||||
(setq popper-display-function #'joe/popper-display-func)
|
(setq popper-display-function #'joe/popper-display-func)
|
||||||
|
;; (setq popper-display-function nil)
|
||||||
|
;; (setq popper-display-function #'popper-select-popup-at-bottom)
|
||||||
|
|
||||||
(popper-mode t)
|
(popper-mode t)
|
||||||
|
#+end_src
|
||||||
|
*** COMMENT Tab-bar & Tab-line
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(global-set-key (kbd "s-n") #'tab-line-switch-to-next-tab)
|
||||||
|
(global-set-key (kbd "s-p") #'tab-line-switch-to-prev-tab)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Scrolling
|
*** Scrolling
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+begin_src emacs-lisp :tangle no
|
||||||
@ -1032,6 +1068,11 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really
|
|||||||
(add-hook mode 'centaur-tabs-local-mode))
|
(add-hook mode 'centaur-tabs-local-mode))
|
||||||
|
|
||||||
(with-eval-after-load 'centaur-tabs
|
(with-eval-after-load 'centaur-tabs
|
||||||
|
(defun joe/fix-centaur-tabs (THEME)
|
||||||
|
(centaur-tabs-mode -1)
|
||||||
|
(centaur-tabs-mode))
|
||||||
|
|
||||||
|
(advice-add 'consult-theme :after #'joe/fix-centaur-tabs)
|
||||||
(defun centaur-tabs-buffer-groups ()
|
(defun centaur-tabs-buffer-groups ()
|
||||||
"`centaur-tabs-buffer-groups' control buffers' group rules.
|
"`centaur-tabs-buffer-groups' control buffers' group rules.
|
||||||
|
|
||||||
@ -1682,26 +1723,41 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i
|
|||||||
#+end_src
|
#+end_src
|
||||||
*** SQL
|
*** SQL
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun joe/mark-sql-defun ()
|
(defun joe/mark-sql-defun ()
|
||||||
"Mark the current SQL function definition."
|
"Mark the current SQL function definition."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((beg (save-excursion
|
(let ((beg (save-excursion
|
||||||
(re-search-backward "^create or replace function [^(]+" nil t)
|
(re-search-backward "^create or replace function [^(]+" nil t)
|
||||||
(match-end 0)))
|
(match-end 0)))
|
||||||
(end (save-excursion
|
(end (save-excursion
|
||||||
(re-search-forward "\\(language\\)" nil t)
|
(re-search-forward "\\(language\\)" nil t)
|
||||||
(line-end-position))))
|
(line-end-position))))
|
||||||
(when (and beg end)
|
(when (and beg end)
|
||||||
(goto-char beg)
|
(goto-char beg)
|
||||||
(set-mark end)))
|
(set-mark end)))
|
||||||
(evil-visual-line)
|
(evil-visual-line)
|
||||||
(evil-visual-line))
|
(evil-visual-line))
|
||||||
(with-eval-after-load 'sql-mode
|
;; This is required so that .dir-locals that read env files for credentials works
|
||||||
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
|
(require 'dotenv)
|
||||||
(define-key sql-mode-map (kbd "<f8>") #'sql-connect)
|
(with-eval-after-load 'sql-mode
|
||||||
(define-key sql-mode-map (kbd "<f8>") #'sql-connect))
|
(define-key sql-mode-map (kbd "C-M-h") #'joe/mark-sql-defun)
|
||||||
#+end_src
|
(define-key sql-mode-map (kbd "<f8>") #'sql-connect))
|
||||||
|
|
||||||
|
(defun joe/sql-save-history-hook ()
|
||||||
|
(let ((lval 'sql-input-ring-file-name)
|
||||||
|
(rval 'sql-product))
|
||||||
|
(if (symbol-value rval)
|
||||||
|
(let ((filename
|
||||||
|
(concat user-emacs-directory "sql/"
|
||||||
|
(symbol-name (symbol-value rval))
|
||||||
|
"-history.sql")))
|
||||||
|
(set (make-local-variable lval) filename))
|
||||||
|
(error
|
||||||
|
(format "SQL history will not be saved because %s is nil"
|
||||||
|
(symbol-name rval))))))
|
||||||
|
|
||||||
|
(add-hook 'sql-interactive-mode-hook 'joe/sql-save-history-hook)
|
||||||
|
#+end_src
|
||||||
*** C
|
*** C
|
||||||
|
|
||||||
Design some basic functions for compiling. There's also a hook to close the popper window if there
|
Design some basic functions for compiling. There's also a hook to close the popper window if there
|
||||||
|
Loading…
x
Reference in New Issue
Block a user