From a1252f60faf3f12eb7532a5841bb77dc423763a2 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 21 Jun 2023 11:35:57 +0200 Subject: [PATCH] fix: make up arrow autocomplete work with zsh-vi-mode --- configs/.zshrc | 15 ++--- configs/nvim/ftplugin/typescriptreact.lua | 37 ------------ configs/nvim/lazy-lock.json | 68 +++++++++++------------ 3 files changed, 42 insertions(+), 78 deletions(-) diff --git a/configs/.zshrc b/configs/.zshrc index 46e1aff..10a1d03 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -1,7 +1,6 @@ # Update Repo # source $HOME/.dotfiles/configs/zsh/update-repo.zsh - # p10k if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" @@ -14,6 +13,14 @@ if [ -d "$HOME/.asdf" ] ; then . "$HOME/.asdf/asdf.sh" fi +# THis should fix up arrow autocompletion with the zsh-vi-mode plugin +function zvm_before_init() { + zvm_bindkey viins '^[[A' history-beginning-search-backward + zvm_bindkey viins '^[[B' history-beginning-search-forward + zvm_bindkey vicmd '^[[A' history-beginning-search-backward + zvm_bindkey vicmd '^[[B' history-beginning-search-forward +} + if [ -f "$HOME/.config/zsh/antigen.zsh" ] ; then source $HOME/.config/zsh/antigen.zsh antigen use oh-my-zsh @@ -134,14 +141,8 @@ export PATH="$PNPM_HOME:$PATH" [ -n "$TMUX" ] && export TERM=tmux-256color -# tabtab source for packages -# uninstall by removing these lines -[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true # pnpm export PNPM_HOME="/home/max/.local/share/pnpm" export PATH="$PNPM_HOME:$PATH" # pnpm end - -# Fig post block. Keep at the bottom of this file. -[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh" diff --git a/configs/nvim/ftplugin/typescriptreact.lua b/configs/nvim/ftplugin/typescriptreact.lua index 1520c4e..d207009 100644 --- a/configs/nvim/ftplugin/typescriptreact.lua +++ b/configs/nvim/ftplugin/typescriptreact.lua @@ -1,38 +1 @@ -- ftplugin/vue.lua -vim.keymap.set('i', '/', function() - local node = vim.treesitter.get_node() - if not node then - return '/' - end - - local first_sibling_node = node:prev_named_sibling() - if not first_sibling_node then - return '/' - end - - local parent_node = node:parent() - local is_tag_writing_in_progress = node:type() == 'text' and parent_node:type() == 'element' - - local is_start_tag = first_sibling_node:type() == 'start_tag' - - local start_tag_text = vim.treesitter.get_node_text(first_sibling_node, 0) - local tag_is_already_terminated = string.match(start_tag_text, '>$') - - if - is_tag_writing_in_progress - and is_start_tag - and not tag_is_already_terminated - then - local char_at_cursor = vim.fn.strcharpart( - vim.fn.strpart(vim.fn.getline '.', vim.fn.col '.' - 2), - 0, - 1 - ) - local already_have_space = char_at_cursor == ' ' - - -- We can also automatically add a space if there isn't one already - return already_have_space and '/>' or ' />' - end - - return '/' -end, { expr = true, buffer = true }) diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index b7fa765..22b7d89 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -1,11 +1,11 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "51ebb4b6637290e1b8e0fb0d6f38b605d3c24940" }, - "alpha-nvim": { "branch": "main", "commit": "1838ae926e8d49fe5330d1498ee8289ae2c340bc" }, + "LuaSnip": { "branch": "master", "commit": "3d2ad0c0fa25e4e272ade48a62a185ebd0fe26c1" }, + "alpha-nvim": { "branch": "main", "commit": "9e33db324b8bb7a147bce9ea5496686ee859461d" }, "autolist.nvim": { "branch": "main", "commit": "0936e384b10315f65b8ef3bf1be938314d23a528" }, - "barbar.nvim": { "branch": "master", "commit": "af75ef12a5694d1596f26c4a1fe8aae09fb8c086" }, + "barbar.nvim": { "branch": "master", "commit": "c5e120848c1e505090684589b3adbedac9dcb893" }, "boole.nvim": { "branch": "main", "commit": "f4f9996f91159e54b8f1893b20e2e599c91bc1bd" }, - "catppuccin": { "branch": "main", "commit": "c9cc5a997f1dae3f35b4bdd62f35958fee363ab4" }, + "catppuccin": { "branch": "main", "commit": "ad6305594737e16155c41c176c611e865c26bb6d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, @@ -15,56 +15,56 @@ "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, "copilot.lua": { "branch": "master", "commit": "77e3a4907928f0813024e573b882dc879dfc0c6b" }, "flit.nvim": { "branch": "main", "commit": "f60e4b3d49bb5a5e97cfffe66f2e671eb422078e" }, - "friendly-snippets": { "branch": "main", "commit": "0dd6114bea08276d9111d58c5dce5e256bbc8921" }, + "friendly-snippets": { "branch": "main", "commit": "91dc01efa4cbb6d6a2b77eb98953b9a1d5c78f5f" }, "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, - "gitsigns.nvim": { "branch": "main", "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" }, - "lazy.nvim": { "branch": "main", "commit": "e6bf3a0d9c4899dcf832270f79bb1cee8fbc506e" }, - "leap.nvim": { "branch": "main", "commit": "be918a8e6aa00a6cfa7270d4bfcc11b2f80d6902" }, + "gitsigns.nvim": { "branch": "main", "commit": "3ef12dfdc293969fac736a7a580d6ae1f57ea406" }, + "lazy.nvim": { "branch": "main", "commit": "c1aad95243f0d180f41348be26b2417547fb168b" }, + "leap.nvim": { "branch": "main", "commit": "96f0f60baf037a3f91c8c725a0aad56094a73808" }, "lsp-format.nvim": { "branch": "master", "commit": "ca0df5c8544e51517209ea7b86ecc522c98d4f0a" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lspsaga.nvim": { "branch": "main", "commit": "c4e6259dda346babc71970bd00e03e211b44614d" }, + "lspsaga.nvim": { "branch": "main", "commit": "4f075452c466df263e69ae142f6659dcf9324bf6" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f0ce33f4794a2364eb08d09d09380e8b04ec5e6a" }, - "mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" }, - "mini.nvim": { "branch": "main", "commit": "81de16f854396094b4118d5d6eb660bd9a188cf5" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "8c89efb93b8383666a6f989762c2f610f5f2c930" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d381fcb78d7a562c3244e1c8f76406954649db36" }, + "mason.nvim": { "branch": "main", "commit": "f7f81ab41b153e2902ebded401a8a0a6abe28607" }, + "mini.nvim": { "branch": "main", "commit": "3a11a130bac227462dd226669d260c4bbe33fb5b" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "d883632bf8f92f1d5abea4a9c28fb2f90aa795aa" }, "neoai.nvim": { "branch": "main", "commit": "b90180e30d143afb71490b92b08c1e9121d4416a" }, - "neotest": { "branch": "master", "commit": "10e6763d0794c70917faf45e8d869a1306d5182e" }, + "neotest": { "branch": "master", "commit": "e46eae5739c470aa011ee43108ea8a730736174e" }, "neotest-jest": { "branch": "main", "commit": "22b1050dda3ebd401780ec4b8e193cf52523a4da" }, "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, - "noice.nvim": { "branch": "main", "commit": "7e358170cea2314d9768b3f63616e8fad186195e" }, - "nui.nvim": { "branch": "main", "commit": "2b2732528e4a79eb8542568bd51d25f710395bd6" }, - "null-ls.nvim": { "branch": "main", "commit": "c89333e034a8daba654ebfcf9a4ec9f87765f01e" }, - "nvim-cmp": { "branch": "main", "commit": "fc0f694af1a742ada77e5b1c91ff405c746f4a26" }, + "noice.nvim": { "branch": "main", "commit": "39461475d9de676bccc338876689c9e5b44bc932" }, + "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, + "null-ls.nvim": { "branch": "main", "commit": "bbaf5a96913aa92281f154b08732be2f57021c45" }, + "nvim-cmp": { "branch": "main", "commit": "fa492591fecdc41798cd5d3d1713232a5088fba0" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, - "nvim-dap": { "branch": "master", "commit": "56118cee6af15cb9ddba9d080880949d8eeb0c9f" }, + "nvim-dap": { "branch": "master", "commit": "a6d48d23407fbad7a4c1451803b8f34cab31c441" }, "nvim-dap-ui": { "branch": "master", "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-lspconfig": { "branch": "master", "commit": "9166622781a39a829878d1fd24c174529d996838" }, - "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" }, + "nvim-lspconfig": { "branch": "master", "commit": "a51892484c2002c083a8b0a9dfcefb3a569be36d" }, + "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-recorder": { "branch": "main", "commit": "0f6dec901a530c41095cff8def0c723877374cb4" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-toggleterm.lua": { "branch": "main", "commit": "cf146a267a6a7db62b1e2aff40414b20081048a1" }, - "nvim-treesitter": { "branch": "master", "commit": "56c63529c052a179134842c56c6df5728cc375da" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "95b76b95eff25e1e64f363938cd853852355d70a" }, - "nvim-ts-autotag": { "branch": "main", "commit": "40615e96075c743ef47aaf9de966dc348bec6459" }, + "nvim-treesitter": { "branch": "master", "commit": "19385830ab737f5c49a4cd44d0cdab5e5ee697d1" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "83c59ed1eeae70a55605990993cf4d208948fdf7" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" }, - "nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" }, - "oil.nvim": { "branch": "master", "commit": "64d2f305d30cec13938aa99f8f13bd84c502e020" }, - "persisted.nvim": { "branch": "main", "commit": "b42a8a87da7586e85ea37b31757c96e51fcf4db5" }, - "plenary.nvim": { "branch": "master", "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" }, + "nvim-web-devicons": { "branch": "master", "commit": "14b3a5ba63b82b60cde98d0a40319d80f25e8301" }, + "oil.nvim": { "branch": "master", "commit": "6f8bf067c09e96d6bff548b5e6addb6d9c25a678" }, + "persisted.nvim": { "branch": "main", "commit": "c384aa67067200001938338e8d32cb4261c99ba4" }, + "plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "rest.nvim": { "branch": "main", "commit": "c21eed6cbbc76e120a31b8eafa8f77c338bcbce7" }, - "sniprun": { "branch": "master", "commit": "83791b87a8ede5275a2c060605bf1fec782205cc" }, + "rest.nvim": { "branch": "main", "commit": "aea7c64bdff1073beed9bd7fddb60cce7796d7ff" }, + "sniprun": { "branch": "master", "commit": "28d55eeb6786a7037fd3564ced8296a71f1cece7" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, - "telescope.nvim": { "branch": "master", "commit": "6d3fbffe426794296a77bb0b37b6ae0f4f14f807" }, + "telescope.nvim": { "branch": "master", "commit": "00cf15074a2997487813672a75f946d2ead95eb0" }, "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, "translate.nvim": { "branch": "main", "commit": "35b71090a398eaca4d7cd2478f6a09d0fa3130bd" }, - "trouble.nvim": { "branch": "main", "commit": "324c977cfeacb8498ca9ba1c74cc35bd18858a8d" }, + "trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" }, "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, "vim-dadbod": { "branch": "master", "commit": "7d80bbd11c407a09e0f7b869c38f3dec3902805f" }, "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, - "vim-dadbod-ui": { "branch": "master", "commit": "36a67e67926345c0b11b32c378c057c7f9d9110d" }, - "which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" } + "vim-dadbod-ui": { "branch": "master", "commit": "200aebf70e6fc4b0eb1d3ecf0d57028e198d8dc6" }, + "which-key.nvim": { "branch": "main", "commit": "d871f2b664afd5aed3dc1d1573bef2fb24ce0484" } } \ No newline at end of file