From 1db815d481274055ce1f372c701c4e49c2013c12 Mon Sep 17 00:00:00 2001 From: Kacper Marzecki Date: Mon, 16 Feb 2026 09:42:46 +0100 Subject: [PATCH] asd --- .zshrc | 1 + nvim/lazy-lock.json | 101 ++++++++++++++++++----------------- nvim/lazyvim.json | 3 +- nvim/lua/config/keymaps.lua | 4 ++ nvim/lua/config/options.lua | 3 +- nvim/lua/plugins/lsp.lua | 56 +++++++++++-------- nvim/lua/plugins/plugins.lua | 23 +++++++- proxy.py | 99 ++++++++++++++++++++++++++++++++++ scripts/zellij-sesh | 24 +++++++++ wezterm/wezterm.lua | 31 +++++++++++ 10 files changed, 269 insertions(+), 76 deletions(-) create mode 120000 .zshrc create mode 100644 proxy.py create mode 100755 scripts/zellij-sesh create mode 100644 wezterm/wezterm.lua diff --git a/.zshrc b/.zshrc new file mode 120000 index 0000000..80ba5e2 --- /dev/null +++ b/.zshrc @@ -0,0 +1 @@ +/Users/kacper.marzecki@schibsted.com/.zshrc \ No newline at end of file diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 64373b1..071a118 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,67 +1,68 @@ { - "LazyVim": { "branch": "main", "commit": "42840b2ffbfa9dd3c15e0ce7d1bec36d772a3ead" }, - "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, - "blink-copilot": { "branch": "main", "commit": "5d35fd07fcc148be20442da1bdd2407e03263d7d" }, - "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, + "LazyVim": { "branch": "main", "commit": "28db03f958d58dfff3c647ce28fdc1cb88ac158d" }, + "R.nvim": { "branch": "main", "commit": "daaf4fdb74b36c3b692b7d06acf5238acf8ff8be" }, + "blackjack.nvim": { "branch": "main", "commit": "cf59e79de25b87a3ef68b92b3277c50d4b345a92" }, + "blink-copilot": { "branch": "main", "commit": "7ad8209b2f880a2840c94cdcd80ab4dc511d4f39" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "bookmarks.nvim": { "branch": "main", "commit": "0540d52ba64d0ec7677ec1ef14b3624c95a2aaba" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "af58927c55c9f3272c940ff02b3cee94a1249f26" }, - "codecompanion.nvim": { "branch": "main", "commit": "946e18627271e008635d53f96a56af459ebb40da" }, - "conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" }, - "copilot.lua": { "branch": "master", "commit": "30b98a4c25d6152c14084020f703b6d56e1f1122" }, + "catppuccin": { "branch": "main", "commit": "6efc53e42cfc97700f19043105bf73ba83c4ae7d" }, + "codecompanion.nvim": { "branch": "main", "commit": "b6fcc25ced5628d3d960e6e4bc287ce8fc9a1710" }, + "conform.nvim": { "branch": "master", "commit": "8314f4c9e205e7f30b62147069729f9a1227d8bf" }, + "copilot.lua": { "branch": "master", "commit": "e78d1ffebdf6ccb6fd8be4e6898030c1cf5f9b64" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "2febce67ff9cf7638d2569d17c41af02c38401eb" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "d45ce947b9e2b30dc564e9ea11a2e30f7a7b686d" }, + "fzf-lua": { "branch": "main", "commit": "a03d68e40eea835a1cdbd9f93049708dab3621e6" }, "gp.nvim": { "branch": "main", "commit": "c37f154b97690c4925fef4e35ffdbf2c844b5f4e" }, - "grug-far.nvim": { "branch": "main", "commit": "3e72397465f774b01aa38e4fe8e6eecf23d766d9" }, - "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "grug-far.nvim": { "branch": "main", "commit": "794f03c97afc7f4b03fb6ec5111be507df1850cf" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, - "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, - "markview.nvim": { "branch": "main", "commit": "c93ea99d96b4bfda5b7c7d0dfca9c26edf6e78f0" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, - "mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" }, - "mini.comment": { "branch": "main", "commit": "c40bc46e72f41d3db265f6d86deb3dc259c0985d" }, - "mini.diff": { "branch": "main", "commit": "a2df2a9a485328c20252b7cadb11feb717020e45" }, - "mini.hues": { "branch": "main", "commit": "f1fa8ad34788eada276f0b8a41d96a15622933de" }, - "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, - "mini.indentscope": { "branch": "main", "commit": "e9fa0714fc753e1e737940577904e553ee340903" }, - "mini.keymap": { "branch": "main", "commit": "2aa0a66d6cbf15c9cea331d976ac4d4b9f01621e" }, - "mini.move": { "branch": "main", "commit": "f33406ae7d95b931c6a0d3ba11e50983fe800afb" }, - "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" }, - "mini.surround": { "branch": "main", "commit": "444e155147e2b5159dd28a65f9736254c16cb817" }, - "neo-tree.nvim": { "branch": "main", "commit": "20244beec28b9d79ffb75fe1b1606f4dd8d476fc" }, + "markview.nvim": { "branch": "main", "commit": "18fc148c83925919d94f3fc8e5c74f2d108b9b44" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "4cfe411526a7a99c18281135e8b4765ae6330d15" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" }, + "mini.comment": { "branch": "main", "commit": "a0c721115faff8d05505c0a12dab410084d9e536" }, + "mini.diff": { "branch": "main", "commit": "6010e588e9ed14724880f244d7fa3df8f0be3f46" }, + "mini.hues": { "branch": "main", "commit": "8fb10472cc40a1aad428a82a90270c0e87981fe7" }, + "mini.icons": { "branch": "main", "commit": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c" }, + "mini.indentscope": { "branch": "main", "commit": "0308f949f31769e509696af5d5f91cebb2159c69" }, + "mini.keymap": { "branch": "main", "commit": "9a1ee970f05b113b3ce9ee6f330fe862706b7e49" }, + "mini.move": { "branch": "main", "commit": "4d214202d71e0a4066b6288176bbe88f268f9777" }, + "mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" }, + "mini.surround": { "branch": "main", "commit": "cc7b9d0a056b5fa6915ffac1cb91f29bf7c96f69" }, + "neo-tree.nvim": { "branch": "main", "commit": "38c8e49bf6731a27eb612834ec88c606532b7fea" }, "nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, - "noice.nvim": { "branch": "main", "commit": "db248375c12c5322fbb9b505c1dc6f08e4527684" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lint": { "branch": "master", "commit": "9da1fb942dd0668d5182f9c8dee801b9c190e2bb" }, - "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, - "nvim-navic": { "branch": "master", "commit": "099b4c8cdc3e9ea026ea6b2a0d315e2d28362242" }, + "nvim-lint": { "branch": "master", "commit": "1e6b2ac034d1a7588d11b0b8e862a7ad89368376" }, + "nvim-lspconfig": { "branch": "master", "commit": "0b38bc74487e73489624d61396af7805af9cc75f" }, + "nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" }, "nvim-parinfer": { "branch": "master", "commit": "3968e669d9f02589aa311d33cb475b16b27c5fbb" }, - "nvim-spider": { "branch": "main", "commit": "a7705d7233ac3c47f7a1e80172bbeaa11f1c722f" }, - "nvim-treesitter": { "branch": "main", "commit": "71bf1665f804d46f7e4b24ad7ffc11f6ea5b271a" }, - "nvim-treesitter-context": { "branch": "master", "commit": "41847d3dafb5004464708a3db06b14f12bde548a" }, - "nvim-treesitter-textobjects": { "branch": "main", "commit": "1b2d85d3de6114c4bcea89ffb2cd1ce9e3a19931" }, + "nvim-spider": { "branch": "main", "commit": "a31ce0c5e2f748909e0d7397ff20e052c98ca91b" }, + "nvim-treesitter": { "branch": "main", "commit": "99dfc5acefd7728cec4ad0d0a6a9720f2c2896ff" }, + "nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "28a3494c075ef0f353314f627546537e43c09592" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" }, - "overseer.nvim": { "branch": "master", "commit": "9334595f850a301ef8bd1d19fc46dca688f677b3" }, + "outline.nvim": { "branch": "main", "commit": "1967ef50036b0b1eac4977aeede55915a741afe0" }, + "overseer.nvim": { "branch": "master", "commit": "3cde0d84bdae56cd119cbf835f764fa30cec384c" }, "oxocarbon.nvim": { "branch": "main", "commit": "9f85f6090322f39b11ae04a343d4eb9d12a86897" }, - "persistence.nvim": { "branch": "main", "commit": "51eef57272742b773468949f6bd0503ec3f83874" }, + "persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "snacks.nvim": { "branch": "main", "commit": "d6e34b158d892cd774b36503cbd3a9e62c7951e3" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "todo-comments.nvim": { "branch": "main", "commit": "19d461ddd543e938eb22505fb03fa878800270b6" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "tokyonight.nvim": { "branch": "main", "commit": "e63c42a42b11cd6225f009dd949b9ee0fccc15ef" }, - "trouble.nvim": { "branch": "main", "commit": "c098362fe603d3922095e7db595961e020bdf2d0" }, - "ts-comments.nvim": { "branch": "main", "commit": "217ab9cc137fceb6659b53790bd25e608219abe1" }, - "vscode.nvim": { "branch": "main", "commit": "cb9df0873c10a21d05362455ae3bb355eadcef6b" }, - "which-key.nvim": { "branch": "main", "commit": "b4177e3eaf15fe5eb8357ebac2286d488be1ed00" }, - "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }, - "zen-mode.nvim": { "branch": "main", "commit": "438a59c33763d79e34ceb394e012c3bfd6aa1084" } + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "vscode.nvim": { "branch": "main", "commit": "aa1102a7e15195c9cca22730b09224a7f7745ba8" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "yanky.nvim": { "branch": "main", "commit": "04fc42b94305d94948c9c197f679336668af3292" }, + "zen-mode.nvim": { "branch": "main", "commit": "8564ce6d29ec7554eb9df578efa882d33b3c23a7" } } diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index c41cd96..3ccd6a7 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -1,9 +1,10 @@ { "extras": [ + ], "install_version": 7, "news": { "NEWS.md": "11866" }, "version": 8 -} +} \ No newline at end of file diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 238932c..ad3247e 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -238,3 +238,7 @@ vim.keymap.set({ "n", "v" }, "", "k", { noremap = true, silent = true }) vim.keymap.set({ "n", "v" }, "", "j", { noremap = true, silent = true }) vim.keymap.set({ "n", "v" }, "", "h", { noremap = true, silent = true }) vim.keymap.set({ "n", "v" }, "", "l", { noremap = true, silent = true }) + +-- ctrl-n p to navigate lsp suggestions, next and previous +vim.keymap.set("i", "", "lua cmp.mapping.select_next_item()", { noremap = true, silent = true }) +vim.keymap.set("i", "", "lua cmp.mapping.select_previous_item()", { noremap = true, silent = true }) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index dfebcff..725dc93 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -3,6 +3,7 @@ -- Add any additional options here vim.opt.laststatus = 3 - vim.g.maplocalleader = "," vim.diagnostic.config({ virtual_text = true }) + +vim.opt.scrolloff = 20 diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index e78e215..5668c17 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -1,30 +1,40 @@ -vim.lsp.config["elixir-ls"] = { - cmd = { "elixir-ls" }, - filetypes = { "elixir", "eelixir", "heex" }, - root_markers = { "mix.exs", ".git" }, -} -vim.lsp.enable("elixir-ls") +-- vim.lsp.config["elixir-ls"] = { +-- cmd = { "elixir-ls" }, +-- filetypes = { "elixir", "eelixir", "heex" }, +-- root_markers = { "mix.exs", ".git" }, +-- } +-- vim.lsp.enable("elixir-ls") -vim.lsp.config["deno"] = { - cmd = { "deno", "lsp" }, - filetypes = { "javascript", "typescript" }, - root_markers = { "deno.json" }, +-- vim.lsp.config["deno"] = { +-- cmd = { "deno", "lsp" }, +-- filetypes = { "javascript", "typescript" }, +-- root_markers = { "deno.json" }, +-- } +-- vim.lsp.enable("deno") + +-- vim.lsp.config["R"] = { +-- cmd = { "/opt/homebrew/bin/R", "--no-echo", "-e", "languageserver::run()" }, +-- filetypes = { "r" }, +-- } +-- vim.lsp.enable("R") +-- +vim.lsp.config["uiua"] = { + cmd = { "uiua", "lsp" }, + filetypes = { "uiua", "*.ua" }, } -vim.lsp.enable("deno") +vim.lsp.enable("uiua") -- CUSTOM LSP's -if kx_custom and vim.loop.os_uname().sysname == "Darwin" then - vim.api.nvim_create_autocmd("FileType", { - pattern = { "elixir", "typescript", "json" }, - callback = function() - vim.lsp.start({ - name = "hhn_lsp", - cmd = { vim.env.HOME .. "/git/hhn_lsp/bin/hhn_lsp" }, - root_dir = vim.fs.dirname(vim.fs.find({ ".git" }, { upward = true })[1]), - }) - end, - }) -end +-- vim.api.nvim_create_autocmd("FileType", { +-- pattern = { "elixir", "typescript", "json" }, +-- callback = function() +-- vim.lsp.start({ +-- name = "hhn_lsp", +-- cmd = { vim.env.HOME .. "/git/hhn_lsp/bin/hhn_lsp" }, +-- root_dir = vim.fs.dirname(vim.fs.find({ ".git" }, { upward = true })[1]), +-- }) +-- end, +-- }) if kx_custom and vim.loop.os_uname().sysname == "Linux" then vim.lsp.config["alsp"] = { cmd = { "alsp" }, diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index 2189718..f6c69e1 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -43,7 +43,7 @@ return { opts = { servers = { -- disable to prevent elixir extra to install it automatically - elixirls = false, + -- elixirls = false, }, }, }, @@ -305,10 +305,31 @@ return { -- Escape into Normal mode from Terminal mode map_combo("t", "jk", "") map_combo("t", "kj", "") + -- alt-k alt-j to navigate command line history + map_combo("t", "", "") + map_combo("t", "", "") end, }, { "OXY2DEV/markview.nvim", lazy = false, }, + { + "alanfortlink/blackjack.nvim", + opts = { + card_style = "large", -- Can be "mini" or "large". + suit_style = "black", -- Can be "black" or "white". + scores_path = vim.fn.stdpath("data") .. "/blackjack_scores.json", + keybindings = { + ["next"] = "j", + ["finish"] = "k", + ["quit"] = "q", + }, + }, + }, + { + "R-nvim/R.nvim", + -- Only required if you also set defaults.lazy = true + lazy = false, + }, } diff --git a/proxy.py b/proxy.py new file mode 100644 index 0000000..6e2a106 --- /dev/null +++ b/proxy.py @@ -0,0 +1,99 @@ +import json +import uuid +import requests +import time +import secrets + +from pathlib import Path +from http.server import BaseHTTPRequestHandler, HTTPServer + + +def get_copilot_token_from_neovim_vault(): + """Read Copilot token from Neovim's vault_state.json.""" + vault_path = Path.home() / ".local/share/lazyvim/gp/persisted/vault_state.json" + + try: + with open(vault_path, 'r') as f: + vault = json.load(f) + return vault['copilot_bearer']['token'] + except (FileNotFoundError, KeyError, json.JSONDecodeError) as e: + raise Exception(f"Failed to read Copilot token from vault: {e}") + + +def gen_hex_str(n): + return secrets.token_hex(n) + + +class CopilotOpenAIProxy(BaseHTTPRequestHandler): + DEFAULT_HEADERS = { + 'Editor-Version': "vscode/1.83.1", + 'Editor-Plugin-Version': "copilot-chat/0.8.0", + 'Openai-Organization': "github-copilot", + 'Openai-Intent': "conversation-panel", + 'Content-Type': "text/event-stream; charset=utf-8", + 'User-Agent': "GitHubCopilotChat/0.8.0", + 'Accept': "*/*", + 'Accept-Encoding': "gzip,deflate,br", + } + copilot_token = None + + def __init__(self, token): + self.copilot_token = token + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def request_id(self): + return gen_hex_str(4) + "-" + gen_hex_str(2) + "-" + gen_hex_str(2) + "-" + gen_hex_str(2) + "-" + gen_hex_str(6) + + def session_id(self): + return gen_hex_str(4) + "-" + gen_hex_str(2) + "-" + gen_hex_str(2) + "-" + gen_hex_str(2) + "-" + gen_hex_str(12) + + def machine_id(self): + return gen_hex_str(32) + + def do_POST(self): + if self.path != '/v1/chat/completions': + self.send_response( + requests.codes.method_not_allowed, "Method Not Allowed") + self.end_headers() + + return + + content_length = int(self.headers['Content-Length']) + body = self.rfile.read(content_length) + copilot_resp = self.copilot_request(body) + + if copilot_resp.status_code != requests.codes.ok: + self.send_response(copilot_resp.status_code) + self.end_headers() + + return + + self.send_response(requests.codes.ok) + self.end_headers() + self.wfile.write(copilot_resp.content) + print(copilot_resp.content) + + def copilot_request(self, body): + url = "https://api.githubcopilot.com/chat/completions" + + headers = self.DEFAULT_HEADERS.copy() + headers['Authorization'] = f'Bearer {self.copilot_token}' + headers['X-Request-ID'] = self.request_id() + headers['Vscode-Sessionid'] = self.session_id() + headers['Vscode-Machineid'] = self.machine_id() + + return requests.post(url, headers=headers, data=body) + pass + + +if __name__ == '__main__': + token = get_copilot_token_from_neovim_vault() + proxy = CopilotOpenAIProxy(token) + + server_address = ('127.0.0.1', 3040) + httpd = HTTPServer(server_address, proxy) + print("Proxy running at http://127.0.0.1:3040") + httpd.serve_forever() diff --git a/scripts/zellij-sesh b/scripts/zellij-sesh new file mode 100755 index 0000000..56732cb --- /dev/null +++ b/scripts/zellij-sesh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +# 1. Select a directory using zoxide's interactive selection +ZOXIDE_RESULT=$(zoxide query --interactive) + +# 2. Exit if no directory was selected +if [ -z "$ZOXIDE_RESULT" ]; then + exit 0 +fi + +# 3. Get the directory name to use as the session name +SESSION_NAME=$(basename "$ZOXIDE_RESULT" | tr . _) + +# 4. Check if the session already exists +SESSION_EXISTS=$(zellij list-sessions | grep -w "$SESSION_NAME") +--cwd "$ZOXIDE_RESULT" +# 5. Create or attach to the session +if [ -z "$SESSION_EXISTS" ]; then + # Create a new session in the selected directory + zellij attach --create "$SESSION_NAME" +else + # Attach to the existing session + zellij attach --create "$SESSION_NAME" +fi diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua new file mode 100644 index 0000000..e810a00 --- /dev/null +++ b/wezterm/wezterm.lua @@ -0,0 +1,31 @@ +local wezterm = require("wezterm") + +local config = {} + +config.color_scheme = "Batman" + +local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm") +workspace_switcher.zoxide_path = "/opt/homebrew/bin/zoxide" +workspace_switcher.apply_to_config(config) +config.leader = { key = "x", mods = "CTRL", timeout_milliseconds = 1000 } +config.keys = { + -- ... + -- your other keybindings + { + key = "s", + mods = "LEADER", + action = workspace_switcher.switch_workspace(), + }, + + { + key = "S", + mods = "LEADER", + action = workspace_switcher.switch_to_prev_workspace(), + }, + { + key = "m", + mods = "CMD", + action = wezterm.action.DisableDefaultAssignment, + }, +} +return config