mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-22 09:53:10 -05:00
Compare commits
No commits in common. "30ca8a5ed9febe9641bd96622f7ac8653837510d" and "bb3ffba2addda7cbe12517ee5244187e9ef68873" have entirely different histories.
30ca8a5ed9
...
bb3ffba2ad
2 changed files with 78 additions and 183 deletions
|
@ -39,6 +39,7 @@
|
||||||
(float-time
|
(float-time
|
||||||
(time-subtract (current-time) before-init-time)))
|
(time-subtract (current-time) before-init-time)))
|
||||||
gcs-done)))
|
gcs-done)))
|
||||||
|
|
||||||
;;; Initialize elpaca
|
;;; Initialize elpaca
|
||||||
(defvar elpaca-installer-version 0.5)
|
(defvar elpaca-installer-version 0.5)
|
||||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||||
|
@ -87,25 +88,6 @@
|
||||||
;;; Built-in features
|
;;; Built-in features
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
:init
|
|
||||||
;;; Vertico
|
|
||||||
;; Add prompt to `completing-read-multiple'
|
|
||||||
(defun crm-indicator (args)
|
|
||||||
(cons (format "[CRM%s] %s"
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
|
||||||
crm-separator)
|
|
||||||
(car args))
|
|
||||||
(cdr args)))
|
|
||||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
|
||||||
|
|
||||||
;; Recursive minibuffers
|
|
||||||
(setq enable-recursive-minibuffers t)
|
|
||||||
|
|
||||||
;; Disable prompt in minibuffer
|
|
||||||
(setq minibuffer-prompt-properties
|
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
|
||||||
:bind
|
:bind
|
||||||
(:map global-map
|
(:map global-map
|
||||||
;; Disable suspend-frame shortcut
|
;; Disable suspend-frame shortcut
|
||||||
|
@ -117,7 +99,7 @@
|
||||||
("S-C-<right>" . enlarge-window-horizontally)
|
("S-C-<right>" . enlarge-window-horizontally)
|
||||||
("S-C-<down>" . shrink-window)
|
("S-C-<down>" . shrink-window)
|
||||||
("S-C-<up>" . enlarge-window))
|
("S-C-<up>" . enlarge-window))
|
||||||
:config
|
:init
|
||||||
;;; General Options
|
;;; General Options
|
||||||
;; Better scrolling
|
;; Better scrolling
|
||||||
(setq scroll-step 1
|
(setq scroll-step 1
|
||||||
|
@ -138,7 +120,26 @@
|
||||||
(prefer-coding-system 'utf-8)
|
(prefer-coding-system 'utf-8)
|
||||||
(set-default-coding-systems 'utf-8)
|
(set-default-coding-systems 'utf-8)
|
||||||
(set-terminal-coding-system 'utf-8)
|
(set-terminal-coding-system 'utf-8)
|
||||||
(set-keyboard-coding-system 'utf-8))
|
(set-keyboard-coding-system 'utf-8)
|
||||||
|
|
||||||
|
;;; Vertico
|
||||||
|
;; Add prompt to `completing-read-multiple'
|
||||||
|
(defun crm-indicator (args)
|
||||||
|
(cons (format "[CRM%s] %s"
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||||
|
crm-separator)
|
||||||
|
(car args))
|
||||||
|
(cdr args)))
|
||||||
|
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||||||
|
|
||||||
|
;; Recursive minibuffers
|
||||||
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
|
;; Disable prompt in minibuffer
|
||||||
|
(setq minibuffer-prompt-properties
|
||||||
|
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
|
||||||
|
|
||||||
(use-package compile
|
(use-package compile
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
|
@ -153,8 +154,8 @@
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
:hook ((conf-mode
|
:hook ((conf-mode
|
||||||
markdown-mode
|
markdown-mode
|
||||||
prog-mode) . display-fill-column-indicator-mode)
|
lsp-mode) . display-fill-column-indicator-mode)
|
||||||
:config (setq-default fill-column 100))
|
:config (setq-default fill-column 80))
|
||||||
|
|
||||||
(use-package display-line-numbers
|
(use-package display-line-numbers
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
|
@ -168,16 +169,16 @@
|
||||||
(use-package files
|
(use-package files
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
|
|
||||||
(setq backup-directory-alist `((".*" . ,auto_save_directory))
|
|
||||||
auto-save-file-name-transforms `((".*" ,auto_save_directory t))))
|
|
||||||
(setq backup-by-copying t
|
(setq backup-by-copying t
|
||||||
confirm-kill-processes nil
|
confirm-kill-processes nil
|
||||||
delete-old-versions t
|
delete-old-versions t
|
||||||
kept-new-versions 5
|
kept-new-versions 5
|
||||||
kept-old-versions 3
|
kept-old-versions 3
|
||||||
require-final-newline t
|
require-final-newline t
|
||||||
version-control t))
|
version-control t)
|
||||||
|
(let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
|
||||||
|
(setq backup-directory-alist `((".*" . ,auto_save_directory))
|
||||||
|
auto-save-file-name-transforms `((".*" ,auto_save_directory t)))))
|
||||||
|
|
||||||
(use-package flyspell
|
(use-package flyspell
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
|
@ -226,8 +227,8 @@
|
||||||
(use-package simple
|
(use-package simple
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
:config
|
:config
|
||||||
(setq-default indent-tabs-mode nil)
|
(setq-default indent-tabs-mode nil
|
||||||
(column-number-mode))
|
column-number-mode t))
|
||||||
|
|
||||||
(use-package whitespace
|
(use-package whitespace
|
||||||
:elpaca nil
|
:elpaca nil
|
||||||
|
@ -237,12 +238,11 @@
|
||||||
text-mode) . whitespace-mode)
|
text-mode) . whitespace-mode)
|
||||||
:config
|
:config
|
||||||
(add-hook 'before-save-hook #'whitespace-cleanup)
|
(add-hook 'before-save-hook #'whitespace-cleanup)
|
||||||
(setq whitespace-line-column nil
|
(setq whitespace-line-column 100
|
||||||
whitespace-style '(face
|
whitespace-style '(big-indent
|
||||||
lines-char
|
face
|
||||||
|
lines-tail
|
||||||
missing-newline-at-eof
|
missing-newline-at-eof
|
||||||
space-after-tab
|
|
||||||
space-before-tab
|
|
||||||
tabs
|
tabs
|
||||||
trailing)))
|
trailing)))
|
||||||
|
|
||||||
|
@ -254,31 +254,21 @@
|
||||||
|
|
||||||
;; Theme
|
;; Theme
|
||||||
(use-package everforest
|
(use-package everforest
|
||||||
:elpaca (everforest :host sourcehut :repo "theorytoe/everforest-theme")
|
:elpaca (everforest
|
||||||
|
:host sourcehut
|
||||||
|
:repo "theorytoe/everforest-theme")
|
||||||
:config
|
:config
|
||||||
(setq custom-safe-themes t)
|
(setq custom-safe-themes t)
|
||||||
(load-theme 'everforest-hard-dark t)
|
(load-theme 'everforest-hard-dark t)
|
||||||
(let ((moody_line (face-attribute 'mode-line :foreground))
|
(set-face-attribute 'cursor nil :background "#7fbbb3")
|
||||||
(moody_inactive (face-attribute 'mode-line-inactive :background)))
|
(let ((line (face-attribute 'mode-line :foreground))
|
||||||
(set-face-attribute 'mode-line nil :overline moody_line)
|
(inactive (face-attribute 'mode-line-inactive :background)))
|
||||||
(set-face-attribute 'mode-line-inactive nil :overline moody_line)
|
(set-face-attribute 'mode-line nil :overline line)
|
||||||
(set-face-attribute 'mode-line-inactive nil :underline moody_line)
|
(set-face-attribute 'mode-line-inactive nil :overline line)
|
||||||
|
(set-face-attribute 'mode-line-inactive nil :underline line)
|
||||||
(set-face-attribute 'mode-line nil :box nil)
|
(set-face-attribute 'mode-line nil :box nil)
|
||||||
(set-face-attribute 'mode-line-inactive nil :box nil)
|
(set-face-attribute 'mode-line-inactive nil :box nil)
|
||||||
(set-face-attribute 'mode-line-inactive nil :background moody_inactive))
|
(set-face-attribute 'mode-line-inactive nil :background inactive)))
|
||||||
:custom-face
|
|
||||||
(cursor ((t (:background "#7fbbb3"))))
|
|
||||||
(whitespace-big-indent ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-empty ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-hspace ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-indentation ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-line ((t (:background "#e67e80"))))
|
|
||||||
(whitespace-newline ((t (:background "#e67e80"))))
|
|
||||||
(whitespace-space ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-space-after-tab ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-space-before-tab ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-tab ((t (:background "#9da9a0"))))
|
|
||||||
(whitespace-trailing ((t (:background "#e67e80")))))
|
|
||||||
|
|
||||||
(elpaca-wait)
|
(elpaca-wait)
|
||||||
|
|
||||||
|
@ -460,7 +450,8 @@
|
||||||
:config (push #'kind-icon-margin-formatter corfu-margin-formatters)
|
:config (push #'kind-icon-margin-formatter corfu-margin-formatters)
|
||||||
:custom
|
:custom
|
||||||
(kind-icon-default-face 'corfu-default)
|
(kind-icon-default-face 'corfu-default)
|
||||||
(kind-icon-blend-background nil))
|
(kind-icon-blend-background nil)
|
||||||
|
(svg-lib-icons-dir (concat xdg_cache_home "svg-lib/")))
|
||||||
|
|
||||||
;; Git
|
;; Git
|
||||||
(use-package magit
|
(use-package magit
|
||||||
|
@ -563,7 +554,7 @@
|
||||||
;; Syntax checking
|
;; Syntax checking
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:hook (lsp-mode . flycheck-mode)
|
:hook (lsp-mode . flycheck-mode)
|
||||||
:custom (flycheck-python-flake8-executable "flake8"))
|
:custom (flycheck-python-flake8-executable 'flake8))
|
||||||
|
|
||||||
(use-package consult-flycheck
|
(use-package consult-flycheck
|
||||||
:after (consult flycheck))
|
:after (consult flycheck))
|
||||||
|
@ -586,13 +577,13 @@
|
||||||
:hook (lsp-mode . lsp-ui-mode)
|
:hook (lsp-mode . lsp-ui-mode)
|
||||||
:custom
|
:custom
|
||||||
(lsp-ui-doc-position 'bottom-and-right)
|
(lsp-ui-doc-position 'bottom-and-right)
|
||||||
(lsp-ui-flycheck-enable t)
|
|
||||||
(lsp-ui-flycheck-list-position 'right)
|
|
||||||
(lsp-ui-peek-enable t)
|
|
||||||
(lsp-ui-sideline-delay 0.6)
|
(lsp-ui-sideline-delay 0.6)
|
||||||
(lsp-ui-sideline-show-code-actions t)
|
(lsp-ui-sideline-show-code-actions t)
|
||||||
(lsp-ui-sideline-show-hover t)
|
(lsp-ui-sideline-show-hover t)
|
||||||
(lsp-ui-sideline-update-mode 'line))
|
(lsp-ui-sideline-update-mode 'line)
|
||||||
|
(lsp-ui-flycheck-enable t)
|
||||||
|
(lsp-ui-flycheck-list-position 'right)
|
||||||
|
(lsp-ui-peek-enable t))
|
||||||
|
|
||||||
(use-package consult-lsp
|
(use-package consult-lsp
|
||||||
:after (consult lsp-mode)
|
:after (consult lsp-mode)
|
||||||
|
@ -617,14 +608,14 @@
|
||||||
:config
|
:config
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
(require 'cl-lib))
|
(require 'cl-lib))
|
||||||
(require 'dap-gdb-lldb)
|
|
||||||
(require 'dap-lldb)
|
|
||||||
(require 'dap-python)
|
(require 'dap-python)
|
||||||
|
(require 'dap-lldb)
|
||||||
|
(require 'dap-gdb-lldb)
|
||||||
:custom
|
:custom
|
||||||
(dap-auto-configure-features '(sessions locals tooltip))
|
|
||||||
(dap-breakpoints-file (concat xdg_cache_home "dap-breakpoints"))
|
(dap-breakpoints-file (concat xdg_cache_home "dap-breakpoints"))
|
||||||
(dap-lldb-debug-program 'lldb-vscode)
|
|
||||||
(dap-utils-extension-path (concat user-emacs-directory "dap-extensions/"))
|
(dap-utils-extension-path (concat user-emacs-directory "dap-extensions/"))
|
||||||
|
(dap-auto-configure-features '(sessions locals tooltip))
|
||||||
|
(dap-lldb-debug-program 'lldb-vscode)
|
||||||
(dap-python-debugger 'debugpy)
|
(dap-python-debugger 'debugpy)
|
||||||
;; Templates
|
;; Templates
|
||||||
(dap-register-debug-template
|
(dap-register-debug-template
|
||||||
|
@ -657,7 +648,6 @@
|
||||||
(use-package lsp-pyright
|
(use-package lsp-pyright
|
||||||
:after (python)
|
:after (python)
|
||||||
:hook (python-ts-mode . (lambda ()
|
:hook (python-ts-mode . (lambda ()
|
||||||
(setq-local fill-column 80)
|
|
||||||
(require 'lsp-pyright)
|
(require 'lsp-pyright)
|
||||||
(lsp)))) ; or `lsp-deferred'
|
(lsp)))) ; or `lsp-deferred'
|
||||||
|
|
||||||
|
@ -682,22 +672,23 @@
|
||||||
;; Web templates
|
;; Web templates
|
||||||
(use-package web-mode
|
(use-package web-mode
|
||||||
:custom
|
:custom
|
||||||
(web-mode-attribute-indent-offset 2)
|
|
||||||
(web-mode-code-indent-offset 2)
|
(web-mode-code-indent-offset 2)
|
||||||
(web-mode-enable-front-matter-block t)
|
(web-mode-enable-front-matter-block t)
|
||||||
(web-mode-markup-indent-offset 2)
|
(web-mode-markup-indent-offset 2)
|
||||||
|
(web-mode-attribute-indent-offset 2)
|
||||||
:mode
|
:mode
|
||||||
((("\\.astro\\'" "\\.html?\\'") . web-mode)))
|
((("\\.astro\\'" "\\.html?\\'") . web-mode)))
|
||||||
|
|
||||||
;; Zig
|
;; Zig
|
||||||
(use-package zig-mode
|
(use-package zig-mode
|
||||||
:commands (zig-mode)
|
:hook
|
||||||
:config (setq-local fill-column 100))
|
(zig-mode . (lambda ()
|
||||||
|
(setq-local fill-column 100)
|
||||||
|
(setq-local tab-width 4))))
|
||||||
|
|
||||||
;;; File format/markup support
|
;;; File format/markup support
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:commands (markdown-mode)
|
:commands (markdown-mode))
|
||||||
:config (setq-local fill-column 120))
|
|
||||||
|
|
||||||
(use-package yaml-pro
|
(use-package yaml-pro
|
||||||
:hook (yaml-ts-mode . yaml-pro-ts-mode))
|
:hook (yaml-ts-mode . yaml-pro-ts-mode))
|
||||||
|
|
|
@ -1,11 +1,25 @@
|
||||||
return {
|
return {
|
||||||
-- statusline
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = true,
|
||||||
|
lazy = true,
|
||||||
|
event = { "BufReadPost", "BufNewFile" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
lazy = true,
|
||||||
|
build = ":TSUpdate",
|
||||||
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
config = true,
|
config = true,
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" }
|
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||||
},
|
},
|
||||||
-- Theme
|
|
||||||
{
|
{
|
||||||
"neanias/everforest-nvim",
|
"neanias/everforest-nvim",
|
||||||
version = false,
|
version = false,
|
||||||
|
@ -19,115 +33,5 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Which-key keybind hints
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
config = true,
|
|
||||||
},
|
|
||||||
-- Auto-pair brackets, parenthesis, etm.
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
config = true,
|
|
||||||
lazy = true,
|
|
||||||
event = { "BufReadPost", "BufNewFile" }
|
|
||||||
},
|
|
||||||
-- Tree-sitter
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
lazy = true,
|
|
||||||
build = ":TSUpdate",
|
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
|
||||||
opts = {
|
|
||||||
indent = { enable = true },
|
|
||||||
highlight = { enable = true },
|
|
||||||
auto_install = { enable = true },
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"cpp",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"markdown",
|
|
||||||
"python",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"yaml",
|
|
||||||
"zig",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Auto-completion
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
event = "InsertEnter",
|
|
||||||
dependencies = {
|
|
||||||
{"L3MON4D3/LuaSnip"},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- Here is where you configure the autocompletion settings.
|
|
||||||
-- The arguments for .extend() have the same shape as `manage_nvim_cmp`:
|
|
||||||
-- https://github.com/VonHeikemen/lsp-zero.nvim/blob/v2.x/doc/md/api-reference.md#manage_nvim_cmp
|
|
||||||
|
|
||||||
require("lsp-zero.cmp").extend()
|
|
||||||
|
|
||||||
-- And you can configure cmp even more, if you want to.
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local cmp_action = require("lsp-zero.cmp").action()
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
mapping = {
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-f>"] = cmp_action.luasnip_jump_forward(),
|
|
||||||
["<C-b>"] = cmp_action.luasnip_jump_backward(),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
-- LSP
|
|
||||||
{
|
|
||||||
"VonHeikemen/lsp-zero.nvim",
|
|
||||||
branch = "v2.x",
|
|
||||||
lazy = true,
|
|
||||||
config = function()
|
|
||||||
-- This is where you modify the settings for lsp-zero
|
|
||||||
-- Note: autocompletion settings will not take effect
|
|
||||||
|
|
||||||
require("lsp-zero.settings").preset({})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
cmd = "LspInfo",
|
|
||||||
event = {"BufReadPre", "BufNewFile"},
|
|
||||||
dependencies = {
|
|
||||||
{"hrsh7th/cmp-nvim-lsp"},
|
|
||||||
{"williamboman/mason-lspconfig.nvim"},
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
lazy = true,
|
|
||||||
build = function()
|
|
||||||
pcall(vim.api.nvim_command, "MasonUpdate")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- This is where all the LSP shenanigans will live
|
|
||||||
|
|
||||||
local lsp = require("lsp-zero")
|
|
||||||
|
|
||||||
lsp.on_attach(function(client, bufnr)
|
|
||||||
-- see :help lsp-zero-keybindings
|
|
||||||
-- to learn the available actions
|
|
||||||
lsp.default_keymaps({buffer = bufnr})
|
|
||||||
end)
|
|
||||||
|
|
||||||
lsp.setup_servers({'pyright', 'zls'})
|
|
||||||
|
|
||||||
-- (Optional) Configure lua language server for neovim
|
|
||||||
-- require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
|
|
||||||
|
|
||||||
lsp.setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue