1
0
Fork 0

Merge branch 'main' of git.snaile.de:luca/dotfiles

This commit is contained in:
Luca Bilke 2024-06-03 10:24:47 +02:00
commit 3799050795
16 changed files with 1446 additions and 7 deletions

@ -1 +0,0 @@
Subproject commit aaf8fd6be6829b81f5456c741cf987bd2ab10a2c

View file

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

87
.config/nvim/init.lua Normal file
View file

@ -0,0 +1,87 @@
_G.Config = require("config")
_G.Lib = require("lib")
-- NOTE: lazy.nvim setup
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
},
{ import = "lazyvim.plugins.extras.coding.copilot" },
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
{ import = "lazyvim.plugins.extras.dap.core" },
{ import = "lazyvim.plugins.extras.editor.aerial" },
{ import = "lazyvim.plugins.extras.editor.leap" },
{ import = "lazyvim.plugins.extras.test.core" },
-- { import = "lazyvim.plugins.extras.ui.edgy" },
{ import = "lazyvim.plugins.extras.ui.mini-indentscope" },
{ import = "lazyvim.plugins.extras.lang.ansible" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.helm" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.terraform" },
{ import = "lazyvim.plugins.extras.lang.toml" },
{ import = "plugins" },
},
defaults = {
lazy = true,
version = false,
},
install = { colorscheme = { "tokyonight" } },
checker = { enabled = true },
performance = {
rtp = {
disabled_plugins = {
"gzip",
-- "matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-- NOTE: Autocmds
for _, autocmd in ipairs({
{ -- Automatically change line numeration
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{ command = 'if &nu && mode() != "i" | set rnu | endif' },
},
{ -- Automatically change line numeration
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{ command = "if &nu | set nornu | endif" },
},
{ -- Trigger shortcuts script
"BufWritePost",
{ pattern = { "directories", "files" }, command = "silent!!shortcuts" },
},
{ -- Trigger xrdb
"BufWritePost",
{ pattern = { "xresources" }, command = "silent!!xrdb %" },
},
}) do
vim.api.nvim_create_autocmd(autocmd[1], autocmd[2])
end

View file

@ -0,0 +1,17 @@
---@class config
---@field ui config.ui
---@field language config.language
---@field shortcuts config.shortcuts
---@field secrets? config.secrets
local M = {}
setmetatable(M, {
__index = function(_, k)
local ok, mod = pcall(require, "config." .. k)
if ok then
return mod
end
end,
})
return M

View file

@ -0,0 +1,8 @@
-- 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
local unmap = vim.api.nvim_del_keymap
unmap("n", "<Leader>uL")
unmap("n", "<Leader>ul")

View file

@ -0,0 +1,16 @@
-- 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
local o = vim.opt
local g = vim.g
o.shiftwidth = 4
o.tabstop = 4
o.scrolloff = 8
o.conceallevel = 0
g.loaded_node_provider = 0
g.loaded_perl_provider = 0
g.loaded_python3_provider = 0
g.loaded_ruby_provider = 0

View file

@ -0,0 +1,22 @@
-- NOTE: Managed by shortcuts script
---@class config.shortcuts
return {
gh = "/home/luca",
gch = "/home/luca/.cache",
gcf = "/home/luca/.config",
gdt = "/home/luca/.local/share",
gst = "/home/luca/.local/state",
gsc = "/home/luca/.local/bin",
gle = "/home/luca/.local/libexec",
gmn = "/mnt",
gco = "/home/luca/Documents/dev",
gdl = "/home/luca/Downloads",
gdm = "/home/luca/Documents",
gdk = "/home/luca/Desktop",
gms = "/home/luca/Music",
gpc = "/home/luca/Pictures",
gvd = "/home/luca/Videos",
gds = "/home/luca/.local/share/stow/dots",
glg = "/home/luca/.local/log",
gsv = "/home/luca/.local/sv",
}

View file

@ -0,0 +1,118 @@
local M = {}
M.banners = {
[[
]],
[[
]],
[[
]],
}
M.buttons = {
-- {
-- action = LazyVim.telescope("files"),
-- desc = " Find File" .. string.rep(" ", 33),
-- icon = " ",
-- key = "f",
-- },
{
action = "enew",
desc = " New File" .. string.rep(" ", 34),
icon = "",
key = "n",
},
-- {
-- action = "Telescope live_grep",
-- desc = " Find Text" .. string.rep(" ", 33),
-- icon = " ",
-- key = "g",
-- },
-- {
-- action = "TodoTelescope",
-- desc = " Find Todo" .. string.rep(" ", 33),
-- icon = "󰱒 ",
-- key = "t",
-- },
{
action = 'lua require("persistence").load()',
desc = " Restore Session" .. string.rep(" ", 27),
icon = "",
key = "s",
},
{
action = "qa",
desc = " Quit" .. string.rep(" ", 38),
icon = "",
key = "q",
},
}
return M

25
.config/nvim/lua/lib.lua Normal file
View file

@ -0,0 +1,25 @@
local M = {}
---@return table<string, function>
function M.generate_shortcut_maps()
local shortcuts = Config.shortcuts
local fs = require("neo-tree.sources.filesystem")
local maps = {}
for map, path in pairs(shortcuts) do
maps[map] = function(state)
fs._navigate_internal(state, path, nil, nil, false)
end
end
return maps
end
---@param key string
---@return string?
function M.get_secret(key)
local ok, keys = pcall(require, "config.secrets")
if ok then
return keys[key]
end
end
return M

View file

@ -0,0 +1,329 @@
---@type LazySpec
return {
{
"echasnovski/mini.surround",
opts = {
custom_surroundings = {
B = {
input = { "{{ ().*() }}" },
output = { left = "{{ ", right = " }}" },
},
},
},
},
{
"echasnovski/mini.ai",
opts = {
custom_textobjects = {
B = {
require("mini.ai").gen_spec.pair("{{ ", " }}"),
},
},
},
},
{
"ggandor/flit.nvim",
enabled = false,
},
{
"NvChad/nvim-colorizer.lua",
cmd = { "ColorizerToggle", "ColorizerAttachToBuffer", "ColorizerDetachFromBuffer", "ColorizerReloadAllBuffers" },
opts = { user_default_options = { names = false } },
keys = { { "<leader>uH", "<cmd>ColorizerToggle<cr>", desc = "Toggle Colorizer" } },
},
{
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim" },
{
"folke/which-key.nvim",
optional = true,
opts = { defaults = { ["<leader>a"] = { name = "+ai" }, ["<leader>ac"] = { name = "+copilot" } } },
},
},
keys = {
{ "<leader>acc", "<cmd>CopilotChatToggle<cr>", desc = "Toggle Chat", mode = { "n", "v" } },
{ "<leader>acx", "<cmd>CopilotChatReset<cr>", desc = "Reset Chat", mode = { "n", "v" } },
{ "<leader>acf", "<cmd>CopilotChatFix<cr>", desc = "Fix Selection", mode = { "v" } },
{ "<leader>ace", "<cmd>CopilotChatExplain<cr>", desc = "Explain Selection", mode = { "v" } },
{ "<leader>acr", "<cmd>CopilotChatExplain<cr>", desc = "Review Selection", mode = { "v" } },
{ "<leader>aco", "<cmd>CopilotChatOptimize<cr>", desc = "Optimize Selection", mode = { "v" } },
{ "<leader>acd", "<cmd>CopilotChatDocs<cr>", desc = "Document Selection", mode = { "v" } },
{ "<leader>act", "<cmd>CopilotChatTests<cr>", desc = "Unittest Selection", mode = { "v" } },
},
opts = {
window = {
layout = "float",
width = 0.9,
height = 0.8,
},
mappings = {
complete = {
detail = "Use @<Tab> or /<Tab> for options.",
insert = "<Tab>",
},
close = {
normal = "q",
insert = "<C-c>",
},
reset = {
normal = "<C-l>",
insert = "<C-l>",
},
submit_prompt = {
normal = "<CR>",
insert = "<C-CR>",
},
accept_diff = {
normal = "<C-y>",
insert = "<C-y>",
},
yank_diff = {
normal = "gy",
},
show_diff = {
normal = "gd",
},
show_system_prompt = {
normal = "gp",
},
show_user_selection = {
normal = "gs",
},
},
},
},
{
"jackMort/ChatGPT.nvim",
cmd = { "ChatGPT", "ChatGPTActAs", "ChatGPTEditWithInstructions", "ChatGPTRun" },
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
"nvim-telescope/telescope.nvim",
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>a"] = { name = "+ai" },
["<leader>ag"] = { name = "+chatgpt" },
["<leader>agt"] = { name = "+translate" },
},
},
},
},
config = function(_, opts)
local key = Lib.get_secret("openai")
if key then
require("chatgpt.api").OPENAI_API_KEY = key
require("chatgpt.api").AUTHORIZATION_HEADER = "Authorization: Bearer " .. key
require("chatgpt").setup(opts)
end
end,
--stylua: ignore
keys = {
{ "<leader>agc", function() require("chatgpt").openChat() end, desc = "Toggle Chat" },
{ "<leader>age", function() require("chatgpt").edit_with_instructions() end, desc = "Edit with instruction", mode = { "n", "v" } },
{ "<leader>agg", function() require("chatgpt").run_action("grammar_correction") end, desc = "Grammar Correction", mode = { "n", "v" } },
{ "<leader>agtg", function() require("chatgpt").run_action({ fargs = { "translate", "german" } }) end, desc = "German", mode = { "n", "v" } },
{ "<leader>agte", function() require("chatgpt").run_action({ fargs = { "translate", "english" } }) end, desc = "English", mode = { "n", "v" } },
{ "<leader>agtf", function() require("chatgpt").run_action({ fargs = { "translate", "french" } }) end, desc = "French", mode = { "n", "v" } },
{ "<leader>agtr", function() require("chatgpt").run_action({ fargs = { "translate", "russian" } }) end, desc = "Russian", mode = { "n", "v" } },
{ "<leader>agk", function() require("chatgpt").run_action({ fargs = { "keywords" } }) end, desc = "Keywords", mode = { "n", "v" } },
{ "<leader>agd", function() require("chatgpt").run_action({ fargs = { "docstring" } }) end, desc = "Docstring", mode = { "n", "v" } },
{ "<leader>aga", function() require("chatgpt").run_action({ fargs = { "add_tests" } }) end, desc = "Add Tests", mode = { "n", "v" } },
{ "<leader>ago", function() require("chatgpt").run_action({ fargs = { "optimize_code" } }) end, desc = "Optimize Code", mode = { "n", "v" } },
{ "<leader>ags", function() require("chatgpt").run_action({ fargs = { "summarize" } }) end, desc = "Summarize", mode = { "n", "v" } },
{ "<leader>agf", function() require("chatgpt").run_action({ fargs = { "fix_bugs" } }) end, desc = "Fix Bugs", mode = { "n", "v" } },
{ "<leader>agx", function() require("chatgpt").run_action({ fargs = { "explain_code" } }) end, desc = "Explain Code", mode = { "n", "v" } },
{ "<leader>agr", function() require("chatgpt").run_action({ fargs = { "roxygen_edit" } }) end, desc = "Roxygen Edit", mode = { "n", "v" } },
{ "<leader>agl", function() require("chatgpt").run_action({ fargs = { "code_readability_analysis" } }) end, desc = "Code Readability Analysis", mode = { "n", "v" } },
},
opts = {
edit_with_instructions = {
keymaps = {
close = "<C-c>",
accept = "<C-y>",
toggle_diff = "<C-d>",
toggle_settings = "<C-o>",
toggle_help = "<C-.>",
cycle_windows = "<Tab>",
use_output_as_input = "<C-,>",
},
},
chat = {
question_sign = "",
answer_sign = "󰚩",
sessions_window = {
active_sign = " 󰭹 ",
inactive_sign = " 󰻞 ",
current_line_sign = "",
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
keymaps = {
close = "<C-c>",
yank_last = "<C-y>",
yank_last_code = "<C-p>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-g>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-n>",
prev_message = "<C-p>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-r>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_sessions = "<C-s>",
toggle_help = "<C-.>",
toggle_message_role = "<C-,>",
toggle_system_role_open = "<C-'>",
stop_generating = "<C-x>",
},
},
popup_layout = {
default = "center",
center = {
width = "90%",
height = "80%",
},
right = {
width = "30%",
width_settings_open = "50%",
},
},
popup_window = {
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
system_window = {
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
popup_input = {
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
submit = "<C-Enter>",
submit_n = "<Enter>",
},
settings_window = {
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
help_window = {
border = {
style = "single",
},
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
},
openai_params = {
-- model = "gpt-3.5-turbo",
model = "gpt-4-turbo",
},
openai_edit_params = {
-- model = "gpt-3.5-turbo",
model = "gpt-4-turbo",
},
},
},
{
"nvim-neo-tree/neo-tree.nvim",
opts = {
filesystem = {
window = {
mappings = Lib.generate_shortcut_maps(),
},
},
},
},
{
"folke/todo-comments.nvim",
opts = {
highlight = {
multiline = false,
},
},
},
{
"zk-org/zk-nvim",
ft = { "markdown" },
main = "zk",
dependencies = {
{
"folke/which-key.nvim",
optional = true,
opts = { defaults = { ["<leader>z"] = { name = "+zk" } } },
},
},
opts = {
picker = "telescope",
lsp = {
cmd = { "zk", "lsp" },
name = "zk",
config = {
on_attach = function(client)
if client.name == "zk" then
require("zk").cd()
end
end,
},
auto_attach = {
enabled = true,
filetypes = { "markdown" },
},
},
},
--stylua: ignore
keys = {
{ "<leader>zn", function() require("zk.commands").get("ZkNew")({ title = vim.fn.input('Title: ') }) end, desc = "New Note", mode = { "n", "v" } },
{ "<leader>znt", function() require("zk.commands").get("ZkNewFromTitleSelection")() end, desc = "Title from selection", mode = { "v" } },
{
"<leader>znc",
function()
require("zk.commands").get("ZkNewFromContentSelection")({
title = vim.fn.input(
'Title: ')
})
end,
desc = "Content from selection",
mode = { "v" }
},
{ "<leader>zb", function() require("zk.commands").get("ZkBacklinks")() end, desc = "Links" },
{ "<leader>zl", function() require("zk.commands").get("ZkLinks")() end, desc = "Backlinks" },
{ "<leader>zx", function() require("zk.commands").get("ZkIndex")() end, desc = "Index" },
{ "<leader>zf", function() require("zk.commands").get("ZkNotes")({ sort = { 'modified' } }) end, desc = "Find Notes" },
{ "<leader>zt", function() require("zk.commands").get("ZkTags")() end, desc = "Find Note Tags" },
{ "<leader>zf", function() require("zk.commands").get("ZkMatch")() end, desc = "Find Notes (Match Selection)", mode = { "v" } },
{ "<leader>zi", function() require("zk.commands").get("ZkInsertLinkAtSelection")() end, desc = "Insert Link", mode = { "n", "v" } },
},
},
}

View file

@ -0,0 +1,24 @@
return {
{
"stevearc/conform.nvim",
opts = {
formatters = {
shfmt = { prepend_args = { "-i", "4", "-ci" } },
},
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
intelephense = {
init_options = {
storagePath = os.getenv("XDG_CACHE_HOME") .. "/intelephense",
globalStoragePath = os.getenv("XDG_CONFIG_HOME") .. "/intelephense",
licenceKey = require("lib").get_secret("intelephense"),
},
},
},
},
},
}

View file

@ -0,0 +1,84 @@
---@type LazySpec
return {
{
"folke/tokyonight.nvim",
lazy = true,
opts = {
style = "night",
on_colors = function(c)
c.border = c.bg_highlight
c.border_highlight = c.blue
end,
on_highlights = function(hl, _)
hl.CurSearch = nil
end,
},
},
{
"folke/noice.nvim",
opts = {
cmdline = {
view = "cmdline",
presets = {
command_palette = false,
},
},
},
},
{
"nvimdev/dashboard-nvim",
opts = function(_, opts)
local center = Config.ui.buttons
local banners = Config.ui.banners
for _, button in ipairs(center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
math.randomseed(os.time())
local banner = "\n" .. banners[math.random(#banners)] .. "\n"
opts.config.header = vim.split(banner, "\n")
opts.config.center = center
opts.config.footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "Behold: a Snail's Vim | " .. stats.count .. "" .. ms .. "ms" }
end
end,
},
{
"echasnovski/mini.indentscope",
opts = {
draw = {
animation = require("mini.indentscope").gen_animation.none(),
},
},
},
{
"nvim-lualine/lualine.nvim",
opts = {
sections = {
lualine_y = {
{
function()
--stylua: ignore
local chars = { "", "", "", "", "", "", "", "", "", "", "", "", "" }
return chars[math.ceil(vim.fn.line(".") / vim.fn.line("$") * #chars)]
end,
separator = " ",
padding = { left = 1, right = 0 },
},
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {
{
"o:encoding",
fmt = string.upper,
separator = " ",
padding = { left = 1, right = 0 },
},
{ "fileformat", padding = { left = 0, right = 1 } },
},
},
},
},
}

View file

@ -0,0 +1,10 @@
ansible
submodules
roundcube
postgres
binpkgs
hostdir
config
wireguard
Webchecks
fail2ban

3
.config/nvim/stylua.toml Normal file
View file

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

View file

@ -0,0 +1,672 @@
#compdef rbw
autoload -U is-at-least
_rbw() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_rbw_commands" \
"*::: :->rbw" \
&& ret=0
case $state in
(rbw)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rbw-command-$line[1]:"
case $line[1] in
(config)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
":: :_rbw__config_commands" \
"*::: :->config" \
&& ret=0
case $state in
(config)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rbw-config-command-$line[1]:"
case $line[1] in
(show)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':key -- Configuration key to set:' \
':value -- Value to set the configuration option to:' \
&& ret=0
;;
(unset)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':key -- Configuration key to unset:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_rbw__config__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rbw-config-help-command-$line[1]:"
case $line[1] in
(show)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(unset)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
;;
(register)
_arguments "${_arguments_options[@]}" \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(login)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(unlocked)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
'*--fields=[Fields to display. Available options are id, name, user, folder. Multiple fields will be separated by tabs.]:FIELDS: ' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" \
'--folder=[Folder name to search in]:FOLDER: ' \
'-f+[Field to get]:FIELD: ' \
'--field=[Field to get]:FIELD: ' \
'--full[Display the notes in addition to the password]' \
'--raw[Display output as JSON]' \
'--clipboard[Copy result to clipboard]' \
'-h[Print help]' \
'--help[Print help]' \
':name -- Name or UUID of the entry to display:' \
'::user -- Username of the entry to display:' \
&& ret=0
;;
(code)
_arguments "${_arguments_options[@]}" \
'--folder=[Folder name to search in]:FOLDER: ' \
'-h[Print help]' \
'--help[Print help]' \
':name -- Name or UUID of the entry to display:' \
'::user -- Username of the entry to display:' \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" \
'*--uri=[URI for the password entry]:URI: ' \
'--folder=[Folder for the password entry]:FOLDER: ' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Name of the password entry:' \
'::user -- Username for the password entry:' \
&& ret=0
;;
(generate)
_arguments "${_arguments_options[@]}" \
'*--uri=[URI for the password entry]:URI: ' \
'--folder=[Folder for the password entry]:FOLDER: ' \
'--no-symbols[Generate a password with no special characters]' \
'--only-numbers[Generate a password consisting of only numbers]' \
'--nonconfusables[Generate a password without visually similar characters (useful for passwords intended to be written down)]' \
'--diceware[Generate a password of multiple dictionary words chosen from the EFF word list. The len parameter for this option will set the number of words to generate, rather than characters.]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':len -- Length of the password to generate:' \
'::name -- Name of the password entry:' \
'::user -- Username for the password entry:' \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" \
'--folder=[Folder name to search in]:FOLDER: ' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
':name -- Name or UUID of the password entry:' \
'::user -- Username for the password entry:' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" \
'--folder=[Folder name to search in]:FOLDER: ' \
'-h[Print help]' \
'--help[Print help]' \
':name -- Name or UUID of the password entry:' \
'::user -- Username for the password entry:' \
&& ret=0
;;
(history)
_arguments "${_arguments_options[@]}" \
'--folder=[Folder name to search in]:FOLDER: ' \
'-h[Print help]' \
'--help[Print help]' \
':name -- Name or UUID of the password entry:' \
'::user -- Username for the password entry:' \
&& ret=0
;;
(lock)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(purge)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(stop-agent)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(gen-completions)
_arguments "${_arguments_options[@]}" \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_rbw__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rbw-help-command-$line[1]:"
case $line[1] in
(config)
_arguments "${_arguments_options[@]}" \
":: :_rbw__help__config_commands" \
"*::: :->config" \
&& ret=0
case $state in
(config)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:rbw-help-config-command-$line[1]:"
case $line[1] in
(show)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(set)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(unset)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
;;
esac
;;
(register)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(login)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(unlock)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(unlocked)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(sync)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(code)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(add)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(generate)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(history)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(lock)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(purge)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(stop-agent)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(gen-completions)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
;;
esac
;;
esac
;;
esac
}
(( $+functions[_rbw_commands] )) ||
_rbw_commands() {
local commands; commands=(
'config:Get or set configuration options' \
'register:Register this device with the Bitwarden server' \
'login:Log in to the Bitwarden server' \
'unlock:Unlock the local Bitwarden database' \
'unlocked:Check if the local Bitwarden database is unlocked' \
'sync:Update the local copy of the Bitwarden database' \
'list:List all entries in the local Bitwarden database' \
'ls:List all entries in the local Bitwarden database' \
'get:Display the password for a given entry' \
'code:Display the authenticator code for a given entry' \
'add:Add a new password to the database' \
'generate:Generate a new password' \
'gen:Generate a new password' \
'edit:Modify an existing password' \
'remove:Remove a given entry' \
'rm:Remove a given entry' \
'history:View the password history for a given entry' \
'lock:Lock the password database' \
'purge:Remove the local copy of the password database' \
'stop-agent:Terminate the background agent' \
'gen-completions:Generate completion script for the given shell' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'rbw commands' commands "$@"
}
(( $+functions[_rbw__add_commands] )) ||
_rbw__add_commands() {
local commands; commands=()
_describe -t commands 'rbw add commands' commands "$@"
}
(( $+functions[_rbw__help__add_commands] )) ||
_rbw__help__add_commands() {
local commands; commands=()
_describe -t commands 'rbw help add commands' commands "$@"
}
(( $+functions[_rbw__code_commands] )) ||
_rbw__code_commands() {
local commands; commands=()
_describe -t commands 'rbw code commands' commands "$@"
}
(( $+functions[_rbw__help__code_commands] )) ||
_rbw__help__code_commands() {
local commands; commands=()
_describe -t commands 'rbw help code commands' commands "$@"
}
(( $+functions[_rbw__config_commands] )) ||
_rbw__config_commands() {
local commands; commands=(
'show:Show the values of all configuration settings' \
'set:Set a configuration option' \
'unset:Reset a configuration option to its default' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'rbw config commands' commands "$@"
}
(( $+functions[_rbw__help__config_commands] )) ||
_rbw__help__config_commands() {
local commands; commands=(
'show:Show the values of all configuration settings' \
'set:Set a configuration option' \
'unset:Reset a configuration option to its default' \
)
_describe -t commands 'rbw help config commands' commands "$@"
}
(( $+functions[_rbw__edit_commands] )) ||
_rbw__edit_commands() {
local commands; commands=()
_describe -t commands 'rbw edit commands' commands "$@"
}
(( $+functions[_rbw__help__edit_commands] )) ||
_rbw__help__edit_commands() {
local commands; commands=()
_describe -t commands 'rbw help edit commands' commands "$@"
}
(( $+functions[_rbw__gen-completions_commands] )) ||
_rbw__gen-completions_commands() {
local commands; commands=()
_describe -t commands 'rbw gen-completions commands' commands "$@"
}
(( $+functions[_rbw__help__gen-completions_commands] )) ||
_rbw__help__gen-completions_commands() {
local commands; commands=()
_describe -t commands 'rbw help gen-completions commands' commands "$@"
}
(( $+functions[_rbw__generate_commands] )) ||
_rbw__generate_commands() {
local commands; commands=()
_describe -t commands 'rbw generate commands' commands "$@"
}
(( $+functions[_rbw__help__generate_commands] )) ||
_rbw__help__generate_commands() {
local commands; commands=()
_describe -t commands 'rbw help generate commands' commands "$@"
}
(( $+functions[_rbw__get_commands] )) ||
_rbw__get_commands() {
local commands; commands=()
_describe -t commands 'rbw get commands' commands "$@"
}
(( $+functions[_rbw__help__get_commands] )) ||
_rbw__help__get_commands() {
local commands; commands=()
_describe -t commands 'rbw help get commands' commands "$@"
}
(( $+functions[_rbw__config__help_commands] )) ||
_rbw__config__help_commands() {
local commands; commands=(
'show:Show the values of all configuration settings' \
'set:Set a configuration option' \
'unset:Reset a configuration option to its default' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'rbw config help commands' commands "$@"
}
(( $+functions[_rbw__config__help__help_commands] )) ||
_rbw__config__help__help_commands() {
local commands; commands=()
_describe -t commands 'rbw config help help commands' commands "$@"
}
(( $+functions[_rbw__help_commands] )) ||
_rbw__help_commands() {
local commands; commands=(
'config:Get or set configuration options' \
'register:Register this device with the Bitwarden server' \
'login:Log in to the Bitwarden server' \
'unlock:Unlock the local Bitwarden database' \
'unlocked:Check if the local Bitwarden database is unlocked' \
'sync:Update the local copy of the Bitwarden database' \
'list:List all entries in the local Bitwarden database' \
'get:Display the password for a given entry' \
'code:Display the authenticator code for a given entry' \
'add:Add a new password to the database' \
'generate:Generate a new password' \
'edit:Modify an existing password' \
'remove:Remove a given entry' \
'history:View the password history for a given entry' \
'lock:Lock the password database' \
'purge:Remove the local copy of the password database' \
'stop-agent:Terminate the background agent' \
'gen-completions:Generate completion script for the given shell' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'rbw help commands' commands "$@"
}
(( $+functions[_rbw__help__help_commands] )) ||
_rbw__help__help_commands() {
local commands; commands=()
_describe -t commands 'rbw help help commands' commands "$@"
}
(( $+functions[_rbw__help__history_commands] )) ||
_rbw__help__history_commands() {
local commands; commands=()
_describe -t commands 'rbw help history commands' commands "$@"
}
(( $+functions[_rbw__history_commands] )) ||
_rbw__history_commands() {
local commands; commands=()
_describe -t commands 'rbw history commands' commands "$@"
}
(( $+functions[_rbw__help__list_commands] )) ||
_rbw__help__list_commands() {
local commands; commands=()
_describe -t commands 'rbw help list commands' commands "$@"
}
(( $+functions[_rbw__list_commands] )) ||
_rbw__list_commands() {
local commands; commands=()
_describe -t commands 'rbw list commands' commands "$@"
}
(( $+functions[_rbw__help__lock_commands] )) ||
_rbw__help__lock_commands() {
local commands; commands=()
_describe -t commands 'rbw help lock commands' commands "$@"
}
(( $+functions[_rbw__lock_commands] )) ||
_rbw__lock_commands() {
local commands; commands=()
_describe -t commands 'rbw lock commands' commands "$@"
}
(( $+functions[_rbw__help__login_commands] )) ||
_rbw__help__login_commands() {
local commands; commands=()
_describe -t commands 'rbw help login commands' commands "$@"
}
(( $+functions[_rbw__login_commands] )) ||
_rbw__login_commands() {
local commands; commands=()
_describe -t commands 'rbw login commands' commands "$@"
}
(( $+functions[_rbw__help__purge_commands] )) ||
_rbw__help__purge_commands() {
local commands; commands=()
_describe -t commands 'rbw help purge commands' commands "$@"
}
(( $+functions[_rbw__purge_commands] )) ||
_rbw__purge_commands() {
local commands; commands=()
_describe -t commands 'rbw purge commands' commands "$@"
}
(( $+functions[_rbw__help__register_commands] )) ||
_rbw__help__register_commands() {
local commands; commands=()
_describe -t commands 'rbw help register commands' commands "$@"
}
(( $+functions[_rbw__register_commands] )) ||
_rbw__register_commands() {
local commands; commands=()
_describe -t commands 'rbw register commands' commands "$@"
}
(( $+functions[_rbw__help__remove_commands] )) ||
_rbw__help__remove_commands() {
local commands; commands=()
_describe -t commands 'rbw help remove commands' commands "$@"
}
(( $+functions[_rbw__remove_commands] )) ||
_rbw__remove_commands() {
local commands; commands=()
_describe -t commands 'rbw remove commands' commands "$@"
}
(( $+functions[_rbw__config__help__set_commands] )) ||
_rbw__config__help__set_commands() {
local commands; commands=()
_describe -t commands 'rbw config help set commands' commands "$@"
}
(( $+functions[_rbw__config__set_commands] )) ||
_rbw__config__set_commands() {
local commands; commands=()
_describe -t commands 'rbw config set commands' commands "$@"
}
(( $+functions[_rbw__help__config__set_commands] )) ||
_rbw__help__config__set_commands() {
local commands; commands=()
_describe -t commands 'rbw help config set commands' commands "$@"
}
(( $+functions[_rbw__config__help__show_commands] )) ||
_rbw__config__help__show_commands() {
local commands; commands=()
_describe -t commands 'rbw config help show commands' commands "$@"
}
(( $+functions[_rbw__config__show_commands] )) ||
_rbw__config__show_commands() {
local commands; commands=()
_describe -t commands 'rbw config show commands' commands "$@"
}
(( $+functions[_rbw__help__config__show_commands] )) ||
_rbw__help__config__show_commands() {
local commands; commands=()
_describe -t commands 'rbw help config show commands' commands "$@"
}
(( $+functions[_rbw__help__stop-agent_commands] )) ||
_rbw__help__stop-agent_commands() {
local commands; commands=()
_describe -t commands 'rbw help stop-agent commands' commands "$@"
}
(( $+functions[_rbw__stop-agent_commands] )) ||
_rbw__stop-agent_commands() {
local commands; commands=()
_describe -t commands 'rbw stop-agent commands' commands "$@"
}
(( $+functions[_rbw__help__sync_commands] )) ||
_rbw__help__sync_commands() {
local commands; commands=()
_describe -t commands 'rbw help sync commands' commands "$@"
}
(( $+functions[_rbw__sync_commands] )) ||
_rbw__sync_commands() {
local commands; commands=()
_describe -t commands 'rbw sync commands' commands "$@"
}
(( $+functions[_rbw__help__unlock_commands] )) ||
_rbw__help__unlock_commands() {
local commands; commands=()
_describe -t commands 'rbw help unlock commands' commands "$@"
}
(( $+functions[_rbw__unlock_commands] )) ||
_rbw__unlock_commands() {
local commands; commands=()
_describe -t commands 'rbw unlock commands' commands "$@"
}
(( $+functions[_rbw__help__unlocked_commands] )) ||
_rbw__help__unlocked_commands() {
local commands; commands=()
_describe -t commands 'rbw help unlocked commands' commands "$@"
}
(( $+functions[_rbw__unlocked_commands] )) ||
_rbw__unlocked_commands() {
local commands; commands=()
_describe -t commands 'rbw unlocked commands' commands "$@"
}
(( $+functions[_rbw__config__help__unset_commands] )) ||
_rbw__config__help__unset_commands() {
local commands; commands=()
_describe -t commands 'rbw config help unset commands' commands "$@"
}
(( $+functions[_rbw__config__unset_commands] )) ||
_rbw__config__unset_commands() {
local commands; commands=()
_describe -t commands 'rbw config unset commands' commands "$@"
}
(( $+functions[_rbw__help__config__unset_commands] )) ||
_rbw__help__config__unset_commands() {
local commands; commands=()
_describe -t commands 'rbw help config unset commands' commands "$@"
}
if [ "$funcstack[1]" = "_rbw" ]; then
_rbw "$@"
else
compdef _rbw rbw
fi

View file

@ -1,11 +1,21 @@
These are the dotfiles that I use on Void Linux.
I keep them on a selfhosted git server for easy synchronization, and mirror them to github so that others can use parts of them as well.
# Dotfiles
These are the dotfiles that I use on Void Linux. I keep them on a selfhosted
git server for easy synchronization, and mirror them to github so that others
can use parts of them as well.
## Installation
I've written a [script](https://github.com/ssnailed/bootstrapper) that will configure a fresh void installation to be used with these dotfiles.
You can also clone the repo to `~/.local/share/stow/dots` and run `~/.local/share/stow/dots/.local/bin/dotsync` to install them on an existing installation, but I'm sure that a few things would break.
I've written a [script](https://github.com/ssnailed/bootstrapper) that will
configure a fresh void installation to be used with these dotfiles. You can
also clone the repo to `~/.local/share/stow/dots` and run
`~/.local/share/stow/dots/.local/bin/dotsync` to install them on an existing
installation, but I'm sure that a few things would break.
## Warnings
My [.zprofile](.config/zsh/profile) automatically runs xinit if logged in on TTY1 and no other X server is running. This is because I use the default [getty](https://en.wikipedia.org/wiki/Getty_(Unix)) and want to automatically start dwm after logging in.
If any key mappings seem strange, it's because I use the dvorak keyboard layout.
My [.zprofile](.config/zsh/profile) automatically runs xinit if logged in on
TTY1 and no other X server is running. This is because I use the default
[getty](https://en.wikipedia.org/wiki/Getty_(Unix)) and want to automatically
start dwm after logging in. If any key mappings seem strange, it's because I
use the dvorak keyboard layout.