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

vim-taskwarrior overrides all mappings and there's no way to prevent it #127

Open
Ram-Z opened this issue Jul 23, 2016 · 1 comment · May be fixed by #137
Open

vim-taskwarrior overrides all mappings and there's no way to prevent it #127

Ram-Z opened this issue Jul 23, 2016 · 1 comment · May be fixed by #137

Comments

@Ram-Z
Copy link

Ram-Z commented Jul 23, 2016

I have <space> as my leader key and I can't use it inside taskreport files.

Adding an option to prevent any mappings to be set, or checking whether a key is already mapped using maparg would be very welcomed.

@tecfu
Copy link

tecfu commented Nov 12, 2016

I found two different workarounds for this.

  1. You can create the file .vim/after/ftplugin/taskreport.vim
    and put any desired mappings/remappings there.
  2. You can use the async api to run a job to change the keymappings after a taskreport buffer is loaded, since the keymappings are created after all of Vim's event options.
function! TWUnmap(a,b)
    unmap <buffer> J
    unmap <buffer> K
endfunction

function! TWUnmapChooser()
    if has("nvim")
        call jobstart(['bash','-c','echo "-"; exit;'],{'on_stdout':'TWUnmap'})
    else
        call job_start(['bash','-c','echo "-"; exit;'],{'out_cb':'TWUnmap'})
    endif
endfunction

augroup TaskwarriorMapping
    autocmd!
    autocmd FileType taskreport :call TWUnmapChooser() 
augroup END

@kalbasit kalbasit linked a pull request May 23, 2017 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants