summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua1
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/docker.lua75
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lualine.lua15
-rw-r--r--mac/.config/shell/profile4
4 files changed, 70 insertions, 25 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua
index ab7099a..c33d37d 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dadbod.lua
@@ -19,6 +19,7 @@ return {
-- librewolf = "sqlite://" .. home .. "/.librewolf/si.default/places.sqlite",
mysql = "mariadb://ms:password@localhost:5432/mysql",
postsql = "postgresql://ps:password@localhost:5432/postgresql",
+ dts = "postgresql://dts:dujinDTS2@localhost:5432/evcp",
-- qutebrowser = "sqlite://" .. home .. "/.local/share/qutebrowser/history.sqlite",
-- sqlite = "sqlite://" .. home .. "/.local/share/db/sqlite.db",
}
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/docker.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/docker.lua
index 7bc26d5..3244fc9 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/docker.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/docker.lua
@@ -2,33 +2,62 @@ return {
"https://codeberg.org/esensar/nvim-dev-container",
dependencies = "nvim-treesitter/nvim-treesitter",
config = function()
+ vim.api.nvim_create_autocmd("User", {
+ pattern = "DevcontainerBuildProgress",
+ callback = function()
+ vim.cmd("redrawstatus")
+ end,
+ })
require("devcontainer").setup({
config_search_start = function()
- -- By default this function uses vim.loop.cwd()
- -- This is used to find a starting point for .devcontainer.json file search
- -- Since by default, it is searched for recursively
- -- That behavior can also be disabled
+ if vim.g.devcontainer_selected_config == nil or vim.g.devcontainer_selected_config == "" then
+ local candidates = vim.split(
+ vim.fn.glob(vim.loop.cwd() .. "/.devcontainer/**/devcontainer.json"),
+ "\n",
+ { trimempty = true }
+ )
+ if #candidates < 2 then
+ vim.g.devcontainer_selected_config = vim.loop.cwd()
+ else
+ local choices = { "Select devcontainer config file to use:" }
+ for idx, candidate in ipairs(candidates) do
+ table.insert(choices, idx .. ". - " .. candidate)
+ end
+ local choice_idx = vim.fn.inputlist(choices)
+ if choice_idx > #candidates then
+ choice_idx = 1
+ end
+ vim.g.devcontainer_selected_config =
+ string.gsub(candidates[choice_idx], "/devcontainer.json", "")
+ end
+ end
+ return vim.g.devcontainer_selected_config
end,
workspace_folder_provider = function()
-- By default this function uses first workspace folder for integrated lsp if available and vim.loop.cwd() as a fallback
-- This is used to replace `${localWorkspaceFolder}` in devcontainer.json
-- Also used for creating default .devcontainer.json file
- end,
- terminal_handler = function(command)
- -- By default this function creates a terminal in a new tab using :terminal command
- -- It also removes statusline when that tab is active, to prevent double statusline
- -- It can be overridden to provide custom terminal handling
- end,
- nvim_installation_commands_provider = function(path_binaries, version_string)
- -- Returns table - list of commands to run when adding neovim to container
- -- Each command can either be a string or a table (list of command parts)
- -- Takes binaries available in path on current container and version_string passed to the command or current version of neovim
- end,
- devcontainer_json_template = function()
- -- Returns table - list of lines to set when creating new devcontainer.json files
- -- As a template
- -- Used only when using functions from commands module or created commands
- end,
+ local bufdir = vim.fn.expand("%:p:h")
+ if bufdir ~= nil and bufdir ~= "" then
+ return bufdir
+ end
+ return vim.loop.cwd() or vim.fn.getcwd() or "."
+ end,
+ -- terminal_handler = function(command)
+ -- -- By default this function creates a terminal in a new tab using :terminal command
+ -- -- It also removes statusline when that tab is active, to prevent double statusline
+ -- -- It can be overridden to provide custom terminal handling
+ -- end,
+ -- nvim_installation_commands_provider = function(path_binaries, version_string)
+ -- -- Returns table - list of commands to run when adding neovim to container
+ -- -- Each command can either be a string or a table (list of command parts)
+ -- -- Takes binaries available in path on current container and version_string passed to the command or current version of neovim
+ -- end,
+ -- devcontainer_json_template = function()
+ -- -- Returns table - list of lines to set when creating new devcontainer.json files
+ -- -- As a template
+ -- -- Used only when using functions from commands module or created commands
+ -- end,
-- Can be set to false to prevent generating default commands
-- Default commands are listed below
generate_commands = true,
@@ -58,7 +87,7 @@ return {
attach_mounts = {
neovim_config = {
-- enables mounting local config to /root/.config/nvim in container
- enabled = false,
+ enabled = true,
-- makes mount readonly in container
options = { "readonly" },
},
@@ -83,13 +112,13 @@ return {
-- This takes a string (usually either "podman" or "docker") representing container runtime - "devcontainer-cli" is also partially supported
-- That is the command that will be invoked for container operations
-- If it is nil, plugin will use whatever is available (trying "podman" first)
- container_runtime = nil,
+ container_runtime = "docker",
-- Similar to container runtime, but will be used if main runtime does not support an action - useful for "devcontainer-cli"
backup_runtime = nil,
-- This takes a string (usually either "podman-compose" or "docker-compose") representing compose command - "devcontainer-cli" is also partially supported
-- That is the command that will be invoked for compose operations
-- If it is nil, plugin will use whatever is available (trying "podman-compose" first)
- compose_command = nil,
+ compose_command = "docker-compose",
-- Similar to compose command, but will be used if main command does not support an action - useful for "devcontainer-cli"
backup_compose_command = nil,
})
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lualine.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lualine.lua
index ab9db81..0f1fb98 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lualine.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lualine.lua
@@ -56,6 +56,21 @@ return {
return vim.g.remote_neovim_host and ("Remote: %s"):format(vim.uv.os_gethostname()) or ""
end,
},
+ {
+ function()
+ local build_status_last = require("devcontainer.status").find_build({ running = true })
+ if build_status_last then
+ return string.format(
+ "[%s/%s]%s",
+ build_status_last.current_step or "",
+ build_status_last.step_count or "",
+ build_status_last.progress and ("(" .. build_status_last.progress .. "%%)") or ""
+ )
+ else
+ return ""
+ end
+ end,
+ },
"branch",
{
"diff",
diff --git a/mac/.config/shell/profile b/mac/.config/shell/profile
index 0d2aa81..4ab1a32 100644
--- a/mac/.config/shell/profile
+++ b/mac/.config/shell/profile
@@ -76,8 +76,8 @@ export CARGO_HOME="$XDG_DATA_HOME/cargo"
export DICS="/usr/share/stardict/dic/"
### --- DOCKER --- ###
-export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
-export MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine
+# export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
+# export MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine
### --- ELECTRUM --- ###
export ELECTRUMDIR="$XDG_DATA_HOME/electrum"