Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How do I move selected lines in visual mode? #208

Open
1 task done
sesm opened this issue Jan 14, 2024 · 1 comment
Open
1 task done

[question] How do I move selected lines in visual mode? #208

sesm opened this issue Jan 14, 2024 · 1 comment

Comments

@sesm
Copy link

sesm commented Jan 14, 2024

Please make sure your question is within the scope of this plugin.

  • I know this plugin is about persisting changes to the Vim support built into Obsidian, plus some bonus features, and considered asking in the Obsidian forum first.

Describe the question
In my .vimrc I have the following:

" Use J and K to move text blocks in visual mode
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv

When I try to copy this to .obsidian.vimrc, I'm getting the following error when I try to use J or K:

Not and editor command ":m"

How do I fix it? Or maybe there is an alternative way to configure the same behavior in .obsidian.vimrc?

@sesm
Copy link
Author

sesm commented Jan 14, 2024

There are obcommands editor:swap-line-up and editor:swap-line-down, but they only move a single line as opposed to moving the selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant