Compare commits

...

47 commits

Author SHA1 Message Date
38aab12b16 [lazyvim] Whoops, vscode extra 2025-02-14 08:48:24 -05:00
50f92bf9b5 [lazyvim] Fix after merge 2025-02-14 08:38:19 -05:00
c646c3e7bc Merge branch 'main' of git.theadamcooper.com:adam/dotfiles 2025-02-14 08:32:35 -05:00
573c9e1470 [lazyvim] Add: fzf-lua 2025-02-14 07:48:01 -05:00
ed6af1b9a2 [lazyvim] Fix mapleader 2025-02-14 07:39:43 -05:00
77c46a3e32 [lazyvim] Add plugin: Mason with opts 2025-02-14 07:19:12 -05:00
94991534e1 [lazyvim] Add plugins: nvlime, paredit 2025-02-14 07:13:49 -05:00
bc0b507af4 [lazyvim] updating plugins gets me a lock file 2025-02-14 07:08:31 -05:00
b933fbb0d2 [lazyvim] added lang extras; still working 2025-02-13 23:32:27 -05:00
7be9690ef7 [lazyvim] added non-lang extras; still working 2025-02-13 23:29:34 -05:00
31acea288c [lazyvim] This file is created automatically on first launch 2025-02-13 23:27:18 -05:00
7beb8c156f [awesome] Restoring unrelated commits 2025-02-13 23:04:46 -05:00
52be155337 [nvim] Plugin changes 2025-02-13 08:52:51 -05:00
79edaa8167 [awesome] Formatting
This must have happened from my touching this file for the first time
after installing LazyVim
2025-02-13 08:51:52 -05:00
45666d538f [awesome] Add clipcatd 2025-01-29 08:08:05 -05:00
2c2b870a2b [nvim] Leaning into LazyVim 2025-01-25 19:47:20 -05:00
be71f3ade0 Switch to LazyVim (probably temporary) 2025-01-22 08:32:46 -05:00
4ae4db82e8 [nvim] Renamed folder 2025-01-18 15:47:26 -05:00
7d6da679e0 [zsh] New theme for bat 2025-01-18 15:05:02 -05:00
87a6044f29 Various changes 2025-01-16 20:32:33 -05:00
6254abbb34 Lots of changes, some consequential 2024-12-08 17:47:54 -05:00
bb9916703c [bin] [autoreply] Reinstate the fix for date header of autoreply 2024-08-05 12:12:19 -04:00
7e5c97de78 Small tweaks 2024-08-03 11:49:52 -04:00
ccc1ff6a21 [bin][autoreply] Nearly working;
messages are not being saved to the Sent folder
2024-08-03 10:39:40 -04:00
e992db6c07 bin: Significant refactor of the autoreply script 2024-07-27 01:00:02 -04:00
b49716c6f1 Various changes
awesome
- Change font of top bar
- Fix indentation
bin
- start-tuis.sh
neovim
- Some new plugins
newsboat
- Remove nitter items
zsh
- Minor tweaks
2024-07-27 00:58:33 -04:00
952d12d560 [awesome] Customized notification theming
This work is still commented out for now. Once we successfully
switch to awesome-git we can bring these changes in.
2024-06-17 09:55:18 -04:00
9a941cb6e3 Various tweaks
[bin] New script to start usual TUI's
[neovim] Set up nvlime; swap out neodev for lazydev
2024-06-17 09:40:36 -04:00
6f83e32406 [neovim] Install octo.nvim (and some formatting) 2024-04-03 08:46:35 -04:00
1f3249a316 Various changes to neovim, awesome
- Better handling of new terminals
- Miscellaneous neovim tweaks
2024-04-02 08:28:14 -04:00
9b360075c9 [neovim] A few things
- LSPSaga x fugitive: :Gvdiffsplit : now aligned
- Killed hlsearch
- <c-l> remapped
- conditional idelayout
2024-01-15 15:27:33 -05:00
8e8ace0109 [neovim] Mostly plugin improvements 2024-01-15 10:23:20 -05:00
69bfb70de8 [neovim] Add border and max width to floating windows 2024-01-09 08:11:14 -05:00
a978993d21 [neovim] Fix the LSPSaga/fugitive conflict
This mostly fixes the issue of the mismatch between fugitive's blame
window and LSPSaga's breadcrumbs.
2024-01-06 01:34:43 -05:00
945556897f [neovim] Automatic toggling of dap-ui panels 2024-01-02 19:44:48 -05:00
70defe1866 Working on small NestJS 2024-01-01 17:33:05 -05:00
9d71ab4be4 Trying to get debugging going for JS/TS 2024-01-01 11:27:24 -05:00
938ff36c6b [dap] Some progress
Looks like we can load the launch.json. But it seems the debugger
is being started twice, as I get an EADDRINUSE error on
:DapContinue
2023-12-29 16:40:11 -05:00
c3109dcf17 Trying to rig up dap for NestJS/TS 2023-12-26 16:41:21 -05:00
84a790c53f Minor updates 2023-12-26 16:40:14 -05:00
8ed7eab826 [neovim] Some tweaks 2023-12-23 19:49:59 -05:00
7153792ade [neovim] Lspsaga keymaps 2023-12-15 09:03:39 -05:00
5b85d400f0 Various improvements 2023-12-10 11:46:19 -05:00
a54e76ced0 [neovim] lsp_signature.nvim 2023-11-29 09:07:00 -05:00
5bed974dda [neovim] Various items:
- Restructure the config
- Add nvim-surround
- Add which-key window border
- Comments as documentation
- Tweak GitSigns blame color to swerve away from CursorLine
2023-11-28 09:27:05 -05:00
f0c5df79b8 Plugin optimization 2023-11-23 12:02:52 -05:00
c520d3ec26 Remove duplicate colorscheme designation 2023-11-17 08:28:38 -05:00
32 changed files with 2447 additions and 903 deletions

View file

@ -1,3 +1,4 @@
### 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 :)

View file

@ -1,24 +1,28 @@
#!/bin/sh #!/bin/sh
#
# autorun.sh
# AwesomeWM startup items
run() { run() {
if ! pgrep -f "$1" ; if ! pgrep -f "$1"; then
then "$@" &
"$@"&
fi fi
} }
# Currently not working /usr/sbin/wezterm start &
# run "(pgrep alacritty && alacritty msg create-window --title bottom -e btm --battery || alacritty --title bottom -e btm --battery)"
/usr/sbin/alacritty --title bottom --command btm --battery &
/usr/sbin/alacritty --title awesome-startup &
run "cbatticon" run "cbatticon"
run "blueman-applet" run "blueman-applet"
run "nm-applet" run "nm-applet"
run "nextcloud --background" run "mullvad-vpn"
run "pasystray"
run "xscreensaver -no-splash"
run "sleep 4"
run "wmctrl -r bottom -t 8"
run "keepassxc" run "keepassxc"
/usr/sbin/nextcloud --background &
/usr/sbin/pasystray --key-grabbing --notify=all &
/usr/sbin/xscreensaver -no-splash &
/usr/sbin/clipcatd &
/usr/sbin/sleep 4
# This seems to broken specifically for wezterm & btop at startup
/usr/sbin/wezterm cli spawn --new-window -- /usr/sbin/btop
/usr/sbin/sleep 2
/usr/sbin/wmctrl -r btop -t 8

View file

@ -11,7 +11,7 @@ local themes_path = gfs.get_themes_dir()
local theme = {} local theme = {}
theme.font = "Liberation Sans 8" theme.font = "Fantasque Sans Mono 8"
theme.bg_normal = "#222222" theme.bg_normal = "#222222"
theme.bg_focus = "#535d6c" theme.bg_focus = "#535d6c"
@ -54,7 +54,10 @@ theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
-- Variables set for theming notifications: -- Variables set for theming notifications:
-- notification_font -- notification_font
theme.notification_font = "Liberation Sans 8"
-- notification_[bg|fg] -- notification_[bg|fg]
theme.notification_bg = "#00ff00"
theme.notification_fg = "#600060"
-- notification_[width|height|margin] -- notification_[width|height|margin]
-- notification_[border_color|border_width|shape|opacity] -- notification_[border_color|border_width|shape|opacity]

View file

