diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 42dff6a..94df304 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,75 +1,83 @@ { - "LuaSnip": { "branch": "master", "commit": "105b5f7f72c13e682a3aa5d29eac2408ae513b22" }, - "aerial.nvim": { "branch": "master", "commit": "79644dbedc189d79573b2a60e247989bbd8f16e7" }, + "LuaSnip": { "branch": "master", "commit": "c7984d1cca3d8615e4daefc196597872a0b8d590" }, + "aerial.nvim": { "branch": "master", "commit": "fb1f08c9f90e8b0c04b2f2c5d95d06288a14c5b2" }, + "ai.nvim": { "branch": "main", "commit": "d7391d4782b90ad3501f6f716f2b308092981787" }, "asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" }, - "auto-session": { "branch": "main", "commit": "21033c6815f249a7839c3a85fc8a6b44d74925c9" }, + "auto-session": { "branch": "main", "commit": "7afbb149f87be279778689596c781882014f7eef" }, "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, - "catppuccin": { "branch": "main", "commit": "12894370fa3c9e2200f3724c4184354d6b79733a" }, + "catppuccin": { "branch": "main", "commit": "3ffd2f511f3dc6c01258923d7170ccaf1445634b" }, + "ciderlsp-nvim": { "branch": "main", "commit": "45ee3634c6d4224c6981825da5bde39804addc71" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nvim-ciderlsp": { "branch": "main", "commit": "e1b0015a0c090e20d1cbb34e5639e6dd145d3f3e" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, - "cmp-tabnine": { "branch": "main", "commit": "b93f82ef5150e578677fc2e2b4b328b19eed77e1" }, "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" }, "crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" }, "formatter.nvim": { "branch": "master", "commit": "fa4f2729cc2909db599169f22d8e55632d4c8d59" }, - "friendly-snippets": { "branch": "main", "commit": "c85153a188b260b908bc35ffedff64810a930b64" }, - "fzf": { "branch": "master", "commit": "01302d097c39c3429de65424c6adb75fcac82187" }, + "friendly-snippets": { "branch": "main", "commit": "ca668b7a4a2913ad1109b5e4aaf0013651956b13" }, + "fzf": { "branch": "master", "commit": "547e101f1d6bf326d286bac0fb3272738a92a67f" }, "fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" }, "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, - "gitsigns.nvim": { "branch": "main", "commit": "a36bc3360d584d39b4fb076d855c4180842d4444" }, - "go.nvim": { "branch": "master", "commit": "97b76f3188c64d4dacfc17c7c1543f775a3fb8e8" }, + "gitsigns.nvim": { "branch": "main", "commit": "48c3ae8ec74cb83f9570ceb0c5ab8217db7a2220" }, + "go.nvim": { "branch": "master", "commit": "6550ddf5ce491d17af009c397aceb25310566eaa" }, "guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" }, + "hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" }, "java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, - "lazy.nvim": { "branch": "main", "commit": "f8611632d0f9c6818e8eb54f9bcd1dad122b5a7f" }, + "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" }, "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" }, "lsp-lens.nvim": { "branch": "main", "commit": "450736ecde76e4e127a7724ec8f6e260870863f8" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp-zero.nvim": { "branch": "v2.x", "commit": "52582fc91efb40ee347c20570ff7d32849ef4a89" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "0b4c5966884e80c5100c04790defe1fd72d918aa" }, "lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "luasnip-google.nvim": { "branch": "main", "commit": "5fd7feb144de0ecea837618c9c9e1bbecc0e3243" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "4f1c72767bec31397d59554f84096909b2887195" }, - "mason.nvim": { "branch": "main", "commit": "de5959dfc11688be554a53ac95d14bded9eaca4c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "796008869e67ef27a5aa5ac44c08ce2a60b89f55" }, + "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "f765e75e7d2444629b5ace3cd7609c12251de254" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "7f6fa04dbd8e8c79d1af33bc90e856b65d8641da" }, "nerdcommenter": { "branch": "master", "commit": "ab2ae4d502a26bc591db78a8548823ddd04bbc9c" }, "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, - "null-ls.nvim": { "branch": "main", "commit": "608547dcd1381ae791120674e105f5ebae25b37f" }, - "nvim-autopairs": { "branch": "master", "commit": "e8f7dd7a72de3e7b6626c050a802000e69d53ff0" }, - "nvim-cmp": { "branch": "main", "commit": "2743dd989e9b932e1b4813a4927d7b84272a14e2" }, - "nvim-lightbulb": { "branch": "master", "commit": "ca5b44a8efffb5fec1963ccd21f25ec04cc778b7" }, - "nvim-lspconfig": { "branch": "master", "commit": "0011c435282f043a018e23393cae06ed926c3f4a" }, + "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, + "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, + "nvim-lightbulb": { "branch": "master", "commit": "bb9ec720aa998252951627f811e8f39b76789e0a" }, + "nvim-lspconfig": { "branch": "master", "commit": "deade69789089c3da15237697156334fb3e943f0" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, - "nvim-treesitter": { "branch": "master", "commit": "c42a8f96d37be82cf32934c4351150d7736f93f5" }, + "nvim-treesitter": { "branch": "master", "commit": "575f5a4b1fcb60c1ac4f560c46a5171454d674ca" }, "nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" }, - "plenary.nvim": { "branch": "master", "commit": "102c02903c74b93c705406bf362049383abc87c8" }, - "refactoring.nvim": { "branch": "master", "commit": "859289acc0fda13bf42834dbeef10b8c1148d444" }, + "nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" }, + "plenary.nvim": { "branch": "master", "commit": "bda256fab0eb66a15e8190937e417e6a14ee5d72" }, + "refactoring.nvim": { "branch": "master", "commit": "56b747d1be0aa5cecddf85e6f3ca2aed6797edef" }, "registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" }, - "rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" }, - "telekasten.nvim": { "branch": "main", "commit": "eb1d228e8d97437fa763ab1c6fcc1ab572d7ce7a" }, + "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, + "telekasten.nvim": { "branch": "main", "commit": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "e03ff55962417b69c85ef41424079bb0580546ba" }, - "telescope.nvim": { "branch": "master", "commit": "0e0600908d1ad5ac4992fa0ab578e23e9d9d6f37" }, + "telescope.nvim": { "branch": "master", "commit": "276362a8020c6e94c7a76d49aa00d4923b0c02f3" }, + "telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" }, + "telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" }, + "telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" }, "trouble.nvim": { "branch": "main", "commit": "d99e2abd10808ef91738ce98a5c767e6a51df449" }, - "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, + "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, "vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" }, "vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" }, + "vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" }, "vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" }, - "vim-matchup": { "branch": "master", "commit": "61cef7921ecbb412f341a6d1a7f9ad1ca55243de" }, + "vim-matchup": { "branch": "master", "commit": "17cc05867cb3314761e4baa20115a27120f8e82c" }, "vim-ripgrep": { "branch": "master", "commit": "2bb2425387b449a0cd65a54ceb85e123d7a320b8" }, "vim-searchindex": { "branch": "master", "commit": "b0788c8213210b3bd23b62847dd5a9ebbe4ad648" }, "vim-signify": { "branch": "master", "commit": "7d538b77a5a8806e344b057f8846f6d0c035efa9" }, diff --git a/config/.config/nvim/spell/en.utf-8.add b/config/.config/nvim/spell/en.utf-8.add index 41de73f..1630e1a 100644 --- a/config/.config/nvim/spell/en.utf-8.add +++ b/config/.config/nvim/spell/en.utf-8.add @@ -3,3 +3,4 @@ handlePackageIntent for/! tooling/! createApkDescriptor +setInstance diff --git a/config/.config/nvim/spell/en.utf-8.add.spl b/config/.config/nvim/spell/en.utf-8.add.spl index 8b9bf8a..1149dec 100644 Binary files a/config/.config/nvim/spell/en.utf-8.add.spl and b/config/.config/nvim/spell/en.utf-8.add.spl differ diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 539c97b..360f025 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -74,14 +74,8 @@ bind-key -Tcopy-mode-vi 'v' send -X begin-selection # transfer copied text to attached terminal with yank bind-key -T copy-mode-vi y send-keys -X copy-pipe 'yank > #{pane_tty}' -# transfer copied text to attached terminal with yank -bind-key -T copy-mode-vi Y send-keys -X copy-pipe 'yank > #{pane_tty}' - -# transfer most-recently copied text to attached terminal with yank -bind-key -n M-y run-shell 'tmux save-buffer - | yank > #{pane_tty}' - -# transfer previously copied text (chosen from a menu) to attached terminal -bind-key -n M-Y choose-buffer 'run-shell "tmux save-buffer -b \"%%%\" - | yank > #{pane_tty}"' +# # transfer copied text to attached terminal with yank +# bind-key -T copy-mode-vi Y send-keys -X copy-pipe 'yank > #{pane_tty}' # Bind ']' to use pbpaste #bind ] run "pbpaste | tmux load-buffer - && tmux paste-buffer" @@ -123,7 +117,7 @@ bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 bind-key -r < swap-window -t -1\; select-window -t -1 bind-key -r > swap-window -t +1\; select-window -t +1 - # loop through current window's panes while zoomed +# loop through current window's panes while zoomed bind -r "'" select-pane -t .+1 \; resize-pane -Z bind -r ";" select-pane -t .-1 \; resize-pane -Z diff --git a/tmux/.tmux/plugins/tmux-cpu/scripts/helpers.sh b/tmux/.tmux/plugins/tmux-cpu/scripts/helpers.sh index b669418..c5b5f37 100644 --- a/tmux/.tmux/plugins/tmux-cpu/scripts/helpers.sh +++ b/tmux/.tmux/plugins/tmux-cpu/scripts/helpers.sh @@ -130,8 +130,10 @@ put_cache_val() { val="${*:2}" tmpdir="$(get_tmp_dir)" [ ! -d "$tmpdir" ] && mkdir -p "$tmpdir" && chmod 0700 "$tmpdir" - get_time >"$tmpdir/$key" - echo -n "$val" >>"$tmpdir/$key" + ( + get_time + echo -n "$val" + ) >"$tmpdir/$key" echo -n "$val" } diff --git a/tmux/.tmux/plugins/tpm/CHANGELOG.md b/tmux/.tmux/plugins/tpm/CHANGELOG.md index 394758d..a9ce81e 100644 --- a/tmux/.tmux/plugins/tpm/CHANGELOG.md +++ b/tmux/.tmux/plugins/tpm/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ### master + +### v3.1.0, 2023-01-03 - upgrade to new version of `tmux-test` - bug: when using `emacs` copy mode, Enter does not quit screen after tpm installation/update. Fix by making `Escape` the key for emacs mode. @@ -9,6 +11,7 @@ line endings - helps with misconfigured git on windows/cygwin - readme update: announce Cygwin support - un-deprecate old plugin definition syntax: `set -g @tpm_plugins` +- More stuff, check `git log`. ### v3.0.0, 2015-08-03 - refactor `shared_set_tpm_path_constant` function diff --git a/tmux/.tmux/plugins/tpm/README.md b/tmux/.tmux/plugins/tpm/README.md index fe90855..2371863 100644 --- a/tmux/.tmux/plugins/tpm/README.md +++ b/tmux/.tmux/plugins/tpm/README.md @@ -15,7 +15,7 @@ Requirements: `tmux` version 1.9 (or higher), `git`, `bash`. Clone TPM: ```bash -$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm +git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm ``` Put this at the bottom of `~/.tmux.conf` (`$XDG_CONFIG_HOME/tmux/tmux.conf` @@ -40,7 +40,7 @@ Reload TMUX environment so TPM is sourced: ```bash # type this in terminal if tmux is already running -$ tmux source ~/.tmux.conf +tmux source ~/.tmux.conf ``` That's it! @@ -93,7 +93,7 @@ Run tests with: ```bash # within project directory -$ ./run_tests +./run_tests ``` ### License diff --git a/tmux/.tmux/plugins/tpm/docs/tpm_not_working.md b/tmux/.tmux/plugins/tpm/docs/tpm_not_working.md index bfa14ac..6680291 100644 --- a/tmux/.tmux/plugins/tpm/docs/tpm_not_working.md +++ b/tmux/.tmux/plugins/tpm/docs/tpm_not_working.md @@ -85,12 +85,18 @@ find ~/.tmux -type d -name '.git*' -prune -o -type f -print0 | xargs -0 dos2unix Related: [issue #67](https://github.com/tmux-plugins/tpm/issues/67) -This problem is because tmux's `run-shell` command runs a shell which doesn't read from user configs, thus tmux installed in `/usr/local/bin` will not be found. +This problem is because tmux's `run-shell` command runs a shell which doesn't read from user configs, thus tmux installed in a brew prefix (e.g. `/usr/local/bin`) will not be found. -The solution is to insert the following line: +The solution is to find your brew prefix +```sh +> echo "$(brew --prefix)/bin" +/opt/homebrew/bin ``` -set-environment -g PATH "/usr/local/bin:/bin:/usr/bin" + +And prepend it to the `PATH` environment variable +``` +set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin" ``` before any `run-shell`/`run` commands in `~/.tmux.conf`. diff --git a/tmux/.tmux/plugins/tpm/scripts/update_plugin.sh b/tmux/.tmux/plugins/tpm/scripts/update_plugin.sh index 68bf605..e533664 100755 --- a/tmux/.tmux/plugins/tpm/scripts/update_plugin.sh +++ b/tmux/.tmux/plugins/tpm/scripts/update_plugin.sh @@ -26,10 +26,15 @@ pull_changes() { } update() { - local plugin="$1" - $(pull_changes "$plugin" > /dev/null 2>&1) && - echo_ok " \"$plugin\" update success" || + local plugin="$1" output + output=$(pull_changes "$plugin" 2>&1) + if (( $? == 0 )); then + echo_ok " \"$plugin\" update success" + echo_ok "$(echo "$output" | sed -e 's/^/ | /')" + else echo_err " \"$plugin\" update fail" + echo_err "$(echo "$output" | sed -e 's/^/ | /')" + fi } update_all() { diff --git a/tmux/.tmux/plugins/vim-tmux-navigator/README.md b/tmux/.tmux/plugins/vim-tmux-navigator/README.md index 256dd98..08adb42 100644 --- a/tmux/.tmux/plugins/vim-tmux-navigator/README.md +++ b/tmux/.tmux/plugins/vim-tmux-navigator/README.md @@ -66,7 +66,7 @@ Add the following to your `~/.tmux.conf` file: # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' @@ -199,6 +199,22 @@ With this enabled you can use ` C-l` to clear the screen. Thanks to [Brian Hogan][] for the tip on how to re-map the clear screen binding. +#### Restoring SIGQUIT (C-\\) + +The default key bindings also include `` which is the default method of +sending SIGQUIT to a foreground process. Similar to "Clear Screen" above, a key +binding can be created to replicate SIGQUIT in the prefix table. + +``` tmux +bind C-\\ send-keys 'C-\' +``` + +Alternatively, you can exclude the previous pane key binding from your `~/.tmux.conf`. If using TPM, the following line can be used to unbind the previous pane binding set by the plugin. + +``` tmux +unbind -n C-\\ +``` + #### Disable Wrapping By default, if you tru to move past the edge of the screen, tmux/vim will @@ -210,11 +226,12 @@ For vim, you only need to enable this option: let g:tmux_navigator_no_wrap = 1 ``` -Tmux doesn't haave an option, so whatever key bindings you have need to be set +Tmux doesn't have an option, so whatever key bindings you have need to be set to conditionally wrap based on position on screen: + ```tmux is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" bind-key -n 'C-h' if-shell "$is_vim" { send-keys C-h } { if-shell -F '#{pane_at_left}' {} { select-pane -L } } bind-key -n 'C-j' if-shell "$is_vim" { send-keys C-j } { if-shell -F '#{pane_at_bottom}' {} { select-pane -D } } bind-key -n 'C-k' if-shell "$is_vim" { send-keys C-k } { if-shell -F '#{pane_at_top}' {} { select-pane -U } } @@ -256,6 +273,56 @@ bind -r C-l run "tmux select-pane -R" bind -r C-\ run "tmux select-pane -l" ``` +Another workaround is to configure tmux on the outer machine to send keys to +the inner tmux session: + +``` +bind-key -n 'M-h' 'send-keys c-h' +bind-key -n 'M-j' 'send-keys c-j' +bind-key -n 'M-k' 'send-keys c-k' +bind-key -n 'M-l' 'send-keys c-l' +``` + +Here we bind "meta" key (aka "alt" or "option" key) combinations for each of +the four directions and send those along to the innermost session via +`send-keys`. You use the normal `C-h,j,k,l` while in the outermost session and +the alternative bindings to navigate the innermost session. Note that if you +use the example above on a Mac, you may need to configure your terminal app to +get the option key to work like a normal meta key. Consult your terminal app's +manual for details. + +A third possible solution is to manually prevent the outermost tmux session +from intercepting the navigation keystrokes by disabling the prefix table: + +``` +set -g pane-active-border-style 'fg=#000000,bg=#ffff00' +bind -T root F12 \ + set prefix None \;\ + set key-table off \;\ + if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\ + set -g pane-active-border-style 'fg=#000000,bg=#00ff00' + refresh-client -S \;\ + +bind -T off F12 \ + set -u prefix \;\ + set -u key-table \;\ + set -g pane-active-border-style 'fg=#000000,bg=#ffff00' + refresh-client -S +``` + +This code, added to the machine running the outermost tmux session, toggles the +outermost prefix table on and off with the `F12` key. When off, the active +pane's border changes to green to indicate that the inner session receives +navigation keystrokes. When toggled back on, the border returns to yellow and +normal operation resumes and the outermost responds to the nav keystrokes. + +The code example above also toggles the prefix key (ctrl-b by default) for the +outer session so that same prefix can be temporarily used on the inner session +instead of having to use a different prefix (ctrl-a by default) which you may +find convenient. If not, simply remove the lines that set/unset the prefix key +from the code example above. + + Troubleshooting --------------- @@ -316,6 +383,34 @@ detail. [tmate]: http://tmate.io/ +### Switching between host panes doesn't work when docker is running + +Images built from minimalist OSes may not have the `ps` command or have a +simpler version of the command that is not compatible with this plugin. +Try installing the `procps` package using the appropriate package manager +command. For Alpine, you would do `apk add procps`. + +If this doesn't solve your problem, you can also try the following: + +Replace the `is_vim` variable in your `~/.tmux.conf` file with: +```tmux +if-shell '[ -f /.dockerenv ]' \ + "is_vim=\"ps -o state=,comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'\"" + # Filter out docker instances of nvim from the host system to prevent + # host from thinking nvim is running in a pseudoterminal when its not. + "is_vim=\"ps -o state=,comm=,cgroup= -t '#{pane_tty}' \ + | grep -ivE '^.+ +.+ +.+\\/docker\\/.+$' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)? +'\"" +``` + +Details: The output of the ps command on the host system includes processes +running within containers, but containers have their own instances of +/dev/pts/\*. vim-tmux-navigator relies on /dev/pts/\* to determine if vim is +running, so if vim is running in say /dev/pts/ in a container and there is a +tmux pane (not running vim) in /dev/pts/ on the host system, then without +the patch above vim-tmux-navigator will think vim is running when its not. + ### It Still Doesn't Work!!! The tmux configuration uses an inlined grep pattern match to help determine if diff --git a/tmux/.tmux/plugins/vim-tmux-navigator/pattern-check b/tmux/.tmux/plugins/vim-tmux-navigator/pattern-check index c5ecbb6..4e14979 100644 --- a/tmux/.tmux/plugins/vim-tmux-navigator/pattern-check +++ b/tmux/.tmux/plugins/vim-tmux-navigator/pattern-check @@ -11,8 +11,8 @@ GREEN=$(tput setaf 2) YELLOW=$(tput setaf 3) NORMAL=$(tput sgr0) -vim_pattern='(^|\/)g?(view|n?vim?x?)(diff)?$' -match_tests=(vim Vim VIM vimdiff /usr/local/bin/vim vi gvim view gview nvim vimx) +vim_pattern='(^|\/)g?(view|l?n?vim?x?)(diff)?$' +match_tests=(vim Vim VIM vimdiff lvim /usr/local/bin/vim vi gvim view gview nvim vimx) no_match_tests=( /Users/christoomey/.vim/thing /usr/local/bin/start-vim ) display_matches() { diff --git a/tmux/.tmux/plugins/vim-tmux-navigator/vim-tmux-navigator.tmux b/tmux/.tmux/plugins/vim-tmux-navigator/vim-tmux-navigator.tmux index 0aeac55..aea2522 100755 --- a/tmux/.tmux/plugins/vim-tmux-navigator/vim-tmux-navigator.tmux +++ b/tmux/.tmux/plugins/vim-tmux-navigator/vim-tmux-navigator.tmux @@ -3,7 +3,7 @@ version_pat='s/^tmux[^0-9]*([.0-9]+).*/\1/p' is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ - | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" tmux bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" tmux bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" tmux bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" diff --git a/vim/.vim/lua/config/google-comments.lua b/vim/.vim/lua/config/google-comments.lua deleted file mode 100644 index b6a513e..0000000 --- a/vim/.vim/lua/config/google-comments.lua +++ /dev/null @@ -1,59 +0,0 @@ --- Here are all the options and their default values: -require("google.comments").setup({ - -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"}, - -- stubby = true, - command = { - "/google/bin/releases/editor-devtools/get_comments.par", - "--json", - "--full", - "--noresolved", - "--cl_comments", - "--file_comments", - }, - -- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'}, - -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. - -- See :help sign_define - -- The sign property passed to setup should be the 'ICON_NAME' in the define - -- example above. - sign = "COMMENT_ICON", - -- Fetch the comments after calling `setup`. - auto_fetch = true, - display = { - -- The width of the comment display window. - width = 50, - -- When showing file paths, use relative paths or not. - relative_path = true, - --- Enable viewing comments through floating window - floating = true, - --- Options used when creating the floating window. - floating_window_options = floating_window_options, - }, -}) - -function floating_window_options(parent_win_id) - local parent_width = vim.api.nvim_win_get_width(parent_win_id) - local parent_height = vim.api.nvim_win_get_height(parent_win_id) - - return { - relative = "win", - anchor = "NW", - width = math.floor(parent_width * 0.5), - height = math.floor(parent_height * 0.3), - row = vim.api.nvim_win_get_cursor(parent_win_id)[1], - col = math.floor(parent_width * 0.25), - border = "rounded", - } -end - -local map = require("utils").map --- here are some mappings you might want: -map("n", "]c", [[GoogleCommentsGotoNextComment]]) -map("n", "[c", [[GoogleCommentsGotoPrevComment]]) - -map("n", "nc", [[GoogleCommentsGotoNextComment]]) -map("n", "pc", [[GoogleCommentsGotoPrevComment]]) -map("n", "lc", [[GoogleCommentsToggleLineComments]]) -map("n", "ac", [[GoogleCommentsToggleAllComments]]) -map("n", "fc", [[GoogleCommentsFetchComments]]) - -vim.fn.sign_define("COMMENT_ICON", { text = "" }) diff --git a/vim/.vim/lua/plugins/cmp.lua b/vim/.vim/lua/plugins/cmp.lua index 804e5ab..368bbc0 100644 --- a/vim/.vim/lua/plugins/cmp.lua +++ b/vim/.vim/lua/plugins/cmp.lua @@ -23,25 +23,6 @@ return { "hrsh7th/nvim-cmp", }, }, - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = function() - local autopairs = require("nvim-autopairs") - - autopairs.setup({ - check_ts = true, -- treesitter integration - disable_filetype = { "TelescopePrompt" }, - }) - - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local cmp_status_ok, cmp = pcall(require, "cmp") - if not cmp_status_ok then - return - end - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) - end, - }, { "hrsh7th/nvim-cmp", event = "VimEnter", @@ -49,6 +30,7 @@ return { "f3fora/cmp-spell", "hrsh7th/cmp-buffer", "hrsh7th/cmp-calc", + "onsails/lspkind.nvim", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-emoji", "hrsh7th/cmp-nvim-lsp", @@ -108,8 +90,7 @@ return { cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = "nvim_lsp_document_symbol" }, - { name = "path" }, + { name = "path", priority = 9 }, { name = "cmdline" }, }), }) @@ -159,6 +140,7 @@ return { sorting = { comparators = { + cmp.config.compare.priority, cmp.config.compare.offset, cmp.config.compare.exact, cmp.config.compare.score, @@ -167,7 +149,6 @@ return { cmp.config.compare.sort_text, cmp.config.compare.length, cmp.config.compare.order, - cmp.config.compare.priority, }, }, @@ -179,7 +160,7 @@ return { formatting = { format = lspkind.cmp_format({ - mode = "symbol_text", + -- mode = "symbol_text", -- before = function(entry, vim_item) -- if entry.source.name == "nvim_ciderlsp" then -- if entry.completion_item.is_multiline then diff --git a/vim/.vim/lua/plugins/formatter.lua b/vim/.vim/lua/plugins/formatter.lua index 7515c08..5c57c98 100644 --- a/vim/.vim/lua/plugins/formatter.lua +++ b/vim/.vim/lua/plugins/formatter.lua @@ -17,7 +17,49 @@ return { lua = { -- "formatter.filetypes.lua" defines default configurations for the -- "lua" filetype - require("formatter.filetypes.lua").stylua, + -- require("formatter.filetypes.lua").stylua, + -- You can also define your own configuration + function() + -- Supports conditional formatting + if util.get_current_buffer_file_name() == "special.lua" then + return nil + end + + -- Full specification of configurations is down below and in Vim help + -- files + return { + exe = "stylua", + args = { + "--search-parent-directories", + "--stdin-filepath", + util.escape_path(util.get_current_buffer_file_path()), + "--", + "-", + }, + stdin = true, + } + end, + }, + + html = { + require("formatter.defaults").prettier, + }, + xml = { + function() + return { + exe = "tidy", + args = { + "-quiet", + "-xml", + "--indent auto", + "--indent-spaces 2", + "--verical-space yes", + "--tidy-mark no", + }, + stdin = true, + try_node_modules = true, + } + end, }, -- Use the special "*" filetype for defining formatter configurations on diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 4e46837..5000928 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -115,10 +115,71 @@ return { }, { name = "google_comments", - url = "sso://googler@user/chmnchiang/google-comments", + -- url = "sso://googler@user/chmnchiang/google-comments", + dir = "/google/src/cloud/cnieves/google-comments/google3/experimental/users/chmnchiang/neovim/google-comments/", dependencies = { "rcarriga/nvim-notify", "nvim-lua/plenary.nvim" }, config = function() - require("config.google-comments") + -- Here are all the options and their default values: + require("google.comments").setup({ + -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"}, + -- stubby = true, + command = { + "/google/bin/releases/editor-devtools/get_comments.par", + "--json", + "--full", + "--noresolved", + "--cl_comments", + "--file_comments", + }, + -- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'}, + -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. + -- See :help sign_define + -- The sign property passed to setup should be the 'ICON_NAME' in the define + -- example above. + sign = "COMMENT_ICON", + -- Fetch the comments after calling `setup`. + auto_fetch = true, + display = { + -- CTN + virtual_text = true, + -- The width of the comment display window. + width = 50, + -- When showing file paths, use relative paths or not. + relative_path = true, + --- Enable viewing comments through floating window + floating = true, + --- Options used when creating the floating window. + floating_window_options = floating_window_options, + }, + }) + + function floating_window_options(parent_win_id) + local parent_width = vim.api.nvim_win_get_width(parent_win_id) + local parent_height = vim.api.nvim_win_get_height(parent_win_id) + + return { + relative = "win", + anchor = "NW", + width = math.floor(parent_width * 0.5), + height = math.floor(parent_height * 0.3), + row = vim.api.nvim_win_get_cursor(parent_win_id)[1], + col = math.floor(parent_width * 0.25), + border = "rounded", + } + end + + local map = require("utils").map + -- here are some mappings you might want: + map("n", "]c", [[GoogleCommentsGotoNextComment]]) + map("n", "[c", [[GoogleCommentsGotoPrevComment]]) + + map("n", "nc", [[GoogleCommentsGotoNextComment]]) + map("n", "pc", [[GoogleCommentsGotoPrevComment]]) + map("n", "lc", [[GoogleCommentsToggleLineComments]]) + map("n", "ac", [[GoogleCommentsToggleAllComments]]) + map("n", "fc", [[GoogleCommentsFetchComments]]) + + vim.fn.sign_define("COMMENT_ICON", { text = "" }) end, }, { diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index 13682da..34ba894 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -160,6 +160,7 @@ return { local opts = { noremap = true, silent = true } vim.api.nvim_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", opts) vim.api.nvim_set_keymap("n", "ca", "lua vim.lsp.buf.code_action()", opts) + vim.api.nvim_set_keymap("v", "ca", "lua vim.lsp.buf.code_action()", opts) vim.api.nvim_set_keymap("n", "L", "lua vim.lsp.buf.hover()", opts) vim.api.nvim_set_keymap("n", "g0", "lua vim.lsp.buf.document_symbol()", opts) vim.api.nvim_set_keymap("n", "gW", "lua vim.lsp.buf.workspace_symbol()", opts) diff --git a/vim/.vim/lua/plugins/lualine.lua b/vim/.vim/lua/plugins/lualine.lua index f560a83..3241bcf 100644 --- a/vim/.vim/lua/plugins/lualine.lua +++ b/vim/.vim/lua/plugins/lualine.lua @@ -101,6 +101,13 @@ return { }, }, -- lualine_y = { getLGTMs } + lualine_z = { + { + "filename", + file_status = false, -- displays file status (readonly status, modified status) + path = 2, -- 0 = just filename, 1 = relative path, 2 = absolute path + }, + }, }, }) end, diff --git a/vim/.vimrc b/vim/.vimrc index 3261029..4f42b66 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -15,7 +15,6 @@ set formatoptions+=j set nowritebackup au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") -autocmd BufWritePre * StripWhitespace set termguicolors let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" diff --git a/zsh/.bash_profile b/zsh/.bash_profile index f693ea5..17b774a 100644 --- a/zsh/.bash_profile +++ b/zsh/.bash_profile @@ -27,3 +27,8 @@ if [[ -f "$HOME/use_google" ]]; then source $HOME/.bash_profile.google fi . "$HOME/.cargo/env" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + diff --git a/zsh/.zshrc b/zsh/.zshrc index f4bfcc8..866fed8 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -267,3 +267,7 @@ source ~/.bash_profile alias luamake=/luamake export PATH="/opt/homebrew/opt/openjdk/bin:$PATH" export PATH="$HOME/.local/bin:$PATH" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion