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?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI'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?
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
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.