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
|
||||
(time-subtract (current-time) before-init-time)))
|
||||
gcs-done)))
|
||||
|
||||
;;; Initialize elpaca
|
||||
(defvar elpaca-installer-version 0.5)
|
||||
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
|
||||
|
@ -87,25 +88,6 @@
|
|||
;;; Built-in features
|
||||
(use-package emacs
|
||||
: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
|
||||
(:map global-map
|
||||
;; Disable suspend-frame shortcut
|
||||
|
@ -117,7 +99,7 @@
|
|||
("S-C-<right>" . enlarge-window-horizontally)
|
||||
("S-C-<down>" . shrink-window)
|
||||
("S-C-<up>" . enlarge-window))
|
||||
:config
|
||||
:init
|
||||
;;; General Options
|
||||
;; Better scrolling
|
||||
(setq scroll-step 1
|
||||
|
@ -138,7 +120,26 @@
|
|||
(prefer-coding-system 'utf-8)
|
||||
(set-default-coding-systems '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
|
||||
:elpaca nil
|
||||
|
@ -153,8 +154,8 @@
|
|||
:elpaca nil
|
||||
:hook ((conf-mode
|
||||
markdown-mode
|
||||
prog-mode) . display-fill-column-indicator-mode)
|
||||
:config (setq-default fill-column 100))
|
||||
lsp-mode) . display-fill-column-indicator-mode)
|
||||
:config (setq-default fill-column 80))
|
||||
|
||||
(use-package display-line-numbers
|
||||
:elpaca nil
|
||||
|
@ -168,16 +169,16 @@
|
|||
(use-package files
|
||||
:elpaca nil
|
||||
: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
|
||||
confirm-kill-processes nil
|
||||
delete-old-versions t
|
||||
kept-new-versions 5
|
||||
kept-old-versions 3
|
||||
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
|
||||
:elpaca nil
|
||||
|
@ -226,8 +227,8 @@
|
|||
(use-package simple
|
||||
:elpaca nil
|
||||
:config
|
||||
(setq-default indent-tabs-mode nil)
|
||||
(column-number-mode))
|
||||
(setq-default indent-tabs-mode nil
|
||||
column-number-mode t))
|
||||
|
||||
(use-package whitespace
|
||||
:elpaca nil
|
||||
|
@ -237,12 +238,11 @@
|
|||
text-mode) . whitespace-mode)
|
||||
:config
|
||||
(add-hook 'before-save-hook #'whitespace-cleanup)
|
||||
(setq whitespace-line-column nil
|
||||
whitespace-style '(face
|
||||
lines-char
|
||||
(setq whitespace-line-column 100
|
||||
whitespace-style '(big-indent
|
||||
face
|
||||
lines-tail
|
||||
missing-newline-at-eof
|
||||
space-after-tab
|
||||
space-before-tab
|
||||
tabs
|
||||
trailing)))
|
||||
|
||||
|
@ -254,31 +254,21 @@
|
|||
|
||||
;; Theme
|
||||
(use-package everforest
|
||||
:elpaca (everforest :host sourcehut :repo "theorytoe/everforest-theme")
|
||||
:elpaca (everforest
|
||||
:host sourcehut
|
||||
:repo "theorytoe/everforest-theme")
|
||||
:config
|
||||
(setq custom-safe-themes t)
|
||||
(load-theme 'everforest-hard-dark t)
|
||||
(let ((moody_line (face-attribute 'mode-line :foreground))
|
||||
(moody_inactive (face-attribute 'mode-line-inactive :background)))
|
||||
(set-face-attribute 'mode-line nil :overline moody_line)
|
||||
(set-face-attribute 'mode-line-inactive nil :overline moody_line)
|
||||
(set-face-attribute 'mode-line-inactive nil :underline moody_line)
|
||||
(set-face-attribute 'cursor nil :background "#7fbbb3")
|
||||
(let ((line (face-attribute 'mode-line :foreground))
|
||||
(inactive (face-attribute 'mode-line-inactive :background)))
|
||||
(set-face-attribute 'mode-line nil :overline 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-inactive nil :box nil)
|
||||
(set-face-attribute 'mode-line-inactive nil :background moody_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")))))
|
||||
(set-face-attribute 'mode-line-inactive nil :background inactive)))
|
||||
|
||||
(elpaca-wait)
|
||||
|
||||
|
@ -460,7 +450,8 @@
|
|||
:config (push #'kind-icon-margin-formatter corfu-margin-formatters)
|
||||
:custom
|
||||
(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
|
||||
(use-package magit
|
||||
|
@ -563,7 +554,7 @@
|
|||
;; Syntax checking
|
||||
(use-package flycheck
|
||||
:hook (lsp-mode . flycheck-mode)
|
||||
:custom (flycheck-python-flake8-executable "flake8"))
|
||||
:custom (flycheck-python-flake8-executable 'flake8))
|
||||
|
||||
(use-package consult-flycheck
|
||||
:after (consult flycheck))
|
||||
|
@ -586,13 +577,13 @@
|
|||
:hook (lsp-mode . lsp-ui-mode)
|
||||
:custom
|
||||
(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-show-code-actions 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
|
||||
:after (consult lsp-mode)
|
||||
|
@ -617,14 +608,14 @@
|
|||
:config
|
||||
(eval-when-compile
|
||||
(require 'cl-lib))
|
||||
(require 'dap-gdb-lldb)
|
||||
(require 'dap-lldb)
|
||||
(require 'dap-python)
|
||||
(require 'dap-lldb)
|
||||
(require 'dap-gdb-lldb)
|
||||
:custom
|
||||
(dap-auto-configure-features '(sessions locals tooltip))
|
||||
(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-auto-configure-features '(sessions locals tooltip))
|
||||
(dap-lldb-debug-program 'lldb-vscode)
|
||||
(dap-python-debugger 'debugpy)
|
||||
;; Templates
|
||||
(dap-register-debug-template
|
||||
|
@ -657,7 +648,6 @@
|
|||
(use-package lsp-pyright
|
||||
:after (python)
|
||||
:hook (python-ts-mode . (lambda ()
|
||||
(setq-local fill-column 80)
|
||||
(require 'lsp-pyright)
|
||||
(lsp)))) ; or `lsp-deferred'
|
||||
|
||||
|
@ -682,22 +672,23 @@
|
|||
;; Web templates
|
||||
(use-package web-mode
|
||||
:custom
|
||||
(web-mode-attribute-indent-offset 2)
|
||||
(web-mode-code-indent-offset 2)
|
||||
(web-mode-enable-front-matter-block t)
|
||||
(web-mode-markup-indent-offset 2)
|
||||
(web-mode-attribute-indent-offset 2)
|
||||
:mode
|
||||
((("\\.astro\\'" "\\.html?\\'") . web-mode)))
|
||||
|
||||
;; Zig
|
||||
(use-package zig-mode
|
||||
:commands (zig-mode)
|
||||
:config (setq-local fill-column 100))
|
||||
:hook
|
||||
(zig-mode . (lambda ()
|
||||
(setq-local fill-column 100)
|
||||
(setq-local tab-width 4))))
|
||||
|
||||
;;; File format/markup support
|
||||
(use-package markdown-mode
|
||||
:commands (markdown-mode)
|
||||
:config (setq-local fill-column 120))
|
||||
:commands (markdown-mode))
|
||||
|
||||
(use-package yaml-pro
|
||||
:hook (yaml-ts-mode . yaml-pro-ts-mode))
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
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",
|
||||
config = true,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" }
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||
},
|
||||
-- Theme
|
||||
{
|
||||
"neanias/everforest-nvim",
|
||||
version = false,
|
||||
|
@ -19,115 +33,5 @@ return {
|
|||
})
|
||||
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