@ -14,6 +14,7 @@ local beautiful = require("beautiful")
local naughty = require("naughty") local naughty = require("naughty")
local menubar = require("menubar") local menubar = require("menubar")
local lain = require("lain") local lain = require("lain")
-- local ruled = require("ruled")
local hotkeys_popup = require("awful.hotkeys_popup") local hotkeys_popup = require("awful.hotkeys_popup")
-- Enable hotkeys help widget for VIM and other apps -- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened: -- when client with a matching name is opened:
@ -23,22 +24,28 @@ require("awful.hotkeys_popup.keys")
-- Check if awesome encountered an error during startup and fell back to -- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config) -- another config (This code will only ever execute for the fallback config)
if awesome.startup_errors then if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical, naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!", title = "Oops, there were errors during startup!",
text = awesome.startup_errors }) text = awesome.startup_errors,
})
end end
-- Handle runtime errors after startup -- Handle runtime errors after startup
do do
local in_error = false local in_error = false
awesome.connect_signal("debug::error", function (err) awesome.connect_signal("debug::error", function(err)
-- Make sure we don't go into an endless error loop -- Make sure we don't go into an endless error loop
if in_error then return end if in_error then
return
end
in_error = true in_error = true
naughty.notify({ preset = naughty.config.presets.critical, naughty.notify({
preset = naughty.config.presets.critical,
title = "Oops, an error happened!", title = "Oops, an error happened!",
text = tostring(err) }) text = tostring(err),
})
in_error = false in_error = false
end) end)
end end
@ -50,17 +57,29 @@ end
beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.lua") beautiful.init(gears.filesystem.get_configuration_dir() .. "mytheme.lua")
-- This is used later as the default terminal and editor to run. -- This is used later as the default terminal and editor to run.
-- terminal = "alacritty" -- local terminal = "wezterm"
--[[
terminal = function() terminal = function()
local is_running = os.execute("pgrep alacritty") local is_running = os.execute("pgrep alacritty")
if is_running == nil then if is_running == nil then
return "/usr/sbin/alacritty" return "/usr/sbin/alacritty --socket /run/user/1000/alacritty-main.sock"
else else
return "/usr/sbin/alacritty msg create-window" return "/usr/sbin/alacritty msg --socket /run/user/1000/alacritty-main.sock create-window"
end end
end end
editor = os.getenv("EDITOR") or "nano" ]]
editor_cmd = terminal() .. " -e " .. editor --
local terminal = function()
local is_running = os.execute("pgrep wezterm")
if is_running == nil then
return "/usr/sbin/wezterm start"
else
return "/usr/sbin/wezterm cli spawn --new-window"
end
end
local editor = os.getenv("EDITOR") or "nano"
local editor_cmd = terminal() .. " -- " .. editor
-- local editor_cmd = terminal .. " -e " .. editor
-- Default modkey. -- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt. -- Usually, Mod4 is the key with a logo between Control and Alt.
@ -70,8 +89,9 @@ editor_cmd = terminal() .. " -e " .. editor
modkey = "Mod4" modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters. -- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = { -- awful.layout.layouts = {
awful.layout.suit.tile, awful.layout.append_default_layouts({
-- awful.layout.suit.tile,
awful.layout.suit.max, awful.layout.suit.max,
awful.layout.suit.max.fullscreen, awful.layout.suit.max.fullscreen,
awful.layout.suit.tile.left, awful.layout.suit.tile.left,
@ -87,27 +107,37 @@ awful.layout.layouts = {
-- awful.layout.suit.corner.ne, -- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw, -- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se, -- awful.layout.suit.corner.se,
} })
-- }}} -- }}}
-- {{{ Menu -- {{{ Menu
-- Create a launcher widget and a main menu -- Create a launcher widget and a main menu
myawesomemenu = { myawesomemenu = {
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, {
"hotkeys",
function()
hotkeys_popup.show_help(nil, awful.screen.focused())
end,
},
{ "manual", terminal() .. " -e man awesome" }, { "manual", terminal() .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awesome.conffile }, { "edit config", editor_cmd .. " " .. awesome.conffile },
{ "restart", awesome.restart }, { "restart", awesome.restart },
-- { "quit", function() awesome.quit() end }, {
{ "quit", "xfce4-session-logout &" }, "quit",
function()
awesome.quit()
end,
},
} }
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, mymainmenu = awful.menu({
{ "open terminal", terminal() } items = {
} { "awesome", myawesomemenu, beautiful.awesome_icon },
}) { "open terminal", terminal() },
},
})
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, menu = mymainmenu })
menu = mymainmenu })
-- Menubar configuration -- Menubar configuration
menubar.utils.terminal = terminal() -- Set the terminal for applications that require it menubar.utils.terminal = terminal() -- Set the terminal for applications that require it
@ -122,49 +152,52 @@ mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join( local taglist_buttons = gears.table.join(
awful.button({ }, 1, function(t) t:view_only() end), awful.button({}, 1, function(t)
t:view_only()
end),
awful.button({ modkey }, 1, function(t) awful.button({ modkey }, 1, function(t)
if client.focus then if client.focus then
client.focus:move_to_tag(t) client.focus:move_to_tag(t)
end end
end), end),
awful.button({ }, 3, awful.tag.viewtoggle), awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t) awful.button({ modkey }, 3, function(t)
if client.focus then if client.focus then
client.focus:toggle_tag(t) client.focus:toggle_tag(t)
end end
end), end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({}, 4, function(t)
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) awful.tag.viewnext(t.screen)
) end),
awful.button({}, 5, function(t)
awful.tag.viewprev(t.screen)
end)
)
local tasklist_buttons = gears.table.join( local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c) awful.button({}, 1, function(c)
if c == client.focus then if c == client.focus then
c.minimized = true c.minimized = true
else else
c:emit_signal( c:emit_signal("request::activate", "tasklist", { raise = true })
"request::activate",
"tasklist",
{raise = true}
)
end end
end), end),
awful.button({ }, 3, function() awful.button({}, 3, function()
awful.menu.client_list({ theme = { width = 250 } }) awful.menu.client_list({ theme = { width = 250 } })
end), end),
awful.button({ }, 4, function () awful.button({}, 4, function()
awful.client.focus.byidx(1) awful.client.focus.byidx(1)
end), end),
awful.button({ }, 5, function () awful.button({}, 5, function()
awful.client.focus.byidx(-1) awful.client.focus.byidx(-1)
end)) end)
)
local function set_wallpaper(s) local function set_wallpaper(s)
-- Wallpaper -- Wallpaper
if beautiful.wallpaper then if beautiful.wallpaper then
-- local wallpaper = beautiful.wallpaper -- local wallpaper = beautiful.wallpaper
local wallpaper = "/home/adam/Pictures/wallpapers/shared/cemetery_sunray.jpeg" local wallpaper = "/home/adam/Pictures/wallpapers/shared/montauk-light-01.jpg"
-- If wallpaper is a function, call it with the screen -- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then if type(wallpaper) == "function" then
wallpaper = wallpaper(s) wallpaper = wallpaper(s)
@ -173,27 +206,61 @@ local function set_wallpaper(s)
end end
end end
-- Notifications
--[[
ruled.notification.connect_signal("request::rules", function()
-- Add a red background for urgent notifications.
ruled.notification.append_rule {
rule = { urgency = "critical" },
properties = { bg = "#ff0000", fg = "#32cd32", timeout = 0 }
}
-- Or green background for normal ones.
ruled.notification.append_rule {
rule = { urgency = "normal" },
properties = { bg = "#32cd32", fg = "#800080"}
}
ruled.notification.append_rule {
rule = { urgency = "low" },
properties = { bg = "#bbccff", fg = "#191970"}
}
end)
--]]
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper) screen.connect_signal("property::geometry", set_wallpaper)
local mymem = lain.widget.mem { local mymem = lain.widget.mem({
settings = function() settings = function()
widget:set_markup(" mem " .. mem_now.perc .. " swp " .. math.floor((mem_now.swapused / mem_now.swap) * 100)) local mem_spacer = ""
local swp_spacer = ""
local swp_display = math.floor((mem_now.swapused / mem_now.swap) * 100)
if mem_now.perc < 10 then
mem_spacer = " "
end end
} if swp_display < 10 then
swp_spacer = " "
end
widget:set_markup(" mem " .. mem_spacer .. mem_now.perc .. " swp " .. swp_spacer .. swp_display .. " ")
end,
})
local mycpu = lain.widget.cpu { local mycpu = lain.widget.cpu({
settings = function() settings = function()
widget:set_markup(" cpu " .. cpu_now.usage) local cpu_spacer = ""
if cpu_now.usage < 10 then
cpu_spacer = " "
end end
} widget:set_markup(" cpu " .. cpu_spacer .. cpu_now.usage)
end,
})
local myweather = lain.widget.weather({ local myweather = lain.widget.weather({
APPID = "f6497dd133dd22b541abc8bbe8360f3b", APPID = "f6497dd133dd22b541abc8bbe8360f3b",
lat = 40.651, lat = 40.651,
lon = -73.949, lon = -73.949,
units = 'imperial', units = "imperial",
notification_text_fun = function (wn) notification_text_fun = function(wn)
local day = os.date("%a %d", wn["dt"]) local day = os.date("%a %d", wn["dt"])
local temp = math.floor(wn["main"]["temp"]) local temp = math.floor(wn["main"]["temp"])
local desc = wn["weather"][1]["description"] local desc = wn["weather"][1]["description"]
@ -202,7 +269,7 @@ local myweather = lain.widget.weather({
settings = function() settings = function()
units = math.floor(weather_now["main"]["temp"]) units = math.floor(weather_now["main"]["temp"])
widget:set_markup(" " .. units .. " ") widget:set_markup(" " .. units .. " ")
end end,
}) })
awful.screen.connect_for_each_screen(function(s) awful.screen.connect_for_each_screen(function(s)
@ -218,29 +285,38 @@ awful.screen.connect_for_each_screen(function(s)
-- We need one layoutbox per screen. -- We need one layoutbox per screen.
s.mylayoutbox = awful.widget.layoutbox(s) s.mylayoutbox = awful.widget.layoutbox(s)
s.mylayoutbox:buttons(gears.table.join( s.mylayoutbox:buttons(gears.table.join(
awful.button({ }, 1, function () awful.layout.inc( 1) end), awful.button({}, 1, function()
awful.button({ }, 3, function () awful.layout.inc(-1) end), awful.layout.inc(1)
awful.button({ }, 4, function () awful.layout.inc( 1) end), end),
awful.button({ }, 5, function () awful.layout.inc(-1) end))) awful.button({}, 3, function()
awful.layout.inc(-1)
end),
awful.button({}, 4, function()
awful.layout.inc(1)
end),
awful.button({}, 5, function()
awful.layout.inc(-1)
end)
))
-- Create a taglist widget -- Create a taglist widget
s.mytaglist = awful.widget.taglist { s.mytaglist = awful.widget.taglist({
screen = s, screen = s,
filter = awful.widget.taglist.filter.all, filter = awful.widget.taglist.filter.all,
buttons = taglist_buttons buttons = taglist_buttons,
} })
-- Create a tasklist widget -- Create a tasklist widget
s.mytasklist = awful.widget.tasklist { s.mytasklist = awful.widget.tasklist({
screen = s, screen = s,
filter = awful.widget.tasklist.filter.currenttags, filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons buttons = tasklist_buttons,
} })
-- Create the wibox -- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s }) s.mywibox = awful.wibar({ position = "top", screen = s })
-- Add widgets to the wibox -- Add widgets to the wibox
s.mywibox:setup { s.mywibox:setup({
layout = wibox.layout.align.horizontal, layout = wibox.layout.align.horizontal,
{ -- Left widgets { -- Left widgets
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
@ -259,224 +335,218 @@ awful.screen.connect_for_each_screen(function(s)
mytextclock, mytextclock,
s.mylayoutbox, s.mylayoutbox,
}, },
} })
end) end)
-- }}} -- }}}
-- {{{ Mouse bindings -- {{{ Mouse bindings
root.buttons(gears.table.join( root.buttons(gears.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({}, 3, function()
awful.button({ }, 4, awful.tag.viewnext), mymainmenu:toggle()
awful.button({ }, 5, awful.tag.viewprev) end),
awful.button({}, 4, awful.tag.viewnext),
awful.button({}, 5, awful.tag.viewprev)
)) ))
-- }}} -- }}}
-- {{{ Key bindings -- {{{ Key bindings
globalkeys = gears.table.join( globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
{description="show help", group="awesome"}), awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
awful.key({ modkey, }, "Left", awful.tag.viewprev, awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
{description = "view previous", group = "tag"}), awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j", awful.key({ modkey }, "j", function()
function () awful.client.focus.byidx(1)
awful.client.focus.byidx( 1) end, { description = "focus next by index", group = "client" }),
end, awful.key({ modkey }, "k", function()
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1) awful.client.focus.byidx(-1)
end, end, { description = "focus previous by index", group = "client" }),
{description = "focus previous by index", group = "client"} awful.key({ modkey }, "w", function()
), mymainmenu:show()
awful.key({ modkey, }, "w", function () mymainmenu:show() end, end, { description = "show main menu", group = "awesome" }),
{description = "show main menu", group = "awesome"}),
-- Layout manipulation -- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, awful.key({ modkey, "Shift" }, "j", function()
{description = "swap with next client by index", group = "client"}), awful.client.swap.byidx(1)
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, end, { description = "swap with next client by index", group = "client" }),
{description = "swap with previous client by index", group = "client"}), awful.key({ modkey, "Shift" }, "k", function()
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, awful.client.swap.byidx(-1)
{description = "focus the next screen", group = "screen"}), end, { description = "swap with previous client by index", group = "client" }),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, awful.key({ modkey, "Control" }, "j", function()
{description = "focus the previous screen", group = "screen"}), awful.screen.focus_relative(1)
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, end, { description = "focus the next screen", group = "screen" }),
{description = "jump to urgent client", group = "client"}), awful.key({ modkey, "Control" }, "k", function()
awful.key({ modkey, }, "Tab", awful.screen.focus_relative(-1)
function () end, { description = "focus the previous screen", group = "screen" }),
awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
awful.key({ modkey }, "Tab", function()
awful.client.focus.history.previous() awful.client.focus.history.previous()
if client.focus then if client.focus then
client.focus:raise() client.focus:raise()
end end
end, end, { description = "go back", group = "client" }),
{description = "go back", group = "client"}),
-- Standard program -- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal()) end, awful.key({ modkey }, "Return", function()
{description = "open a terminal", group = "launcher"}), awful.spawn(terminal())
awful.key({ modkey, "Control" }, "r", awesome.restart, end, { description = "open a terminal", group = "launcher" }),
{description = "reload awesome", group = "awesome"}), awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
awful.key({ modkey, "Shift" }, "q", awesome.quit, awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, awful.key({ modkey }, "l", function()
{description = "increase master width factor", group = "layout"}), awful.tag.incmwfact(0.05)
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, end, { description = "increase master width factor", group = "layout" }),
{description = "decrease master width factor", group = "layout"}), awful.key({ modkey }, "h", function()
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, awful.tag.incmwfact(-0.05)
{description = "increase the number of master clients", group = "layout"}), end, { description = "decrease master width factor", group = "layout" }),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, awful.key({ modkey, "Shift" }, "h", function()
{description = "decrease the number of master clients", group = "layout"}), awful.tag.incnmaster(1, nil, true)
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, end, { description = "increase the number of master clients", group = "layout" }),
{description = "increase the number of columns", group = "layout"}), awful.key({ modkey, "Shift" }, "l", function()
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, awful.tag.incnmaster(-1, nil, true)
{description = "decrease the number of columns", group = "layout"}), end, { description = "decrease the number of master clients", group = "layout" }),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, awful.key({ modkey, "Control" }, "h", function()
{description = "select next", group = "layout"}), awful.tag.incncol(1, nil, true)
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, end, { description = "increase the number of columns", group = "layout" }),
{description = "select previous", group = "layout"}), awful.key({ modkey, "Control" }, "l", function()
awful.tag.incncol(-1, nil, true)
end, { description = "decrease the number of columns", group = "layout" }),
awful.key({ modkey }, "space", function()
awful.layout.inc(1)
end, { description = "select next", group = "layout" }),
awful.key({ modkey, "Shift" }, "space", function()
awful.layout.inc(-1)
end, { description = "select previous", group = "layout" }),
awful.key({ modkey, "Control" }, "n", awful.key({ modkey, "Control" }, "n", function()
function ()
local c = awful.client.restore() local c = awful.client.restore()
-- Focus restored client -- Focus restored client
if c then if c then
c:emit_signal( c:emit_signal("request::activate", "key.unminimize", { raise = true })
"request::activate", "key.unminimize", {raise = true}
)
end end
end, end, { description = "restore minimized", group = "client" }),
{description = "restore minimized", group = "client"}),
-- Prompt -- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, awful.key({ modkey }, "r", function()
{description = "run prompt", group = "launcher"}), awful.screen.focused().mypromptbox:run()
end, { description = "run prompt", group = "launcher" }),
awful.key({ modkey }, "x", awful.key({ modkey }, "x", function()
function () awful.prompt.run({
awful.prompt.run {
prompt = "Run Lua code: ", prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget, textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval, exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval" history_path = awful.util.get_cache_dir() .. "/history_eval",
} })
end, end, { description = "lua execute prompt", group = "awesome" }),
{description = "lua execute prompt", group = "awesome"}),
-- Menubar -- Menubar
awful.key({ modkey }, "p", function() os.execute("dmenu_run") end, awful.key({ modkey }, "p", function()
{description = "show the menubar", group = "launcher"}) os.execute("dmenu_run")
end, { description = "show the menubar", group = "launcher" }),
awful.key({}, "XF86MonBrightnessUp", function()
awful.spawn("xbacklight -inc 10")
end, { description = "Brighten the screen", group = "monitor" }),
awful.key({}, "XF86MonBrightnessDown", function()
awful.spawn("xbacklight -dec 10")
end, { description = "Brighten the screen", group = "monitor" })
) )
clientkeys = gears.table.join( clientkeys = gears.table.join(
awful.key({ modkey, }, "f", awful.key({ modkey }, "f", function(c)
function (c)
c.fullscreen = not c.fullscreen c.fullscreen = not c.fullscreen
c:raise() c:raise()
end, end, { description = "toggle fullscreen", group = "client" }),
{description = "toggle fullscreen", group = "client"}), awful.key({ modkey, "Shift" }, "c", function(c)
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, c:kill()
{description = "close", group = "client"}), end, { description = "close", group = "client" }),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , awful.key(
{description = "toggle floating", group = "client"}), { modkey, "Control" },
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, "space",
{description = "move to master", group = "client"}), awful.client.floating.toggle,
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, { description = "toggle floating", group = "client" }
{description = "move to screen", group = "client"}), ),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, awful.key({ modkey, "Control" }, "Return", function(c)
{description = "toggle keep on top", group = "client"}), c:swap(awful.client.getmaster())
awful.key({ modkey, }, "n", end, { description = "move to master", group = "client" }),
function (c) awful.key({ modkey }, "o", function(c)
c:move_to_screen()
end, { description = "move to screen", group = "client" }),
awful.key({ modkey }, "t", function(c)
c.ontop = not c.ontop
end, { description = "toggle keep on top", group = "client" }),
awful.key({ modkey }, "n", function(c)
-- The client currently has the input focus, so it cannot be -- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus. -- minimized, since minimized clients can't have the focus.
c.minimized = true c.minimized = true
end , end, { description = "minimize", group = "client" }),
{description = "minimize", group = "client"}), awful.key({ modkey }, "m", function(c)
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized c.maximized = not c.maximized
c:raise() c:raise()
end , end, { description = "(un)maximize", group = "client" }),
{description = "(un)maximize", group = "client"}), awful.key({ modkey, "Control" }, "m", function(c)
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical c.maximized_vertical = not c.maximized_vertical
c:raise() c:raise()
end , end, { description = "(un)maximize vertically", group = "client" }),
{description = "(un)maximize vertically", group = "client"}), awful.key({ modkey, "Shift" }, "m", function(c)
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal c.maximized_horizontal = not c.maximized_horizontal
c:raise() c:raise()
end , end, { description = "(un)maximize horizontally", group = "client" })
{description = "(un)maximize horizontally", group = "client"})
) )
-- Bind all key numbers to tags. -- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout. -- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9. -- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do for i = 1, 9 do
globalkeys = gears.table.join(globalkeys, globalkeys = gears.table.join(
globalkeys,
-- View tag only. -- View tag only.
awful.key({ modkey }, "#" .. i + 9, awful.key({ modkey }, "#" .. i + 9, function()
function ()
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[i] local tag = screen.tags[i]
if tag then if tag then
tag:view_only() tag:view_only()
end end
end, end, { description = "view tag #" .. i, group = "tag" }),
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display. -- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, awful.key({ modkey, "Control" }, "#" .. i + 9, function()
function ()
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[i] local tag = screen.tags[i]
if tag then if tag then
awful.tag.viewtoggle(tag) awful.tag.viewtoggle(tag)
end end
end, end, { description = "toggle tag #" .. i, group = "tag" }),
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag. -- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, awful.key({ modkey, "Shift" }, "#" .. i + 9, function()
function ()
if client.focus then if client.focus then
local tag = client.focus.screen.tags[i] local tag = client.focus.screen.tags[i]
if tag then if tag then
client.focus:move_to_tag(tag) client.focus:move_to_tag(tag)
end end
end end
end, end, { description = "move focused client to tag #" .. i, group = "tag" }),
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client. -- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function()
function ()
if client.focus then if client.focus then
local tag = client.focus.screen.tags[i] local tag = client.focus.screen.tags[i]
if tag then if tag then
client.focus:toggle_tag(tag) client.focus:toggle_tag(tag)
end end
end end
end, end, { description = "toggle focused client on tag #" .. i, group = "tag" })
{description = "toggle focused client on tag #" .. i, group = "tag"})
) )
end end
clientbuttons = gears.table.join( clientbuttons = gears.table.join(
awful.button({ }, 1, function (c) awful.button({}, 1, function(c)
c:emit_signal("request::activate", "mouse_click", {raise = true}) c:emit_signal("request::activate", "mouse_click", { raise = true })
end), end),
awful.button({ modkey }, 1, function (c) awful.button({ modkey }, 1, function(c)
c:emit_signal("request::activate", "mouse_click", {raise = true}) c:emit_signal("request::activate", "mouse_click", { raise = true })
awful.mouse.client.move(c) awful.mouse.client.move(c)
end), end),
awful.button({ modkey }, 3, function (c) awful.button({ modkey }, 3, function(c)
c:emit_signal("request::activate", "mouse_click", {raise = true}) c:emit_signal("request::activate", "mouse_click", { raise = true })
awful.mouse.client.resize(c) awful.mouse.client.resize(c)
end) end)
) )
@ -489,20 +559,23 @@ root.keys(globalkeys)
-- Rules to apply to new clients (through the "manage" signal). -- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = { awful.rules.rules = {
-- All clients will match this rule. -- All clients will match this rule.
{ rule = { }, {
properties = { border_width = beautiful.border_width, rule = {},
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal, border_color = beautiful.border_normal,
focus = awful.client.focus.filter, focus = awful.client.focus.filter,
raise = true, raise = true,
keys = clientkeys, keys = clientkeys,
buttons = clientbuttons, buttons = clientbuttons,
screen = awful.screen.preferred, screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen placement = awful.placement.no_overlap + awful.placement.no_offscreen,
} },
}, },
-- Floating clients. -- Floating clients.
{ rule_any = { {
rule_any = {
instance = { instance = {
"DTA", -- Firefox addon DownThemAll. "DTA", -- Firefox addon DownThemAll.
"copyq", -- Includes session name in class. "copyq", -- Includes session name in class.
@ -518,7 +591,8 @@ awful.rules.rules = {
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui", "Wpa_gui",
"veromix", "veromix",
"xtightvncviewer"}, "xtightvncviewer",
},
-- Note that the name property shown in xprop might be set slightly after creation of the client -- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here. -- and the name shown there might not match defined rules here.
@ -529,34 +603,33 @@ awful.rules.rules = {
"AlarmWindow", -- Thunderbird's calendar. "AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config. "ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
} },
}, properties = { floating = true }}, },
properties = { floating = true },
},
-- Add titlebars to normal clients and dialogs -- Add titlebars to normal clients and dialogs
{ rule_any = {type = { "normal", "dialog" } { rule_any = { type = { "normal", "dialog" } }, properties = { titlebars_enabled = true } },
}, properties = { titlebars_enabled = true }
},
-- Set Firefox to always map on the tag named "2" on screen 1. -- Set Firefox to always map on the tag named "2" on screen 1.
-- { rule = { class = "Firefox" }, -- { rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } }, -- properties = { screen = 1, tag = "2" } },
{ rule = { class = "KeePassXC" }, properties = { screen = 1, tag = "2" } }, { rule = { class = "KeePassXC" }, properties = { screen = 1, tag = "2" } },
{ rule = { class = "bottom" }, properties = { screen = 1, tag = "9" } }, { rule = { class = "btop" }, properties = { screen = 1, tag = "9" } },
{ rule = { class = "qutebrowser" }, properties = { screen = 1, tag = "2" } }, { rule = { class = "qutebrowser" }, properties = { screen = 1, tag = "2" } },
{ rule = { class = "Alacritty" }, properties = { screen = 1, tag = "1" } }, { rule = { class = "librewolf" }, properties = { screen = 1, tag = "2" } },
{ rule = { class = "wezterm" }, properties = { screen = 1, tag = "1" } },
} }
-- }}} -- }}}
-- {{{ Signals -- {{{ Signals
-- Signal function to execute when a new client appears. -- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c) client.connect_signal("manage", function(c)
-- Set the windows at the slave, -- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master. -- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end -- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
and not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes. -- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c) awful.placement.no_offscreen(c)
end end
@ -566,40 +639,40 @@ end)
client.connect_signal("request::titlebars", function(c) client.connect_signal("request::titlebars", function(c)
-- buttons for the titlebar -- buttons for the titlebar
local buttons = gears.table.join( local buttons = gears.table.join(
awful.button({ }, 1, function() awful.button({}, 1, function()
c:emit_signal("request::activate", "titlebar", {raise = true}) c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.move(c) awful.mouse.client.move(c)
end), end),
awful.button({ }, 3, function() awful.button({}, 3, function()
c:emit_signal("request::activate", "titlebar", {raise = true}) c:emit_signal("request::activate", "titlebar", { raise = true })
awful.mouse.client.resize(c) awful.mouse.client.resize(c)
end) end)
) )
awful.titlebar(c) : setup { awful.titlebar(c):setup({
{ -- Left { -- Left
awful.titlebar.widget.iconwidget(c), awful.titlebar.widget.iconwidget(c),
buttons = buttons, buttons = buttons,
layout = wibox.layout.fixed.horizontal layout = wibox.layout.fixed.horizontal,
}, },
{ -- Middle { -- Middle
{ -- Title { -- Title
align = "center", align = "center",
widget = awful.titlebar.widget.titlewidget(c) widget = awful.titlebar.widget.titlewidget(c),
}, },
buttons = buttons, buttons = buttons,
layout = wibox.layout.flex.horizontal layout = wibox.layout.flex.horizontal,
}, },
{ -- Right { -- Right
awful.titlebar.widget.floatingbutton (c), awful.titlebar.widget.floatingbutton(c),
awful.titlebar.widget.maximizedbutton(c), awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c), awful.titlebar.widget.stickybutton(c),
awful.titlebar.widget.ontopbutton (c), awful.titlebar.widget.ontopbutton(c),
awful.titlebar.widget.closebutton (c), awful.titlebar.widget.closebutton(c),
layout = wibox.layout.fixed.horizontal() layout = wibox.layout.fixed.horizontal(),
}, },
layout = wibox.layout.align.horizontal layout = wibox.layout.align.horizontal,
} })
end) end)
-- Autostart items -- Autostart items
@ -607,9 +680,13 @@ awful.spawn.with_shell("~/.config/awesome/autorun.sh")
-- Enable sloppy focus, so that focus follows mouse. -- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c) client.connect_signal("mouse::enter", function(c)
c:emit_signal("request::activate", "mouse_enter", {raise = false}) c:emit_signal("request::activate", "mouse_enter", { raise = false })
end) end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("focus", function(c)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) c.border_color = beautiful.border_focus
end)
client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal
end)
-- }}} -- }}}

