Skip to content

Commit

Permalink
Wezterm check doesn't work, just use osc52
Browse files Browse the repository at this point in the history
  • Loading branch information
Jendker committed Oct 3, 2024
1 parent 4e8ad01 commit 3d48ee2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
11 changes: 11 additions & 0 deletions scripts/debian/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function get_highest_tag_version() {
git tag | grep -E '^v?[0-9]+(\.[0-9]+){1,2}$' | sort -V | tail -n 1
}

function install_rust() {
if ! [ -x "$(command -v cargo)" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
grep -qxF 'source "$HOME/.cargo/env"' $HOME/.zshrc || echo 'source "$HOME/.cargo/env"' >>$HOME/.zshrc
echo "Please source ~/.zshrc or ~/.bashrc"
fi
}
18 changes: 9 additions & 9 deletions stow/common/dot-config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
"kanagawa.nvim": { "branch": "master", "commit": "f491b0fe68fffbece7030181073dfe51f45cda81" },
"last-color.nvim": { "branch": "main", "commit": "95d3bb07409a8334ecc57336cc39673ecca02ae0" },
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" },
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
"lsp-zero.nvim": { "branch": "v4.x", "commit": "b8411704591ae8e1501f1b9b31c801c09927baac" },
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
Expand All @@ -46,19 +46,19 @@
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
"nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" },
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"nvim-dap-go": { "branch": "main", "commit": "5511788255c92bdd845f8d9690f88e2e0f0ff9f2" },
"nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" },
"nvim-dap-python": { "branch": "master", "commit": "db72bf6ab9f75fe841e8e11e772ee7fef6f484f1" },
"nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" },
"nvim-early-retirement": { "branch": "main", "commit": "2c36a5671b9d8f0d9e11b77c5a55de802bc45e34" },
"nvim-fundo": { "branch": "main", "commit": "ac9c9372c4bf677721e24f144ef29d3a05c2b589" },
"nvim-lint": { "branch": "master", "commit": "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f" },
"nvim-lspconfig": { "branch": "master", "commit": "8ab8f4cf48425dcb4845a61d3caa2d2a7e3d9df7" },
"nvim-lint": { "branch": "master", "commit": "27f44d1cc3d733a38a736acb902f94879d99c76c" },
"nvim-lspconfig": { "branch": "master", "commit": "1c2595e38da319a1a58c94f58afe6fe6fe02e292" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-scrollview": { "branch": "main", "commit": "2a0ba552442638d1746379d8b8f3ba2df7d0bdf0" },
"nvim-scrollview": { "branch": "main", "commit": "b0febf803081dab602649e72b7f6685683c88a3b" },
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "ef52e44bb24161e5138b3de5beadab3f3fcff233" },
"nvim-treesitter": { "branch": "master", "commit": "cc2c11c403a9143827501223b4ee64432dcaf246" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "4a2d05ec24eaa6b655c7d19092a3b6c0219d46b9" },
"nvim-web-devicons": { "branch": "master", "commit": "6b53401918a9033a41159d012160c5fb5eb249ae" },
"oil.nvim": { "branch": "master", "commit": "9e6fb844fe4cce13d9e3f6a7c970cbc669bb1629" },
Expand All @@ -84,7 +84,7 @@
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" },
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
"trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-bookmarks": { "branch": "master", "commit": "9cc5fa7ecc23b052bd524d07c85356c64b92aeef" },
"vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" },
Expand All @@ -101,5 +101,5 @@
"vim-textobj-variable-segment": { "branch": "main", "commit": "12e07590db6c90586ae5b750d6123c0779f6b35b" },
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
"virtcolumn.nvim": { "branch": "main", "commit": "4d385b4aa42aa3af6fa2cb8527462fa4badbd163" },
"which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
}
19 changes: 17 additions & 2 deletions stow/common/dot-config/nvim/lua/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ end

vscode = vim.fn.exists('g:vscode') ~= 0
TMUX = vim.env.TMUX ~= nil
SSH = vim.env.SSH_CONNECTION ~= nil

function TableToString(o)
if type(o) == 'table' then
local s = '{ '
Expand All @@ -22,6 +20,23 @@ end

local M = {}

function M.is_SSH()
if TMUX then
local handle = io.popen("tmux show-env")
if handle then
local result = handle:read("*a")
handle:close()
if result:find("SSH_CONNECTION=") then
return true
end
if result:find("-SSH_CONNECTION") then
return false
end
end
end
return vim.env.SSH_CONNECTION ~= nil
end

local function is_dev_dir()
local cwd_parts = vim.split(vim.fn.getcwd(), "/")
vim.g.debug = cwd_parts
Expand Down
14 changes: 6 additions & 8 deletions stow/common/dot-config/nvim/lua/settings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "common"
local common = require "common"

-- Add luarocks to rtp
local home = vim.uv.os_homedir()
Expand Down Expand Up @@ -41,17 +41,15 @@ local function copy(register)
else
return {"tmux", "load-buffer", "-w", "-"}
end
-- return function(lines) vim.fn.setreg("+", lines) end
end
local function paste(register)
if not vim.env.WEZTERM_EXECUTABLE then
if not TMUX then
return require('vim.ui.clipboard.osc52').paste(register)
else
return { 'bash', '-c', 'tmux refresh-client -l && sleep 0.05 && tmux save-buffer -' }
end
if not TMUX then
return require('vim.ui.clipboard.osc52').paste(register)
else
return { vim.fn.split(vim.fn.getreg("+"), "\n"), vim.fn.getregtype("+") }
return { 'bash', '-c', 'tmux refresh-client -l && sleep 0.05 && tmux save-buffer -' }
end
-- return { vim.fn.split(vim.fn.getreg("+"), "\n"), vim.fn.getregtype("+") }
end

vim.g.clipboard = {
Expand Down

0 comments on commit 3d48ee2

Please sign in to comment.