matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.2k stars 56 forks source link

[Bug] Does not work on macos #49

Closed alex-popov-tech closed 2 years ago

alex-popov-tech commented 4 years ago

My config - https://github.com/alex-popov-tech/.dotfiles/blob/master/nvim/plugins/core.vim#L64-L69 Problem - plugin stopped working some time ago ( i feel lika A couple of weeks max ). Tried:

matze commented 4 years ago

Are you familiar with git bisect? If so, please go to ~/.local/share/nvim/plugged/vim-move and run git bisect start then git bisect bad to mark the current commit as bad and for example git bisect good HEAD@{10} to mark the 10th commit (including merge commits) as (one of the last) good commits. Then mark each commit that is checked out with either git bisect good or git bisect bad until Git tells you which commit caused the issue. To stop bisecting run git bisect reset.

alex-popov-tech commented 4 years ago

@matze hello, thanks for quick reply! The problem is - i tried a couple of olds commits like release 1.4 ( or even 1.3 ) and they did not work also But i will try anyways

alex-popov-tech commented 4 years ago

just checked with bisect - none of the commits works... also all the other commands - move line/char/block - do not work as well...

efikarl commented 4 years ago

@alex-popov-tech The same to you. Not work on mac, just install 3 days ago, and works that time, now not work.

  1. Checked with all tags and master lastest commit, not work for me.
  2. I removed all my other plugins and keep only vim-move, do step 1 test, still not works for me.
kevalin commented 4 years ago

I have the same issue on my mac.

alex-popov-tech commented 4 years ago

for mac users, here is snipped i use for moving lines up/down in normal and visual:

inoremap <S-Up> <Esc>:m .+1<CR>==gi
inoremap <S-Down> <Esc>:m .-2<CR>==gi
vnoremap <S-Up> :m '>+1<CR>gv=gv
vnoremap <S-Down> :m '<-2<CR>gv=gv
normen commented 3 years ago

I think theres an issue in the latest vim versions on MacOS, I have a <C-Up/Down> mapping to resize windows that also stopped working. Seems like either vim or MacOS broke proper support for the arrow keys..?

matze commented 3 years ago

Unfortunately, I really cannot help with these issues since I do not have a Mac. And frankly speaking I suspect this is more of an issue with MacOS' terminal keyboard handling than with this plugin or Vim. I mean that stuff never changed in the meantime.

finnng commented 3 years ago

for mac users, here is snipped i use for moving lines up/down in normal and visual:

inoremap <S-Up> <Esc>:m .+1<CR>==gi
inoremap <S-Down> <Esc>:m .-2<CR>==gi
vnoremap <S-Up> :m '>+1<CR>gv=gv
vnoremap <S-Down> :m '<-2<CR>gv=gv

The order of up/down should be reversed. I just copy your mapping and update a little to make alt+j and alt+k works on macOS.

" Move line up and down in normal mode and visual mode
noremap ∆ <Esc>:m .+1<CR>
noremap ˚ <Esc>:m .-2<CR>
vnoremap ∆ :m '>+1<CR>gv=gv
vnoremap ˚ :m '<-2<CR>gv=gv
normen commented 3 years ago

Unfortunately, I really cannot help with these issues since I do not have a Mac. And frankly speaking I suspect this is more of an issue with MacOS' terminal keyboard handling than with this plugin or Vim. I mean that stuff never changed in the meantime.

Nobody expects you to fix anything but this is probably the best place to keep all this info 🙂 Thanks for this plugin! ❤️

zetatez commented 3 years ago

for Mac users

noremap - dd2kp
noremap = ddp
vnoremap - :m '<-2<CR>gv=gv
vnoremap = :m '>+1<CR>gv=gv
alex-popov-tech commented 2 years ago

was fixed in #71