0

I use Neovim 0.10.0 with Ubuntu. Just started and try to set a variable for gitgutter_sign_modified. In the readme it says to add in ~/.vimrc:

let g:gitgutter_sign_added = 'xx'
let g:gitgutter_sign_modified = 'yy'
let g:gitgutter_sign_removed = 'zz'
let g:gitgutter_sign_removed_first_line = '^^'
let g:gitgutter_sign_removed_above_and_below = '{'
let g:gitgutter_sign_modified_removed = 'ww'

but dont know how to do with Neovim. I use init.lua and tried this

vim.cmd([[
  let g:gitgutter_sign_modified = '*'
]])

but nothing changed.

1 Answer 1

0

In Lua I would do:

vim.g.gitgutter_sign_added = 'xx'
vim.g.gitgutter_sign_modified = 'yy'
vim.g.gitgutter_sign_removed = 'zz'
vim.g.gitgutter_sign_removed_first_line = '^^'
vim.g.gitgutter_sign_removed_above_and_below = '{'
vim.g.gitgutter_sign_modified_removed = 'ww'

More information about how the equivalence between the Vim scope and the Neovim lua API in: lua-guide-variables

6
  • 1
    Do we have a canonical "How do I access scoped variables (g:, w:, b:) in Neovim?" A help reference would also be good
    – D. Ben Knoble
    Commented Jul 8 at 19:55
  • 1
    I did in ~/.config/nvim/init.lua but the sign did not changed when adding or deleting or modifing a line. I also tried in the file gitgutter.lua (between config=function().. end,) and placed inside what you suggested; but not working. Commented Jul 9 at 4:36
  • I suspect another script is changing the same variables. Could you give us the output of the following command: :echo g:gitgutter_sign_added? Commented Jul 9 at 4:51
  • xx but in my php file it is + Commented Jul 9 at 4:53
  • 1
    No the command :echo give xx but in the gutter the sign is + Commented Jul 9 at 4:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.