diff --git a/init.lua b/init.lua index ea06955..28deffe 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,39 @@ -- load config -require("config.options") -require("config.keys") -require("config.autocmd") -require("config.lazy") -require("config.lsp") +require('config.options') +require('config.keys') +require('config.autocmd') +require('config.lazy') +require('config.lsp') + +vim.cmd([[ +" +" Intelligently navigate tmux panes and Vim splits using the same keys. +" This also supports SSH tunnels where Vim is running on a remote host. +" +" See https://sunaku.github.io/tmux-select-pane.html for documentation. + +function! TmuxNavigateDirections() abort + let [y, x] = win_screenpos('.') + let h = winheight('.') + let w = winwidth('.') + + let can_go_up = y > 2 " +1 for the tabline + let can_go_down = y + h < &lines - &laststatus + let can_go_left = x > 1 + let can_go_right = x + w < &columns + + return + \ (can_go_up ? 'U' : '') . + \ (can_go_down ? 'D' : '') . + \ (can_go_left ? 'L' : '') . + \ (can_go_right ? 'R' : '') +endfunction + +let progname = substitute($VIM, '.*[/\\]', '', '') +set title titlestring=%{progname}\ %f\ #%{TmuxNavigateDirections()} + +" enable support for setting the window title in regular Vim under tmux +if &term =~ '^screen' && !has('nvim') + execute "set t_ts=\e]2; t_fs=\7" +endif +]]) diff --git a/lazy-lock.json b/lazy-lock.json index d7b3af6..27d28ca 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,11 +1,10 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "better-escape.nvim": { "branch": "master", "commit": "19a38aab94961016430905ebec30d272a01e9742" }, "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "codesnap.nvim": { "branch": "main", "commit": "d8d55f5b62a6c12bc7756eb0b997a776eafd086e" }, - "conform.nvim": { "branch": "master", "commit": "5f5152fae39a57e3a04cbce09fb21e10c49c9d95" }, + "conform.nvim": { "branch": "master", "commit": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitignore.nvim": { "branch": "master", "commit": "0344f643768c4d64af4add8c1bdddf6f7d4c9010" }, "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, @@ -15,26 +14,26 @@ "lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" }, "lspsaga.nvim": { "branch": "main", "commit": "8efe00d6aed9db6449969f889170f1a7e43101a1" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "markview.nvim": { "branch": "main", "commit": "0a5033326f703d99a8788e2d47753d6298195e8a" }, + "markview.nvim": { "branch": "main", "commit": "03fe3f42093d47a8536276f682cf057f8c14033b" }, "mason-conform.nvim": { "branch": "main", "commit": "48da2ebd5efbaf8a99566eadc3ece82d523f03c5" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "8f1a3e6eecb638817e8999aaa16ada27cd54d867" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9f9c67795d0795a6e8612f5a899ca64a074a1076" }, "mason-nvim-lint": { "branch": "main", "commit": "767b8ccdddaa977bec8987fd7507b9865a279235" }, "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "mdx.nvim": { "branch": "main", "commit": "30222997ed4c0c7cc7447c4fce360fce87101bbf" }, - "mini.nvim": { "branch": "main", "commit": "6acb62618e2e7f1bf4f2e96e77a562ec80696f5e" }, + "mini.nvim": { "branch": "main", "commit": "7e55c3d2c04da134085a31156196836f80a89982" }, "neogen": { "branch": "main", "commit": "d7f9461727751fb07f82011051338a9aba07581d" }, "neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" }, "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, "nvim-genghis": { "branch": "main", "commit": "7e7a37e166b0244f12f9f78f96a36473704683ff" }, - "nvim-lint": { "branch": "master", "commit": "7a64f4067065c16a355d40d0d599b8ca6b25de6d" }, - "nvim-lspconfig": { "branch": "master", "commit": "d20d83b3f24f5884da73a9fc92fdc47e778b8d0d" }, + "nvim-lint": { "branch": "master", "commit": "1f19dacd945a7b1a57f29f32b2d7168384df3d36" }, + "nvim-lspconfig": { "branch": "master", "commit": "8973916a3d015d65a8c4614e141f4270a713cf33" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "tiny-code-action.nvim": { "branch": "main", "commit": "bd1773cb5b4232971f98a85e2b1637a84cd7f839" }, + "tiny-code-action.nvim": { "branch": "main", "commit": "897de9af9e3aa6e59bcb9fec760a7eb02d00e264" }, "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "d9d12d4bfb9a4c5b8b8bdf7f612551df6972946c" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, diff --git a/lua/plugins/util.lua b/lua/plugins/util.lua index 0ad4744..045f1c9 100644 --- a/lua/plugins/util.lua +++ b/lua/plugins/util.lua @@ -28,17 +28,17 @@ return { }, -- Navigator - { - 'numToStr/Navigator.nvim', - event = 'VeryLazy', - config = function() - require('Navigator').setup({ - auto_save = 'current', - disable_on_zoom = false, - mux = 'auto', - }) - end, - }, + -- { + -- 'numToStr/Navigator.nvim', + -- event = 'VeryLazy', + -- config = function() + -- require('Navigator').setup({ + -- auto_save = 'current', + -- disable_on_zoom = false, + -- mux = 'auto', + -- }) + -- end, + -- }, -- float terminal { @@ -62,7 +62,7 @@ return { shell = vim.o.shell, float_opts = { border = 'curved', -- 'single', 'double', 'shadow', etc. - winblend = 0, -- Set to 0 for full transparency + winblend = 0, -- Set to 0 for full transparency highlights = { border = 'Normal', background = 'Normal', @@ -93,16 +93,16 @@ return { picker_integration = true, keymaps = { prefix = 'u', -- Main prefix for uv commands - commands = true, -- Show uv commands menu (x) - run_file = true, -- Run current file (xr) + commands = true, -- Show uv commands menu (x) + run_file = true, -- Run current file (xr) run_selection = true, -- Run selected code (xs) - run_function = true, -- Run function (xf) - venv = true, -- Environment management (xe) - init = true, -- Initialize uv project (xi) - add = true, -- Add a package (xa) - remove = true, -- Remove a package (xd) - sync = true, -- Sync packages (xc) - sync_all = true, -- Sync all packages, extras and groups (xC) + run_function = true, -- Run function (xf) + venv = true, -- Environment management (xe) + init = true, -- Initialize uv project (xi) + add = true, -- Add a package (xa) + remove = true, -- Remove a package (xd) + sync = true, -- Sync packages (xc) + sync_all = true, -- Sync all packages, extras and groups (xC) }, }, }, diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua index 57a35d7..d609aa9 100644 --- a/lua/plugins/whichkey.lua +++ b/lua/plugins/whichkey.lua @@ -208,7 +208,6 @@ return { { 'sj', 'j', desc = 'Move Down' }, { 'sk', 'k', desc = 'Move Up' }, { 'sl', 'l', desc = 'Move Right' }, - { 'sp', ':NavigatorPrevious', desc = 'Previous Pane' }, { 'sq', 'c', desc = 'Close Split' }, { 'ss', ':vsplit', desc = 'Vertical Split' }, @@ -275,12 +274,6 @@ return { { '', ':vertical resize +10', desc = 'Increase window width' }, { '', ':resize +10', desc = 'Increase window height' }, - { '', ':NavigatorLeft', desc = 'Move Left' }, - { '', ':NavigatorDown', desc = 'Move Down' }, - { '', ':NavigatorUp', desc = 'Move Up' }, - { '', ':NavigatorRight', desc = 'Move Right' }, - { '', ':NavigatorPrevious', desc = 'Previous Pane' }, - -- { '', ':bprevious', desc = 'Previous Buffer' }, -- { '', ':bnext', desc = 'Next Buffer' }, { '', ':bnext', desc = 'Next Buffer' },