Compare commits
10
Commits
1e52cbdf84
...
75d1a926ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75d1a926ad | ||
|
|
387a3d48c2 | ||
|
|
d66c2ed51a | ||
|
|
3dff0a83af | ||
|
|
1f87904720 | ||
|
|
68b3637c8a | ||
|
|
a9496445d9 | ||
|
|
a27b3c9e96 | ||
|
|
7dcf80b5e9 | ||
|
|
eaebac49df |
@@ -0,0 +1,34 @@
|
||||
[user]
|
||||
name = Bartal Laearsson
|
||||
email = bartal@flo.fo
|
||||
signingkey = ~/.ssh/id_ed25519.pub
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[tag]
|
||||
gpgsign = true
|
||||
[gpg]
|
||||
format = ssh
|
||||
[gpg "ssh"]
|
||||
allowedSignersFile = ~/.ssh/allowed_signers
|
||||
[core]
|
||||
editor = nvim
|
||||
autocrlf = input
|
||||
[pull]
|
||||
rebase = true
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[merge]
|
||||
conflictstyle = diff3
|
||||
[diff]
|
||||
colorMoved = zebra
|
||||
|
||||
[credential]
|
||||
helper = store
|
||||
[credential "https://git.public.fl%C3%B3.fo"]
|
||||
helper =
|
||||
helper = !tea login helper
|
||||
[credential "https://git.public.xn--fl-6ja.fo"]
|
||||
helper =
|
||||
helper = !tea login helper
|
||||
+127
-102
@@ -174,110 +174,135 @@ require("lazy").setup({
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
||||
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
|
||||
if client and client:supports_method("textDocument/documentHighlight", event.buf) then
|
||||
local highlight_augroup =
|
||||
vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = "kickstart-lsp-highlight",
|
||||
buffer = event2.buf,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
if client and client:supports_method("textDocument/inlayHint", event.buf) then
|
||||
map("<leader>th", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||
end, "[T]oggle Inlay [H]ints")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local servers = {
|
||||
clangd = {},
|
||||
zls = {},
|
||||
gopls = {},
|
||||
rust_analyzer = {},
|
||||
omnisharp = {},
|
||||
jdtls = {},
|
||||
|
||||
ts_ls = {},
|
||||
|
||||
lua_ls = {
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
path ~= vim.fn.stdpath("config")
|
||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||
then
|
||||
return
|
||||
end
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = { "lua/?.lua", "lua/?/init.lua" },
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = vim.tbl_extend("force", vim.api.nvim_get_runtime_file("", true), {
|
||||
"${3rd}/luv/library",
|
||||
"${3rd}/busted/library",
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
},
|
||||
}
|
||||
map("grn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
map("gra", vim.lsp.buf.code_action, "[G]oto Code [A]ction", { "n", "x" })
|
||||
map("grD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
|
||||
for name, server in pairs(servers) do
|
||||
vim.lsp.config(name, server)
|
||||
vim.lsp.enable(name)
|
||||
end
|
||||
end,
|
||||
},
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
|
||||
if client and client:supports_method("textDocument/documentHighlight", event.buf) then
|
||||
local highlight_augroup =
|
||||
vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = "kickstart-lsp-highlight",
|
||||
buffer = event2.buf,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
if client and client:supports_method("textDocument/inlayHint", event.buf) then
|
||||
map("<leader>th", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||
end, "[T]oggle Inlay [H]ints")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local servers = {
|
||||
clangd = {},
|
||||
zls = {},
|
||||
gopls = {},
|
||||
rust_analyzer = {},
|
||||
omnisharp = {},
|
||||
jdtls = {},
|
||||
|
||||
ts_ls = {},
|
||||
|
||||
lua_ls = {
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
path ~= vim.fn.stdpath("config")
|
||||
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
path = { "lua/?.lua", "lua/?/init.lua" },
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = vim.tbl_extend("force", vim.api.nvim_get_runtime_file("", true), {
|
||||
"${3rd}/luv/library",
|
||||
"${3rd}/busted/library",
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, server in pairs(servers) do
|
||||
vim.lsp.config(name, server)
|
||||
vim.lsp.enable(name)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = {
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod", "gowork", "gotmpl" },
|
||||
build = ':lua require("go.install").update_all_sync()',
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("go").setup(opts)
|
||||
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", { clear = true })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require("go.format").goimports()
|
||||
end,
|
||||
group = format_sync_grp,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
@@ -383,6 +408,7 @@ require("lazy").setup({
|
||||
config = function()
|
||||
require("mini.ai").setup({ n_lines = 500 })
|
||||
require("mini.surround").setup()
|
||||
require("mini.pairs").setup()
|
||||
local statusline = require("mini.statusline")
|
||||
statusline.setup({ use_icons = vim.g.have_nerd_font })
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
@@ -487,4 +513,3 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
|
||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "6f793b2bcd2d35e201c09520f698bb763220908a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
|
||||
"go.nvim": { "branch": "master", "commit": "0768d79bbebdb1a112a845f9cd6293bfbd544dab" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
|
||||
"guihua.lua": { "branch": "master", "commit": "4c513d5dac550af77034cced421967b393261509" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"mini.nvim": { "branch": "main", "commit": "db41c4076105a63caec12612d11228348f55a109" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "2c227d59589957fa4404b7de5f61d72c0a78a62d" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "09d1324e264c6950262dbe02a9bce2933a6800db" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# Sway workstation configuration translated from NixOS behavior.
|
||||
set $mod Mod4
|
||||
set $term foot -e tmux new-session -A -s main
|
||||
set $browser zen
|
||||
set $browser brave-origin
|
||||
set $menu rofi -show drun
|
||||
|
||||
font pango:DejaVu Sans Mono 10
|
||||
@@ -9,6 +9,10 @@ font pango:DejaVu Sans Mono 10
|
||||
output * scale 1
|
||||
output * bg ~/.config/sway/tux.png fill
|
||||
|
||||
# Disable the laptop panel while the lid is closed.
|
||||
bindswitch --reload lid:on exec ~/.config/sway/scripts/lid-output off
|
||||
bindswitch --reload lid:off exec ~/.config/sway/scripts/lid-output on
|
||||
|
||||
input type:keyboard {
|
||||
xkb_layout fo
|
||||
xkb_model pc105
|
||||
@@ -22,8 +26,8 @@ input type:touchpad {
|
||||
gaps inner 5
|
||||
gaps outer 10
|
||||
smart_gaps on
|
||||
default_border pixel 2
|
||||
default_floating_border pixel 2
|
||||
default_border none
|
||||
default_floating_border none
|
||||
|
||||
client.focused #33ccff #33ccff #1a1b26 #33ccff #33ccff
|
||||
client.focused_inactive #595959 #595959 #c0caf5 #595959 #595959
|
||||
@@ -31,6 +35,8 @@ client.unfocused #595959 #595959 #c0caf5 #595959 #595959
|
||||
|
||||
floating_modifier $mod normal
|
||||
|
||||
exec /usr/local/bin/pcloud
|
||||
|
||||
# Applications and session
|
||||
bindsym $mod+t exec $term
|
||||
bindsym $mod+b exec $browser
|
||||
@@ -115,4 +121,3 @@ exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSO
|
||||
exec /usr/libexec/lxqt-policykit-agent
|
||||
exec nm-applet --indicator
|
||||
exec mako
|
||||
exec ~/.config/waybar/launch.sh
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
state="${1:-}"
|
||||
|
||||
internal_output="$(
|
||||
swaymsg -t get_outputs -r |
|
||||
jq -r '.[] | select(.name | test("^(eDP|LVDS)")) | .name' |
|
||||
head -n 1
|
||||
)"
|
||||
|
||||
if [ -z "$internal_output" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$state" in
|
||||
off) swaymsg output "$internal_output" disable ;;
|
||||
on) swaymsg output "$internal_output" enable ;;
|
||||
*) exit 2 ;;
|
||||
esac
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"height": 34,
|
||||
"margin-top": 8,
|
||||
"margin-left": 0,
|
||||
"margin-right": 0,
|
||||
|
||||
"modules-left": ["sway/workspaces", "sway/window"],
|
||||
"modules-center": ["clock"],
|
||||
"modules-right": ["pulseaudio", "network", "battery", "tray"],
|
||||
|
||||
"sway/workspaces": {
|
||||
"all-outputs": true,
|
||||
"disable-scroll": true,
|
||||
"format": "{name}"
|
||||
},
|
||||
|
||||
"sway/window": {
|
||||
"max-length": 40
|
||||
},
|
||||
|
||||
"clock": {
|
||||
"format": "{:%a %b %d %I:%M %p}"
|
||||
},
|
||||
|
||||
"battery": {
|
||||
"format": "{capacity}%"
|
||||
},
|
||||
|
||||
"network": {
|
||||
"format-wifi": "wifi {essid}",
|
||||
"format-ethernet": "wired",
|
||||
"format-disconnected": "offline",
|
||||
"on-click": "nm-connection-editor"
|
||||
},
|
||||
|
||||
"pulseaudio": {
|
||||
"format": "vol {volume}%",
|
||||
"format-muted": "muted",
|
||||
"on-click": "pavucontrol"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/waybar"
|
||||
base_config="$config_dir/config"
|
||||
runtime_config="$config_dir/config.runtime"
|
||||
|
||||
width=$(swaymsg -r -t get_outputs | jq -r '[.[] | select(.focused)][0] // .[0] // {rect: {width: 1440}} | .rect.width // 1440')
|
||||
|
||||
if ! [[ "$width" =~ ^[0-9]+$ ]] || (( width == 0 )); then
|
||||
width=1440
|
||||
fi
|
||||
|
||||
margin=$((width * 125 / 1000))
|
||||
jq --argjson margin "$margin" '
|
||||
.["margin-left"] = $margin
|
||||
| .["margin-right"] = $margin
|
||||
' "$base_config" > "$runtime_config"
|
||||
|
||||
exec waybar -c "$runtime_config"
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
@import "themes/current.css";
|
||||
|
||||
* {
|
||||
font-family: "DejaVu Sans Mono", monospace;
|
||||
font-size: 13px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: @bar-bg;
|
||||
color: @text;
|
||||
border-radius: 18px;
|
||||
border: 1px solid @border;
|
||||
}
|
||||
|
||||
window#waybar > box {
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#workspaces label {
|
||||
padding: 0 10px;
|
||||
margin: 5px 3px;
|
||||
color: @text;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#workspaces .active {
|
||||
background: @accent;
|
||||
color: @accent-fg;
|
||||
}
|
||||
|
||||
#window {
|
||||
padding: 0 12px;
|
||||
margin: 5px 4px;
|
||||
background: @accent;
|
||||
color: @accent-fg;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#clock,
|
||||
#battery,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#tray {
|
||||
padding: 0 12px;
|
||||
margin: 5px 4px;
|
||||
background: @module-bg;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
@define-color bar-bg rgba(17, 17, 27, 0.82);
|
||||
@define-color module-bg rgba(49, 50, 68, 0.85);
|
||||
@define-color border rgba(203, 166, 247, 0.35);
|
||||
@define-color text #cdd6f4;
|
||||
@define-color accent #cba6f7;
|
||||
@define-color accent-fg #11111b;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
@define-color bar-bg rgba(17, 17, 27, 0.82);
|
||||
@define-color module-bg rgba(49, 50, 68, 0.85);
|
||||
@define-color border rgba(203, 166, 247, 0.35);
|
||||
@define-color text #cdd6f4;
|
||||
@define-color accent #cba6f7;
|
||||
@define-color accent-fg #11111b;
|
||||
@@ -1,6 +0,0 @@
|
||||
@define-color bar-bg rgba(249, 245, 215, 0.88);
|
||||
@define-color module-bg rgba(235, 219, 178, 0.86);
|
||||
@define-color border rgba(181, 118, 20, 0.35);
|
||||
@define-color text #3c3836;
|
||||
@define-color accent #b57614;
|
||||
@define-color accent-fg #f9f5d7;
|
||||
@@ -10,7 +10,6 @@ alias gsw='git switch'
|
||||
alias gst='git status'
|
||||
alias ga='git add .'
|
||||
alias gtree="git log --graph --all --pretty=format:'%C(yellow)%h%Creset%C(cyan)%d%Creset %s %C(dim)(%cr) <%an>%Creset'"
|
||||
alias typ='typora --enable-features=UseOzonePlatform --ozone-platform=wayland &'
|
||||
|
||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
export GOPATH="${GOPATH:-$HOME/go}"
|
||||
|
||||
Reference in New Issue
Block a user