0

I'm new to NvChad and would like to learn how to bind <leader>t to execute rubber on the current file.

My previous nvim setup had the code nnoremap <leader>t :!rubber --pdf %<CR>.

How would this carry over to NvChad?

2
  • 1
    If you have a solution you like feel free to publish it as an answer. You can also accept it two days later using the v button next to the arrow voting buttons. It allow the question to rest. Commented Jun 7, 2023 at 17:54
  • Welcome to vi SE. Great you found a solution. However, I completely agree with Vivian that it belongs in an answer. Please scroll all the way down, paste your solution there and click "Post Your Answer". Thank you very much.
    – Friedrich
    Commented Jun 7, 2023 at 19:02

2 Answers 2

0

In the NvChad custom mapping file (~/.config/nvim/lua/custom/mapping.lua) edit the section M.general:

M.general = {
  n = {
    [";"] = { ":", "enter command mode", opts = { nowait = true } },
    ["<leader>s"] = { ":!rubber --pdf %<CR>", "rubber the current file", opts = { nowait = true } },
  },
}

More information about NvChad mapping in the mapping documentation

Remark: In the example I remap <leader>s (Spaces) since <leader>th (Spaceth) is already mapped in NvChad.

Remark: You can list all the NvChad mapping with the :Telescope keymaps command

0

Consider setting the makeprg and using :make, or writing a small compiler plugin (which sets makeprg and errorformat, and can be used with :compiler). See relevant help topics for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.