vim: Implement <count>%
motion (#25839)
Closes https://github.com/zed-industries/zed/discussions/25665 > Currently Zed is missing quite an useful Vim motion: <count>% (go to {count} percentage in the file). Description: {count}% - Go to {count} percentage in the file, on the first non-blank in the line linewise. To compute the new line number this formula is used: ({count} * number-of-lines + 99) / 100 . > [Link](https://neovim.io/doc/user/motion.html#N%25). Release Notes: - vim: Added `<count>%` motion --------- Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
314ad5dd5f
commit
22b1a02e23
3 changed files with 152 additions and 1 deletions
26
crates/vim/test_data/test_go_to_percentage.json
Normal file
26
crates/vim/test_data/test_go_to_percentage.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{"Put":{"state":"The ˇquick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"0"}
|
||||
{"Key":"%"}
|
||||
{"Get":{"state":"The quick brown\nfox ˇjumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Key":"2"}
|
||||
{"Key":"5"}
|
||||
{"Key":"%"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps over\nthe ˇlazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Key":"7"}
|
||||
{"Key":"5"}
|
||||
{"Key":"%"}
|
||||
{"Get":{"state":"The quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe ˇquick brown\nfox jumps over\nthe lazy dog","mode":"Normal"}}
|
||||
{"Put":{"state":"The ˇquick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"5"}
|
||||
{"Key":"0"}
|
||||
{"Key":"%"}
|
||||
{"Get":{"state":"The «quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jˇ»umps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog","mode":"Visual"}}
|
||||
{"Put":{"state":"The ˇquick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog"}}
|
||||
{"Key":"v"}
|
||||
{"Key":"1"}
|
||||
{"Key":"0"}
|
||||
{"Key":"0"}
|
||||
{"Key":"%"}
|
||||
{"Get":{"state":"The «quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lazy dog\nThe quick brown\nfox jumps over\nthe lˇ»azy dog","mode":"Visual"}}
|
Loading…
Add table
Add a link
Reference in a new issue