View file

@ -4,55 +4,79 @@
# #
# This script sends a canned email response to those who've errone- # This script sends a canned email response to those who've errone-
# ously emailed me at <amcooper@gmail.com>. Once I've manually # ously emailed me at <amcooper@gmail.com>. Once I've manually
# moved those emails into the `misdirected` folder, it iterates # tagged those emails `misdirected`, it iterates over those emails and
# over those emails and responds. # responds.
set -euo pipefail set -euo pipefail
MISDIRECTED_DIR=/home/adam/Maildir/misdirected if [[ -z "$(notmuch search tag:misdirected)" ]] ; then
echo "[autoreply.sh] Currently no emails are tagged 'misdirected'. Exiting..."
if [[ -z "$(ls -A "$MISDIRECTED_DIR/cur")" ]] && [[ -z "$(ls -A "$MISDIRECTED_DIR/new")" ]]; then
echo "[autoreply.sh] The misdirected folders are currently empty. Exiting..."
exit 1 exit 1
fi fi
# Handle option(s)
dry_run=
while getopts n opt ; do
printf "[debug] opt: %s\n\n" $opt
case $opt in
n) dry_run=1;;
?) echo "Usage: /path/to/autoreply.sh/ [ -n ]"
exit 2;;
esac
done
# This weird feed-find-output-into-while-loop comes from # This weird feed-find-output-into-while-loop comes from
# https://github.com/koalaman/shellcheck/wiki/SC2044#correct-code # https://github.com/koalaman/shellcheck/wiki/SC2044#correct-code
while IFS= read -r -d '' file ; do while IFS= read -r -d '' thread ; do
echo "[loop] Preparing the email..." echo "[loop] Preparing the email..."
# Make a temporary file # Make a temporary file
temporary_file=$(mktemp /tmp/autoreplyXXXXX) temporary_file=$(mktemp /tmp/autoreply-XXXXX)
echo "[debug] Temporary file: $temporary_file"
# Pull sender (i.e. recipient of my email) and subject from email # Parse out the thread-id
recipient="$(perl -lane 'print if /^From:/' "$file" | cut -d' ' -f2-)" ### "Frantz Fanon <ffanon@riseup.net>" thread_id=$(echo "$thread" | cut -f2 -d':')
subject="Re: $(perl -lane 'print if /^Subject:/' "$file" | cut -d' ' -f2-)" ### "Re: Lorem ipsum baby" echo "[debug] thread_id: $thread_id"
# Parse out the reply headers and original message body
temporary_reply=$(mktemp /tmp/notmuch-reply-XXXXX)
echo "[debug] Temporary reply: $temporary_reply"
notmuch reply --reply-to=sender --format=json thread:$thread_id > $temporary_reply
subject="$(jq -r '."reply-headers".Subject' $temporary_reply)"
sender="$(jq -r '."reply-headers".From' $temporary_reply)"
recipient="$(jq -r '."reply-headers".To' $temporary_reply)"
in_reply_to="$(jq -r '."reply-headers"."In-reply-to"' $temporary_reply)"
references="$(jq -r '."reply-headers".References' $temporary_reply)"
orig_sender="$(jq -r '.original.headers.From' $temporary_reply)"
date="$(jq -r '.original.headers.Date' $temporary_reply)"
# We have to check for multipart messages.
orig_body="$(jq -r '.original.body[] | select( ."content-type" == "text/plain" ) | .content' $temporary_reply)"
if [[ -z $orig_body ]] ; then
orig_body="$(jq -r '.original.body[] | select( ."content-type" == "multipart/alternative" ) | .content[] | select( ."content-type" == "text/plain" ) | .content' $temporary_reply)"
fi
# Copy canned message to temporary file # Copy canned message to temporary file
cp /home/adam/dotfiles/arch/bin/autoreply/misdirected_email_autoreply.txt "$temporary_file" printf "From: %s\nSubject: %s\nTo: %s\nCc: amcooper@gmail.com\nDate: $(date +'%a, %d %b %Y %R %z')\nIn-Reply-To: %s\nReferences: %s\n\n" "$sender" "$subject" "$recipient" "$in_reply_to" "$references" >> "$temporary_file"
cat /home/adam/dotfiles/bin/autoreply/misdirected_email_autoreply.txt >> "$temporary_file"
printf "\n\nOn %s, %s wrote:\n" "$date" "$orig_sender" >> "$temporary_file"
# Append email body to temporary file # Append email body to temporary file (with prefixed quote marker `> `)
discard="0" echo "$orig_body" | sed 's/^/\> /g' >> "$temporary_file"
while IFS= read -r line ; do
if [[ $discard = "1" ]]; then
echo "$line" >> "$temporary_file"
else
if [[ -z "$line" ]]; then
discard="1"
fi
fi
done < "$file"
# Send the email! # Send the email!
printf "[debug] Outgoing mail:\n%s\n" "$(cat $temporary_file)"
if [[ -z "$dry_run" ]] ; then
echo "[loop] Sending reply to $recipient ... " echo "[loop] Sending reply to $recipient ... "
neomutt -s "$subject" -c amcooper@gmail.com "$recipient" < "$temporary_file" msmtp --read-envelope-from --read-recipients <"$temporary_file"
notmuch insert --folder=Sent -inbox -unread +sent +misdirected-reply <"$temporary_file"
# Move the misdirected email into `INBOX/cur` # Remove the misdirected tag
echo "[loop] Moving the emails..." notmuch tag -misdirected -- thread:"$thread_id"
mv "$file" /home/adam/Maildir/INBOX/cur fi
echo "[loop] Done." printf "%s\n\n" "[loop] Done."
done < <(find "$MISDIRECTED_DIR" -path "$MISDIRECTED_DIR/tmp" -prune -o -type f -print0) done < <(notmuch search --output=threads --format=text0 tag:misdirected)
echo "[autoreply.sh] All done!" echo "[autoreply.sh] All done!"

