Skip to content

Cannot insert keybindings into magit-status-jump #192

@mmahmoudian

Description

@mmahmoudian

Thanks for the useful and handy package and thank you for maintaining it.

I've been lately getting this error when using magit:

Cannot insert [("T" "Todos" magit-todos-jump-to-todos) ("l" "List todos" magit-todos-list)] into magit-status-jump; (0 -1) not found

I checked the existing issues on this repo and considering that no one else have reported this, it might mean that something is wrong with my config, although that is not very likely as my config is fairly minimal. The following is my magit and magit-todos config:

(use-package magit
  :ensure t
  :defer t
  :config
  (defun mm/magit-kill-buffers ()
    "Restore window configuration and kill all Magit buffers.

-------
Author: Manuel Uberti
Date of post: 2018-02-17
URL of post: https://manueluberti.eu/2018/02/17/magit-bury-buffer.html
Date of adoption: 2023-03-29T18:18:39+03:00
-------
"
    (interactive)
    (let ((buffers (magit-mode-get-buffers)))
      (magit-restore-window-configuration)
      (mapc #'kill-buffer buffers)))
  (bind-key "q" #'mm/magit-kill-buffers magit-status-mode-map)
  
  :hook (
         (magit-status-mode . (lambda () (setq
                                   show-trailing-whitespace nil      ; disable the highlighting of trailing whitespace
                                   indicate-empty-lines nil          ; remove the glyph for showing the end of buffer
                                   indicate-buffer-boundaries nil    ; remove the glyphs to show buffer boundaries
                                   )))
        )
  )

(use-package magit-todos
  :ensure t
  :defer t
  :config
    (setq magit-todos-depth 21
          magit-diff-refine-hunk 'all
          ;magit-todos-rg-extra-args " --max-filesize 50K "
          )
    (setq magit-todos-exclude-globs
          (append magit-todos-exclude-globs
                  (list
                   ".git/"
                   "elpy/" "venv/" "bootstrap/"                      ; library folders
                   "*.json" "*.csv" ".xml"                           ; data files
                   "*.zip" "*.tar" "*.gz" "*.xz"                     ; compressed files
                   "*.old" "*.bk"                                    ; backup files
                   "*.log"                                           ; log files
                   "*.js.map"
                   )))
  :hook (
         (magit-mode . magit-todos-mode)
         ))

I would be thankful if you kindly point me to the right direction regarding this issue. If you need further information, I'll be happy to provide them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions