Comments (4)
Hm, it sounds interesting but there are some semantics we'd have to nail down.
move_cursor_or_split
, how does this work with config.wrap_at_edge = true
?
split_longest_side
should be relatively easy, basically:
local win = vim.api.nvim_get_current_win()
if vim.api.nvim_win_get_height(win) > vim.api.nvim_win_get_height(win) then
vim.cmd('sp')
else
vim.cmd('vsp')
end
Could you expand on how you see the semantics of move_cursor_or_split
working, especially with relation to config.wrap_at_edge = true
?
Consider also that there may be a mux window past the edge of the current Neovim split that we can move to. What happens if you move_cursor_or_split
from a pane that is at the edge of Neovim, but there is a mux window next to it? Do we move to the mux window, or do we split?
from smart-splits.nvim.
wrap_at_edge I think should just not be respected by move_or_split. Maybe have change wrap_at_edge to at_edge="wrap" and have at_edge="split"? That is probably more consistent considering you don't have move_or_wrap. As long as at_edge can be chosen at keybinding time so the user can have all of the behaviors to different keys if they want
The semantics are basically move if possible and if there isn't a place to move, make a split. A mux window counts as a place to move so it should probably move. Wait how do mux windows interact with the wrap_at_edge config? It just goes to the mux window right?
True, split_longest_side does seem simple, any reason not to include it anyway to help users? It could get a bit more complicated to handle running a command after like :SplitLongest edit some_file
from smart-splits.nvim.
Wait how do mux windows interact with the wrap_at_edge config? It just goes to the mux window right?
Yeah, basically, when you're at a Neovim edge, the exact implementation varies per mux backend (tmux vs. Wezterm vs. Kitty) but it checks in some way if there is a mux window we can move to, and if not, then it wraps to the other side of Neovim.
Maybe have change wrap_at_edge to at_edge="wrap" and have at_edge="split"?
I try to avoid breaking changes if at all possible, but I suppose that's possible. I made a similar change when adding other mux backends, had config auto migrate itself, and printed a deprecation notice, which we could also do for this (wrap_at_edge = true
would migrate to at_edge = 'wrap'
). We'd need to include at_edge="stop"
or something as well, in case you want neither of those behaviors.
from smart-splits.nvim.
Yeah, split, wrap and stop sounds correct.
from smart-splits.nvim.
Related Issues (20)
- [Meta]: Add a Nix flake for development HOT 2
- [Bug]: Wezterm should set user var `IS_NVIM=false` on `VimLeavePre` instead of `ExitPre`, and also when suspended HOT 2
- [Bug]: Navigation via tmux not working after tmux pane resized HOT 44
- [Bug]: Cannot get tmux pane ID HOT 2
- [Bug]: floating neovim windows should not be resized HOT 7
- [Bug]: Resize mode is deleting my global keymaps that remap j and k to gj and gk HOT 2
- [Bug]: Wezterm navigation not working HOT 12
- [Feature]: Something like an accordion mode for smart resizing of splits HOT 2
- [Bug]: Neovide (or other UI?) run from WezTerm leads to error in integration logic HOT 9
- Performance issues with Wezterm integration HOT 18
- [Feature]: Add commands for buffer swap HOT 1
- [Bug]: After splitting the window in kitty, open nvim on both sides and use require('smart-splits').move_cursor_right which is invalid. HOT 13
- [Feature]: Improve mux auto-detection and make lookup more flexible
- Use wezterm.plugin.require() for easy install on wezterm HOT 4
- [Feature]: kitty pass_keys.py remove the use of regulars and instead use the kitty api HOT 1
- [Feature]: Does it support warp terminal? HOT 2
- [Bug]: Wezterm Unable to move jumps properly HOT 6
- [Bug]: Is impossible to set `Previous` using <C-\> HOT 10
- [Bug]: System exit > 0 after upgrade to v1.3.1 (v1.3.0 works fine) HOT 11
- [Bug]: Switching between neovim and wezterm panes when using wezterm ssh client does not work HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart-splits.nvim.