10
bin/start-tuis.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
#
# start-tuis.sh
#
# Convenience script to start up my usual TUIs
wezterm cli spawn -- /home/adam/.config/nvm/versions/node/v22.12.0/bin/joplin
wezterm cli set-tab-title 'joplin'
wezterm cli spawn -- newsboat
wezterm cli spawn -- aerc

2
bin/zoom-smaller.sh Executable file
View file

@ -0,0 +1,2 @@
#! /bin/bash
QT_SCALE_FACTOR=0.8 /usr/bin/zoom &

View file

@ -74,7 +74,7 @@ next-message-on-delete=true
fuzzy-complete=true fuzzy-complete=true
stylesets-dirs=~/.config/aerc/ stylesets-dirs=~/.config/aerc/
styleset-name=dracula # styleset-name=dracula
[ui:folder=Sent] [ui:folder=Sent]
# index-format=%D %-25.25r %Z %s # index-format=%D %-25.25r %Z %s
@ -174,6 +174,29 @@ text/html=/usr/local/share/aerc/filters/html
text/*=awk -f /usr/local/share/aerc/filters/plaintext text/*=awk -f /usr/local/share/aerc/filters/plaintext
image/*=catimg -w $(tput cols) - image/*=catimg -w $(tput cols) -
[openers]
#
# Openers allow you to specify the command to use for the :open and :open-link
# actions on a per-MIME-type basis. The :open-link URL scheme is used to
# determine the MIME type as follows: x-scheme-handler/<scheme>.
#
# {} is expanded as the temporary filename or URL to be opened with proper
# shell quoting. If it is not encountered in the command, the filename/URL will
# be appended to the end of the command. The command will then be executed with
# `sh -c`.
#
# Like [filters], openers support basic shell globbing. The first opener which
# matches the part's MIME type (or URL scheme handler MIME type) will be used,
# so order them from most to least specific.
#
# Examples:
# x-scheme-handler/irc=hexchat
# x-scheme-handler/http*=printf '%s' {} | wl-copy
# text/html=surf -dfgms
# text/plain=gvim {} +125
# message/rfc822=thunderbird
text/html=librewolf
[triggers] [triggers]
# #
# Triggers specify commands to execute when certain events occur. # Triggers specify commands to execute when certain events occur.

View file

@ -1,364 +0,0 @@
HOME = os.getenv("HOME")
-- Configure the clipboard to access the "+ and "* registers
-- N.B. JavaScript copy buttons on the web do not necessarily work as expected
vim.opt.clipboard = "unnamedplus,unnamed"
-- Spaces indentation
vim.opt.expandtab = true -- converts tabs to spaces
vim.opt.tabstop = 2 -- tab equals 2 spaces
vim.opt.shiftwidth = 2 -- indent size in characters
-- Show whitespace (:list)
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
-- Show line numbers
vim.opt.number = true
-- Vertically splitting a window (:vsplit) places new window to the right
vim.opt.splitright = true
-- Highlight cursor line
vim.opt.cursorline = true
-- Enable folding
vim.opt.foldmethod = "indent"
vim.opt.foldlevel = 99
-- Terminal colors
vim.opt.termguicolors = true
-- Cursor line context
vim.opt.scrolloff = 5
-- netrw
-- This is the workspace file explorer
vim.g.netrw_winsize = 25 -- width of the file explorer
vim.g.netrw_liststyle = 3 -- tree style listing
-- Escape exits terminal mode
vim.keymap.set("t", "<Esc>", "<c-\\><c-n>", { noremap = true })
-- Sane vim split naviagation (via Gaslight blog)
vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true })
vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true })
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 })
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true })
vim.keymap.set({"i", "n", "t", "v"}, "<F10>", function () vim.cmd("nohlsearch") end)
-- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"dracula/vim",
name = "dracula",
lazy = false,
priority = 1000,
config = function ()
vim.cmd([[colorscheme dracula]])
end,
},
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
"nvimdev/lspsaga.nvim",
"nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope.nvim", branch = "0.1.x" },
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip",
"hrsh7th/cmp-nvim-lsp-signature-help",
"tpope/vim-fugitive",
"lewis6991/gitsigns.nvim",
"tpope/vim-surround",
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
}
})
require('mason').setup()
require('mason-lspconfig').setup()
require('lualine').setup {
options = { theme = 'dracula' },
tabline = {
lualine_a = { 'buffers' },
}
}
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope: find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope: live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope: buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope: help tags' })
--------------------
-- nvim-lspconfig --
--------------------
-- Setup language servers.
local lua_ls_setup = {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require('lspconfig')
lspconfig.gopls.setup {capabilities = capabilities}
lspconfig.lua_ls.setup(lua_ls_setup)
lspconfig.pyright.setup {capabilities = capabilities}
lspconfig.tsserver.setup {capabilities = capabilities}
lspconfig.rust_analyzer.setup {
-- Server-specific settings. See `:help lspconfig-setup`
capabilities = capabilities,
settings = {
['rust-analyzer'] = {},
},
}
-- Global mappings.
-- 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', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to previous' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostic: go to next' })
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic: set loclist' })
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = function(desc)
return { buffer = ev.buf, desc = desc }
end
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('LSP: go to declaration'))
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts('LSP: go to definition'))
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts('LSP: hover'))
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts('LSP: go to implementation'))
-- This setting steps on my split navigation setting, so I changed it
-- to the probably harmless F9.
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts(''))
vim.keymap.set('n', '<F9>', vim.lsp.buf.signature_help, opts('LSP: signature help'))
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts('LSP: add workspace folder'))
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts('LSP: remove workspace folder'))
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts('LSP: list workspace folder'))
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts('LSP: go to type definition'))
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts('LSP: rename token'))
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts('LSP: code action'))
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts('LSP: go to references'))
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true }
end, opts('LSP: format'))
end,
})
-- Set up nvim-cmp.
local cmp = require'cmp'
cmp.setup({
sources = {
{ name = 'nvim_lsp_signature_help' }
}
})
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
require('gitsigns').setup({
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
yadm = {
enable = false
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, {expr=true})
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, {expr=true})
-- Actions
map('n', '<leader>hs', gs.stage_hunk, { desc = 'GitSigns: stage hunk' })
map('n', '<leader>hr', gs.reset_hunk, { desc = 'GitSigns: reset hunk' })
map('v', '<leader>hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end, { desc = 'GitSigns: stage hunk' })
map('v', '<leader>hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end, { desc = 'GitSigns: reset hunk' })
map('n', '<leader>hS', gs.stage_buffer, { desc = 'GitSigns: stage buffer' })
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'GitSigns: undo stage hunk' })
map('n', '<leader>hR', gs.reset_buffer, { desc = 'GitSigns: reset_buffer' })
map('n', '<leader>hp', gs.preview_hunk, { desc = 'GitSigns: preview hunk' })
map('n', '<leader>hb', function() gs.blame_line{full=true} end, { desc = 'GitSigns: blame line' })
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'GitSigns: toggle current line blame' })
map('n', '<leader>hd', gs.diffthis, { desc = 'GitSigns: diff this' })
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = 'GitSigns: diff this' })
map('n', '<leader>td', gs.toggle_deleted, { desc = 'GitSigns: toggle deleted' })
end
})
require('lspsaga').setup()
-- Switch syntax highlighting on
vim.cmd("syntax enable")
-- Set color scheme
vim.cmd("colorscheme dracula")
-- Temporary file locations
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"

View file

@ -28,7 +28,6 @@ color listfocus_unread color238 color47 standout
color info color141 color236 color info color141 color236
confirm-exit yes confirm-exit yes
define-filter "nitter feeds" "tags !# \"nitter_personal\" and tags !# \"nitter_institutional\" and tags !# \"nitter_noise\""
feed-sort-order firsttag feed-sort-order firsttag
# Dracula highlights # Dracula highlights
@ -44,7 +43,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 -- "Play media file in mpv"
max-items 4096 max-items 4096
notify-program "/usr/bin/notify-send" notify-program "/usr/bin/notify-send"
urls-source "freshrss" urls-source "freshrss"

View file

@ -10,3 +10,10 @@ leak
leak leak
wolff wolff
baffler baffler
Assange
barrett
Barrett Brown
Bangladesh
mercenaries
guarani
rust

1
newsboat/.newsboat/queue Normal file
View file

@ -0,0 +1 @@
https://s.france24.com/media/display/1b3b9962-45d6-11ef-856d-005056a90284/w:1024/p:16x9/2024-07-12T013153Z_1056985909_RC26T8AZ5PZ7_RTRMADP_3_NATO-SUMMIT-BIDEN.JPG "/home/adam/2024-07-12T013153Z_1056985909_RC26T8AZ5PZ7_RTRMADP_3_NATO-SUMMIT-BIDEN.JPG"

View file

@ -1,7 +1,4 @@
"query:miscellany Articles:tags # \"miscellany\"" "query:miscellany Articles:tags # \"miscellany\""
"query:nitter_personal Articles:tags # \"nitter_personal\""
"query:nitter_institutional Articles:tags # \"nitter_institutional\""
"query:nitter_noise Articles:tags # \"nitter_noise\""
"query:nuggets Articles:tags # \"nuggets\"" "query:nuggets Articles:tags # \"nuggets\""
"query:podcasts Articles:tags # \"podcasts\"" "query:podcasts Articles:tags # \"podcasts\""
"query:release_notes Articles:tags # \"release_notes\"" "query:release_notes Articles:tags # \"release_notes\""

197
nvim.bak/init-dap.lua Normal file
View file

@ -0,0 +1,197 @@
local js_based_languages = { "javascript", "typescript" }
-- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
requires = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
},
"nvim-neotest/nvim-nio",
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
config = function()
local dap = require("dap")
-- local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
--[[
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
--]]
for _, language in ipairs({ "javascript", "typescript" }) do
dap.configurations[language] = {
-- Debug single nodejs files
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug nodejs processes (make sure to add --inspect when you run the process)
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug web applications (client side)
{
type = "pwa-chrome",
request = "launch",
name = "Launch & Debug Chrome",
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = "Enter URL: ",
default = "http://localhost:3000",
}, function(url)
if url == nil or url == "" then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
protocol = "inspector",
sourceMaps = true,
userDataDir = false,
},
-- Divider for the launch.json derived configs
{
name = "----- ↓ launch.json configs ↓ -----",
type = "",
request = "launch",
},
}
end
end,
keys = {
{
"<leader>da",
function()
if vim.fn.filereadable(".vscode/launch.json") then
local dap_vscode = require("dap.ext.vscode")
dap_vscode.load_launchjs(nil, {
["pwa-node"] = js_based_languages,
["chrome"] = js_based_languages,
["pwa-chrome"] = js_based_languages,
})
end
require("dap").continue()
end,
desc = "DAP: Run with Args",
},
},
dependencies = {
-- Install the vscode-js-debug adapter
{
"microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out
build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*",
},
{
"mxsdev/nvim-dap-vscode-js",
config = function()
---@diagnostic disable-next-line: missing-fields
require("dap-vscode-js").setup({
-- Path of node executable. Defaults to $NODE_PATH, and then "node"
-- node_path = "node",
-- Path to vscode-js-debug installation.
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
-- Command to use to launch the debug server. Takes precedence over "node_path" and "debugger_path"
-- debugger_cmd = { "js-debug-adapter" },
-- which adapters to register in nvim-dap
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"pwa-extensionHost",
"node-terminal",
},
-- Path for file logging
-- log_file_path = "(stdpath cache)/dap_vscode_js.log",
-- Logging level for output to file. Set to false to disable logging.
-- log_file_level = false,
-- Logging level for output to console. Set to false to disable console output.
-- log_console_level = vim.log.levels.ERROR,
})
end,
},
{
"Joakker/lua-json5",
build = "./install.sh",
},
},
},
{ "leoluz/nvim-dap-go", event = "VeryLazy" },
{ "williamboman/mason.nvim", event = "VeryLazy" },
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
})
--[[ mason
Mason manages external editor plugins such as LSP servers, DAP servers,
linters, and formatters. There are further recommended plugins for better
integration.
--]]
require('mason').setup()
require('mason-lspconfig').setup()
require('dap-go').setup()
local dap, dapui = require("dap"), require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- Switch syntax highlighting on
vim.cmd("syntax enable")

841
nvim.bak/init.lua Normal file
View file

@ -0,0 +1,841 @@
HOME = os.getenv("HOME")
-- Configure the clipboard to access the "+ and "* registers
-- N.B. JavaScript copy buttons on the web do not necessarily work as expected
vim.opt.clipboard = "unnamedplus,unnamed"
-- Spaces indentation
vim.opt.expandtab = true -- converts tabs to spaces
vim.opt.tabstop = 4 -- tab equals 4 spaces
vim.opt.shiftwidth = 4 -- indent size in characters
-- Show whitespace (:list)
vim.opt.listchars = "eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·"
-- Show line numbers
vim.opt.number = true
-- Vertically splitting a window (:vsplit) places new window to the right
vim.opt.splitright = true
-- Highlight cursor line
vim.opt.cursorline = true
-- Enable folding
vim.opt.foldmethod = "syntax"
vim.opt.foldlevel = 5
-- Enable 24-bit RGB color in the TUI
vim.opt.termguicolors = true
-- Minimal number of lines kept above and below the cursor
vim.opt.scrolloff = 5
-- Turn off highlight search
vim.opt.hlsearch = false
-- Temporary file locations
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
-- netrw
-- This is the workspace file explorer
vim.g.netrw_winsize = 25 -- width of the file explorer
vim.g.netrw_liststyle = 3 -- tree style listing
-- Sane vim split naviagation (via Gaslight blog)
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, desc = 'Go to window above' })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' })
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
-- TODO: This seems not to work for netrw.
vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' })
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(
{ "n", "t" },
"<leader>z",
function()
-- This restores the UI to the saved layout 'idelayout' (if it exists)
if vim.fn.exists("idelayout") ~= 0 then
vim.cmd("exec idelayout")
end
end,
{ desc = "Revert window layout" }
)
local terminalgroup = vim.api.nvim_create_augroup("TerminalGroup", { clear = true })
vim.api.nvim_create_autocmd(
{ "TermOpen", "TermEnter" },
{
group = terminalgroup,
pattern = "*",
command = "set nonumber"
}
)
-- lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local js_based_languages = { "javascript", "typescript" }
require("lazy").setup({
{
"afair/vibrantink2",
priority = 1000,
config = function()
vim.cmd.colorscheme("vibrantink2")
end
},
"nvim-lualine/lualine.nvim",
"nvim-tree/nvim-web-devicons",
{ "echasnovski/mini.nvim", version = false },
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
"neovim/nvim-lspconfig",
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},
{
"folke/which-key.nvim",
event = "VeryLazy",
-- init = function()
-- vim.o.timeout = true
-- -- N.B. Setting `timeoutlen` to 0 seems to break the plugin
-- vim.o.timeoutlen = 300 -- 0? 500? 300?
-- end,
opts = {
win = {
border = "single",
},
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
},
{
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {},
config = function(_, opts) require 'lsp_signature'.setup(opts) end
},
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "luvit-meta/library", words = { "vim%.uv" } },
},
},
},
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
{ -- optional completion source for require statements and module annotations
"hrsh7th/nvim-cmp",
opts = function(_, opts)
opts.sources = opts.sources or {}
table.insert(opts.sources, {
name = "lazydev",
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
})
end,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-vsnip",
"hrsh7th/vim-vsnip",
"hrsh7th/cmp-nvim-lsp-signature-help",
},
},
{
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
config = function()
local dap = require("dap")
-- local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
--[[
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
--]]
for _, language in ipairs({ "javascript", "typescript" }) do
dap.configurations[language] = {
-- Debug single nodejs files
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug nodejs processes (make sure to add --inspect when you run the process)
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = vim.fn.getcwd(),
sourceMaps = true,
},
-- Debug web applications (client side)
{
type = "pwa-chrome",
request = "launch",
name = "Launch & Debug Chrome",
url = function()
local co = coroutine.running()
return coroutine.create(function()
vim.ui.input({
prompt = "Enter URL: ",
default = "http://localhost:3000",
}, function(url)
if url == nil or url == "" then
return
else
coroutine.resume(co, url)
end
end)
end)
end,
webRoot = vim.fn.getcwd(),
protocol = "inspector",
sourceMaps = true,
userDataDir = false,
},
-- Divider for the launch.json derived configs
{
name = "----- ↓ launch.json configs ↓ -----",
type = "",
request = "launch",
},
}
end
end,
keys = {
{
"<leader>dO",
function()
require("dap").step_out()
end,
desc = "DAP: Step Out",
},
{
"<leader>do",
function()
require("dap").step_over()
end,
desc = "DAP: Step Over",
},
{
"<leader>db",
function()
require("dap").toggle_breakpoint()
end,
desc = "DAP: Toggle breakpoint",
},
{
"<leader>dc",
function()
require("dap").continue()
end,
desc = "DAP: Continue",
},
{
"<leader>di",
function()
require("dap").step_into()
end,
desc = "DAP: Step Into",
},
{
"<leader>da",
function()
if vim.fn.filereadable(".vscode/launch.json") then
local dap_vscode = require("dap.ext.vscode")
dap_vscode.load_launchjs(nil, {
["pwa-node"] = js_based_languages,
["chrome"] = js_based_languages,
["pwa-chrome"] = js_based_languages,
})
end
require("dap").continue()
end,
desc = "DAP: Run with Args",
},
},
dependencies = {
-- Install the vscode-js-debug adapter
{
"microsoft/vscode-js-debug",
-- After install, build it and rename the dist directory to out
build =
"npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out",
version = "1.*",
},
{
"mxsdev/nvim-dap-vscode-js",
config = function()
---@diagnostic disable-next-line: missing-fields
require("dap-vscode-js").setup({
-- Path of node executable. Defaults to $NODE_PATH, and then "node"
-- node_path = "node",
-- Path to vscode-js-debug installation.
debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"),
-- Command to use to launch the debug server. Takes precedence over "node_path" and "debugger_path"
-- debugger_cmd = { "js-debug-adapter" },
-- which adapters to register in nvim-dap
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"pwa-extensionHost",
"node-terminal",
},
-- Path for file logging
-- log_file_path = "(stdpath cache)/dap_vscode_js.log",
-- Logging level for output to file. Set to false to disable logging.
-- log_file_level = false,
-- Logging level for output to console. Set to false to disable console output.
-- log_console_level = vim.log.levels.ERROR,
})
end,
},
{
"Joakker/lua-json5",
build = "./install.sh",
},
},
},
{ "leoluz/nvim-dap-go", event = "VeryLazy" },
{ "williamboman/mason.nvim", event = "VeryLazy" },
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
{ "nvimdev/lspsaga.nvim", event = "VeryLazy" },
{
"nvim-telescope/telescope.nvim",
event = "VeryLazy",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build =
"cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
},
},
},
{ "tpope/vim-fugitive", event = "VeryLazy" },
{ "lewis6991/gitsigns.nvim", event = "VeryLazy" },
{
"pwntester/octo.nvim",
requires = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("octo").setup()
end,
event = "VeryLazy",
},
{ "famiu/bufdelete.nvim", event = "VeryLazy" },
-- { "vlime/vlime", config = function() rtp = 'vim/' end },
--[[
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = true,
-- use opts = {} for passing setup options
-- this is equalent to setup({}) function
},
--]]
--{ "bhurlow/vim-parinfer", event = "VeryLazy" },
{ "kovisoft/paredit" },
--{ "monkoose/parsley", event = "VeryLazy" },
{ "monkoose/nvlime", ft = { "lisp" }, dependencies = { "monkoose/parsley" } },
{
'MeanderingProgrammer/markdown.nvim',
-- name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim
dependencies = {
'nvim-treesitter/nvim-treesitter', -- Mandatory
'nvim-tree/nvim-web-devicons', -- Optional but recommended
},
config = function()
require('render-markdown').setup({})
end,
},
{ "jparise/vim-graphql" },
})
--[[ mason
Mason manages external editor plugins such as LSP servers, DAP servers,
linters, and formatters. There are further recommended plugins for better
integration.
--]]
require('mason').setup()
require('mason-lspconfig').setup()
--[[ lualine
Lualine provides the status bar as well as the tabline.
--]]
require('lualine').setup {
options = { theme = 'dracula' },
tabline = {
lualine_a = {
{
'buffers',
mode = 4,
},
},
},
}
--[[ Telescope
Telescope provides lists, pickers, etc. This section includes just the
functions bound to keymaps.
--]]
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope: find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope: live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope: buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope: help tags' })
require "lsp_signature".setup()
--[[ nvim-cmp
nvim-cmp is a text completion engine.
]]
local cmp = require 'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
}, {
{ name = 'buffer' },
{ name = 'nvim_lsp_signature_help' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
--[[ nvim-lspconfig
--]]
-- Setup language servers.
local lua_ls_setup = {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local lspconfig = require('lspconfig')
lspconfig.gopls.setup { capabilities = capabilities }
lspconfig.lua_ls.setup(lua_ls_setup)
lspconfig.pyright.setup { capabilities = capabilities }
-- lspconfig.tsserver.setup { capabilities = capabilities }
lspconfig.ts_ls.setup { capabilities = capabilities }
lspconfig.rust_analyzer.setup {
-- Server-specific settings. See `:help lspconfig-setup`
capabilities = capabilities,
settings = {
['rust-analyzer'] = {},
},
}
-- Enable (broadcasting) snippet capability for completion
local capabilities_html = vim.lsp.protocol.make_client_capabilities()
capabilities_html.textDocument.completion.completionItem.snippetSupport = true
require 'lspconfig'.html.setup {
capabilities = capabilities_html,
}
-- Global mappings : Diagnostics
-- 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', '[d', vim.diagnostic.goto_prev, { desc = 'Diagnostic: go to previous' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Diagnostic: go to next' })
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, { desc = 'Diagnostic: set loclist' })
-- Add a border to LSP windows
local _border = "single"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover, {
border = _border
}
)
-- TODO: Is this necessary? Or is signature help being handled with LSPSaga?
--[[
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, {
border = _border
}
)
--]]
vim.diagnostic.config {
float = { border = _border, max_width = 120 }
}
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = function(desc)
return { buffer = ev.buf, desc = desc }
end
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('LSP: go to declaration'))
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts('LSP: go to definition'))
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts('LSP: hover'))
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts('LSP: go to implementation'))
-- This setting steps on my split navigation setting, so I changed it
-- to the probably harmless F9.
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts(''))
vim.keymap.set('n', '<F9>', vim.lsp.buf.signature_help, opts('LSP: signature help'))
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts('LSP: add workspace folder'))
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts('LSP: remove workspace folder'))
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts('LSP: list workspace folder'))
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts('LSP: go to type definition'))
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts('LSP: rename token'))
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts('LSP: code action'))
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts('LSP: go to references'))
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true }
end, opts('LSP: format'))
end,
})
require('gitsigns').setup({
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
-- [2024-09-10] This is invalid, suddenly.
-- yadm = { enable = false },
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, { expr = true, desc = 'GitSigns: go to next hunk' })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, { expr = true, desc = 'GitSigns: go to previous hunk' })
-- Actions
map('n', '<leader>hs', gs.stage_hunk, { desc = 'GitSigns: stage hunk' })
map('n', '<leader>hr', gs.reset_hunk, { desc = 'GitSigns: reset hunk' })
map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
{ desc = 'GitSigns: stage hunk' })
map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
{ desc = 'GitSigns: reset hunk' })
map('n', '<leader>hS', gs.stage_buffer, { desc = 'GitSigns: stage buffer' })
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'GitSigns: undo stage hunk' })
map('n', '<leader>hR', gs.reset_buffer, { desc = 'GitSigns: reset_buffer' })
map('n', '<leader>hp', gs.preview_hunk, { desc = 'GitSigns: preview hunk' })
map('n', '<leader>hb', function() gs.blame_line { full = true } end, { desc = 'GitSigns: blame line' })
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'GitSigns: toggle current line blame' })
map('n', '<leader>hd', gs.diffthis, { desc = 'GitSigns: diff this' })
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = 'GitSigns: diff this' })
map('n', '<leader>td', gs.toggle_deleted, { desc = 'GitSigns: toggle deleted' })
end
})
--[[
-- LSPSaga : provides a diverse basket of utilities
--]]
require('lspsaga').setup({
beacon = {
enable = true,
frequency = 7,
}
})
vim.keymap.set('n', '<leader>si', '<cmd>Lspsaga incoming_calls<CR>')
vim.keymap.set('n', '<leader>so', '<cmd>Lspsaga outgoing_calls<CR>')
vim.keymap.set('n', '<leader>ca', '<cmd>Lspsaga code_action<CR>')
vim.keymap.set('n', '<leader>sd', '<cmd>Lspsaga peek_definition<CR>')
vim.keymap.set('n', '<leader>sp', '<cmd>Lspsaga peek_type_definition<CR>')
vim.keymap.set('n', '<leader>sx', '<cmd>Lspsaga goto_definition<CR>')
vim.keymap.set('n', '<leader>sg', '<cmd>Lspsaga goto_type_definition<CR>')
vim.keymap.set('n', '[e', '<cmd>Lspsaga diagnostic_jump_prev<CR>')
vim.keymap.set('n', ']e', '<cmd>Lspsaga diagnostic_jump_next<CR>')
vim.keymap.set('n', '<leader>sK', '<cmd>Lspsaga hover_doc<CR>')
vim.keymap.set('n', '<leader>sm', '<cmd>Lspsaga finder imp<CR>')
vim.keymap.set('n', '<leader>sf', '<cmd>Lspsaga finder<CR>')
vim.keymap.set('n', '<leader>sl', '<cmd>Lspsaga outline<CR>')
vim.keymap.set('n', '<leader>rn', '<cmd>Lspsaga rename<CR>')
vim.keymap.set('n', '<leader>st', '<cmd>Lspsaga term_toggle<CR>')
require('dap-go').setup()
local dap, dapui = require("dap"), require("dapui")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- Handlebars: One way to get syntax highlighting in Handlebars files
--[[
local syntax_highlighting_tweaks = vim.api.nvim_create_augroup("SyntaxHighlightingTweaks", { clear = true })
vim.api.nvim_create_autocmd(
{ "BufRead", "BufNewFile" },
{
group = syntax_highlighting_tweaks,
pattern = "*.hbs",
command = "set filetype=html"
}
)
--]]
-- Treesitter
require('nvim-treesitter.configs').setup({
modules = {},
highlight = {
enable = true,
loaded = true,
module_path = "nvim-treesitter.highlight",
additional_vim_regex_highlighting = true,
},
indent = {
enable = true,
module_path = "nvim-treesitter.indent",
},
ensure_installed = { "bash", "comment", "go", "html", "javascript", "json", "kdl", "lua", "python", "typescript", "yaml" },
sync_install = false,
auto_install = false,
ignore_install = {},
})
vim.treesitter.language.register("html", "handlebars")
require('mini.icons').setup()
-- Tweak GitSigns blame color
-- This differentiates the cursorline from the git blame text
vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944")
vim.cmd("highlight NonText gui=bold guifg=#999999")
--[[
Resolve conflict between fugitive and LSPSaga, wherein the latter's
breadcrumbs cause a mismatch between the buffer and fugitive's :Git blame
window and :Gvdiffsplit window(s). To kill the winbar (the top line where
the breadcrumbs and this blame title live), enter `:set winbar&`.
--]]
local blamegroup = vim.api.nvim_create_augroup("fugitiveSagaBlameConflict", { clear = true })
vim.api.nvim_create_autocmd(
'FileType',
{
group = blamegroup,
pattern = 'fugitiveblame',
callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' })
end,
}
)
local diffgroup = vim.api.nvim_create_augroup("fugitiveSagaDiffConflict", { clear = true })
vim.api.nvim_create_autocmd(
'BufReadCmd',
{
group = diffgroup,
pattern = "fugitive://*",
callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' })
end,
}
)
--[[
let g:nvlime_cl_impl = "ros"
function! NvlimeBuildServerCommandFor_ros(nvlime_loader, nvlime_eval)
return ["ros", "run",
\ "--load", a:nvlime_loader,
\ "--eval", a:nvlime_eval]
endfunction
--]]
-- Roswell
vim.g.nvlime_cl_impl = "ros"
vim.cmd([[
function! NvlimeBuildServerCommandFor_ros(nvlime_loader, nvlime_eval)
return ["ros", "run",
\ "--load", a:nvlime_loader,
\ "--eval", a:nvlime_eval]
endfunction
]])
-- Switch syntax highlighting on
vim.cmd("syntax enable")

8
nvim/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

15
nvim/.neoconf.json Normal file
View file

@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

201
nvim/LICENSE Normal file
View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4
nvim/README.md Normal file
View file

@ -0,0 +1,4 @@
# 💤 LazyVim
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.

2
nvim/init.lua Normal file
View file

@ -0,0 +1,2 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

166
nvim/lazy-lock.json Normal file
View file

@ -0,0 +1,166 @@
{
"LazyVim": {
"branch": "main",
"commit": "45d94b3197eaf3f35754b8ecb7adebfcebe5160d"
},
"SchemaStore.nvim": {
"branch": "main",
"commit": "97b08f928d355bd6d5dee595fdf667b5bfb6329f"
},
"blink.cmp": {
"branch": "main",
"commit": "b6f11a0aa33e601c469a126e3ed6e35208fe3ea3"
},
"bufferline.nvim": {
"branch": "main",
"commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3"
},
"catppuccin": {
"branch": "main",
"commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063"
},
"conform.nvim": {
"branch": "master",
"commit": "8ed162b0637d4c4f69ebe3e8e49b35662a82e137"
},
"crates.nvim": {
"branch": "main",
"commit": "1d92a7f449a2a76d8f4c3459bd98f450e76d2ea3"
},
"flash.nvim": {
"branch": "main",
"commit": "3c942666f115e2811e959eabbdd361a025db8b63"
},
"friendly-snippets": {
"branch": "main",
"commit": "efff286dd74c22f731cdec26a70b46e5b203c619"
},
"gitsigns.nvim": {
"branch": "main",
"commit": "2bc3b472bbc2484214549af4d9f38c127b886a55"
},
"grug-far.nvim": {
"branch": "main",
"commit": "3a8690461afac34c0e5bacb0f7b4bc3066aab665"
},
"lazy.nvim": {
"branch": "main",
"commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3"
},
"lazydev.nvim": {
"branch": "main",
"commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc"
},
"lualine.nvim": {
"branch": "master",
"commit": "f4f791f67e70d378a754d02da068231d2352e5bc"
},
"markdown-preview.nvim": {
"branch": "master",
"commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee"
},
"mason-lspconfig.nvim": {
"branch": "main",
"commit": "a8e6efcf623b86bae6d2223eede7c43883329f80"
},
"mason.nvim": {
"branch": "main",
"commit": "e2f7f9044ec30067bc11800a9e266664b88cda22"
},
"mini.ai": {
"branch": "main",
"commit": "6e01c0e5a15554852546fac9853960780ac52ed4"
},
"mini.icons": {
"branch": "main",
"commit": "ec61af6e606fc89ee3b1d8f2f20166a3ca917a36"
},
"mini.pairs": {
"branch": "main",
"commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918"
},
"mini.surround": {
"branch": "main",
"commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb"
},
"noice.nvim": {
"branch": "main",
"commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59"
},
"nui.nvim": {
"branch": "main",
"commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46"
},
"nvim-lint": {
"branch": "master",
"commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8"
},
"nvim-lspconfig": {
"branch": "master",
"commit": "31226f6736a8150e323b346e4748e3c9bdd6bef5"
},
"nvim-treesitter": {
"branch": "master",
"commit": "80e6de9d24eec68d82d5f4e6feae94c9c753ebd6"
},
"nvim-treesitter-textobjects": {
"branch": "master",
"commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595"
},
"nvim-ts-autotag": {
"branch": "main",
"commit": "1cca23c9da708047922d3895a71032bc0449c52d"
},
"nvlime": {
"branch": "master",
"commit": "228e4fa8c7d10b1ed07b1649a63743613b77a828"
},
"paredit": {
"branch": "master",
"commit": "60203e50698ed2211b4434a66ab2258a1a6ac3b5"
},
"parsley": {
"branch": "main",
"commit": "c4100aa449bfa971dcfc56ffe4206ba034db08cc"
},
"persistence.nvim": {
"branch": "main",
"commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d"
},
"plenary.nvim": {
"branch": "master",
"commit": "857c5ac632080dba10aae49dba902ce3abf91b35"
},
"render-markdown.nvim": {
"branch": "main",
"commit": "e05a9f22f31c088ece3fa5928daf546a015b66ee"
},
"rustaceanvim": {
"branch": "master",
"commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39"
},
"snacks.nvim": {
"branch": "main",
"commit": "eb81468b475f6251f5850ae956e19547e8f533ec"
},
"todo-comments.nvim": {
"branch": "main",
"commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5"
},
"tokyonight.nvim": {
"branch": "main",
"commit": "84ea0b5f4651afdf50ececaf6f110fe9d9dc9458"
},
"trouble.nvim": {
"branch": "main",
"commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3"
},
"ts-comments.nvim": {
"branch": "main",
"commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74"
},
"which-key.nvim": {
"branch": "main",
"commit": "0e76a87ac51772569aec678dc74baa8e2a86100c"
}
}

17
nvim/lazyvim.json Normal file
View file

@ -0,0 +1,17 @@
{
"extras": [
"lazyvim.plugins.extras.coding.mini-surround",
"lazyvim.plugins.extras.lang.git",
"lazyvim.plugins.extras.lang.go",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.rust",
"lazyvim.plugins.extras.lang.toml",
"lazyvim.plugins.extras.lang.yaml",
"lazyvim.plugins.extras.vscode"
],
"news": {
"NEWS.md": "10960"
},
"version": 8
}

View file

@ -0,0 +1,8 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--
-- Add any additional autocmds here
-- with `vim.api.nvim_create_autocmd`
--
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")

View file

@ -0,0 +1,3 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

53
nvim/lua/config/lazy.lua Normal file
View file

@ -0,0 +1,53 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View file

@ -0,0 +1,4 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
vim.g.mapleader = "\\"

View file

@ -0,0 +1,30 @@
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
-- N.B. I could restore neo-tree and/or mini-starter
return {
"kovisoft/paredit",
{
"monkoose/nvlime",
event = "VeryLazy",
dependencies = {
"monkoose/parsley",
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}

View file

@ -0,0 +1,211 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}

3
nvim/stylua.toml Normal file
View file

@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120

View file

@ -82,7 +82,8 @@ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'dense-analysis/ale' Plug 'dense-analysis/ale'
Plug 'Valloric/YouCompleteMe' " Disabling YCM as it's a little broken at the moment
" Plug 'Valloric/YouCompleteMe'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' } Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'pangloss/vim-javascript' Plug 'pangloss/vim-javascript'
Plug 'MaxMEllon/vim-jsx-pretty' Plug 'MaxMEllon/vim-jsx-pretty'

View file

@ -2,31 +2,16 @@
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.config/local/share" export XDG_DATA_HOME="$HOME/.config/local/share"
export XDG_CACHE_HOME="$HOME/.config/cache" export XDG_CACHE_HOME="$HOME/.config/cache"
export XDG_STATE_HOME="$HOME/.config/local/state"
export ZDOTDIR="$XDG_CONFIG_HOME/zsh" export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export HISTSIZE=9998 export HISTSIZE=9998
export SAVEHIST=10000 export SAVEHIST=10000
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.cargo/env:$HOME/code/go/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.rbenv:$PATH" export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.cargo/env:$HOME/code/go/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:/usr/sbin:/sbin:$PATH"
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
export EDITOR="nvim" export EDITOR="nvim"
export VISUAL="nvim" export VISUAL="nvim"
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# FZF # FZF
export FZF_DEFAULT_COMMAND="fd --no-ignore --hidden --type f" # Includes hidden files export FZF_DEFAULT_COMMAND="fd --no-ignore --hidden --type f" # Includes hidden files
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
@ -34,13 +19,25 @@ export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# exa colors # exa colors
export LS_COLORS="rs=0:fi=35:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*.md=36" export LS_COLORS="rs=0:fi=35:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*.md=36"
# ddgr # bat colors
export BROWSER=w3m export BAT_THEME="Coldark-Dark"
export DDGR_COLORS="MBdexy"
export BROWSER=cha
# navi # navi
export NAVI_TAG_COLOR=6 export NAVI_TAG_COLOR=6
export NAVI_COMMENT_COLOR=3 export NAVI_COMMENT_COLOR=3
# gomphotherium
export GOMPHOTHERIUM_SERVER='https://toot.cat'
export GOMPHOTHERIUM_ACCESS_TOKEN='qqscVpLBugWAv6cFUqu1vBm0QMbgsWTiafg7TwZsTec'
# roswell
export ROSWELL_HOME="/home/adam/.config/roswell"
# Consolidate PATH # Consolidate PATH
# export PATH="$(consolidate-path "$PATH")" export PATH="$(consolidate-path "$PATH")"
# rover
source "/home/adam/.rover/env"
export APOLLO_TELEMETRY_DISABLED=1

View file

@ -140,9 +140,8 @@ source /home/adam/.config/broot/launcher/bash/br
# tea # tea
PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/adam/.config/tea/autocomplete.zsh" PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/adam/.config/tea/autocomplete.zsh"
# gomphotherium # leetcode
export GOMPHOTHERIUM_SERVER='https://toot.cat' eval "$(leetcode completions)"
export GOMPHOTHERIUM_ACCESS_TOKEN='qqscVpLBugWAv6cFUqu1vBm0QMbgsWTiafg7TwZsTec'
# ripgrep-all # ripgrep-all
rga-fzf() { rga-fzf() {