Various improvements

This commit is contained in:
Adam Cooper 2023-12-10 11:46:19 -05:00
parent a54e76ced0
commit 5b85d400f0
3 changed files with 46 additions and 22 deletions

View file

@ -1,5 +1,16 @@
### dotfiles
These are the messy dotfiles for my Arch Linux system. They're useful for These are the messy dotfiles for my Arch Linux system. They're useful for
- restoring my system after a catastrophe - restoring my system after a catastrophe
- almost nothing else :) - almost nothing else :)
#### dracula/vim
I am using my own fork of dracula/vim. Specifically, I changed the color of the virtual text so it doesn't conflict with the cursor line. When updates in upstream come through, we run the following:
- `git switch master`
- `git pull upstream`
- `git switch adamc-main`
- `git merge master`
- `git add . && git commit`
- `git push origin`
Please feel free to contact me with any questions; I'll be glad to help. Please feel free to contact me with any questions; I'll be glad to help.

View file

@ -6,8 +6,8 @@ vim.opt.clipboard = "unnamedplus,unnamed"
-- Spaces indentation -- Spaces indentation
vim.opt.expandtab = true -- converts tabs to spaces vim.opt.expandtab = true -- converts tabs to spaces
vim.opt.tabstop = 2 -- tab equals 2 spaces vim.opt.tabstop = 4 -- tab equals 2 spaces
vim.opt.shiftwidth = 2 -- indent size in characters vim.opt.shiftwidth = 4 -- indent size in characters
-- Show whitespace (:list) -- Show whitespace (:list)
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·" vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
@ -22,13 +22,13 @@ vim.opt.splitright = true
vim.opt.cursorline = true vim.opt.cursorline = true
-- Enable folding -- Enable folding
vim.opt.foldmethod = "indent" vim.opt.foldmethod = "syntax"
vim.opt.foldlevel = 99 vim.opt.foldlevel = 0
-- Terminal colors -- Enable 24-bit RGB color in the TUI
vim.opt.termguicolors = true vim.opt.termguicolors = true
-- Cursor line context -- Minimal number of lines kept above and below the cursor
vim.opt.scrolloff = 5 vim.opt.scrolloff = 5
-- netrw -- netrw
@ -40,14 +40,16 @@ vim.g.netrw_liststyle = 3 -- tree style listing
-- vim.keymap.set("t", "<Esc>", "<c-\\><c-n>", { noremap = true }) -- vim.keymap.set("t", "<Esc>", "<c-\\><c-n>", { noremap = true })
-- Sane vim split naviagation (via Gaslight blog) -- Sane vim split naviagation (via Gaslight blog)
vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true }) vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true }) vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true }) vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' })
vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true })
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true }) -- N.B. This conflicts with the NetRW directory refresh command.
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true }) vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true }) vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true }) vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set( vim.keymap.set(
{"i", "n", "t", "v"}, {"i", "n", "t", "v"},
@ -85,7 +87,8 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
{ {
"dracula/vim", url = "https://git.theadamcooper.com/adam/dracula-vim.git",
branch = "adamc-main",
name = "dracula", name = "dracula",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
@ -113,7 +116,7 @@ require("lazy").setup({
end, end,
opts = { opts = {
window = { window = {
border = "shadow", border = "single",
}, },
}, },
}, },
@ -159,8 +162,13 @@ it also provides the buffer breadcrumbs.
require('lualine').setup { require('lualine').setup {
options = { theme = 'dracula' }, options = { theme = 'dracula' },
tabline = { tabline = {
lualine_a = { 'buffers' }, lualine_a = {
} {
'buffers',
mode = 4,
},
},
},
} }
--[[ Telescope --[[ Telescope
@ -283,7 +291,7 @@ lspconfig.rust_analyzer.setup {
}, },
} }
-- Global mappings. -- Global mappings : Diagnostics
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, { desc = 'Diagnostic: open float' }) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, { desc = 'Diagnostic: open float' })
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to previous' }) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to previous' })
@ -380,13 +388,13 @@ require('gitsigns').setup({
if vim.wo.diff then return ']c' end if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end) vim.schedule(function() gs.next_hunk() end)
return '<Ignore>' return '<Ignore>'
end, {expr=true}) end, {expr=true, desc='GitSigns: go to next hunk'})
map('n', '[c', function() map('n', '[c', function()
if vim.wo.diff then return '[c' end if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end) vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>' return '<Ignore>'
end, {expr=true}) end, {expr=true, desc='GitSigns: go to previous hunk'})
-- Actions -- Actions
map('n', '<leader>hs', gs.stage_hunk, { desc = 'GitSigns: stage hunk' }) map('n', '<leader>hs', gs.stage_hunk, { desc = 'GitSigns: stage hunk' })
@ -406,10 +414,15 @@ require('gitsigns').setup({
end end
}) })
--[[
-- LSPSaga : provides a diverse basket of utilities
--]]
require('lspsaga').setup() require('lspsaga').setup()
-- Tweak GitSigns blame color -- Tweak GitSigns blame color
-- This differentiates the cursorline from the git blame text
vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944") vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944")
vim.cmd("highlight NonText gui=bold guifg=#999999")
-- Switch syntax highlighting on -- Switch syntax highlighting on
vim.cmd("syntax enable") vim.cmd("syntax enable")

View file

@ -44,7 +44,7 @@ highlight article ":.*\\(image\\)$" blue default
highlight article ":.*\\(embedded flash\\)$" magenta default highlight article ":.*\\(embedded flash\\)$" magenta default
keep-articles-days 45 keep-articles-days 45
macro c set browser "xterm -e mpv --vid=no -- %u &"; one; set browser qutebrowser macro p set browser "mpv --player-operation-mode=pseudo-gui -- %u &"; one; set browser w3m
max-items 4096 max-items 4096
notify-program "/usr/bin/notify-send" notify-program "/usr/bin/notify-send"
urls-source "freshrss" urls-source "freshrss"