netranger messes all the mappings
Closed this issue · 6 comments
After I open a file using netranger , it leaves mappings for the buffer of bookmarks!
So for example, I got a bookmark of v for ~/vim . so every time I pressed v
in a perfectly norm file and expected a visual model , I got thrown into netranger.
Impossible to work like this.
this is in the last version.
O.k. Bookmark just caused too much bug to fix. I decided to totally deprecated it. Please update to the newest version and use ipod825/vim-bookmark instead. Or you can choose other plugins too.
Well, the fix is simple. You just set the mapping to be applied everywhere instead of just the buffer.
I don't want to do a pull request so feel free to add this.
diff --git a/pythonx/netranger/ui.py b/pythonx/netranger/ui.py
index dbb66da..280126d 100644
--- a/pythonx/netranger/ui.py
+++ b/pythonx/netranger/ui.py
@@ -276,10 +276,10 @@ class BookMarkUI(UI):
self.show('go')
for mark, path in self.mark_dict.items():
Vim.command(
- f'nnoremap <silent> {mark} :call netranger#ui#bookmarkgo("{path}")<c
r>'
+ f'nnoremap <buffer> <silent> {mark} :call netranger#ui#bookmarkgo("{
path}")<cr>'
)
Vim.command(
- f'nnoremap <silent> <cr> :call netranger#ui#bookmarkgo(getline(".")[2:])
<cr>'
+ f'nnoremap <buffer> <silent> <cr> :call netranger#ui#bookmarkgo(getline(
".")[2:])<cr>'
)
I tried it. But it causes yet another problem that I can't identify the root cause on my machine. And it's not the first time bookmark is causing a lot of trouble, so I decide to deprecate it. If you feel there's any inconvenience in ipod825/vim-bookmark, feel free to raise issue there.
Well, it works fine for me. I wonder what problem does it raise?
The syntax highlight went wrong after opening the directory. Conceal highlight group seemed to get cleared. Don't even know why that would happen.