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

Help Add custom concealing rule for VimTeX on neovim #2964

Closed
martipares opened this issue Jun 6, 2024 · 3 comments
Closed

Help Add custom concealing rule for VimTeX on neovim #2964

martipares opened this issue Jun 6, 2024 · 3 comments

Comments

@martipares
Copy link

martipares commented Jun 6, 2024

I am new to neovim so if someone could help me I would appreciate it very much.

My objective is to conceal a newcommand \Yo whit .

I have read the documentation on :help g:vimtex_syntax_custom_cmds, but I don't know how to adapt it to neovim.

I use LazyVim whit the tex and luasnip extras enabled.

My current configuration for vimtex is this: (~/.../vimtex.lua)

return {
  "lervag/vimtex",
  lazy = false,
  init = function()
    vim.g['vimtex_view_method'] = 'zathura_simple' 
    vim.g['vimtex_quickfix_mode'] = 0
    vim.g['vimtex_mappings_enabled'] = 0
    vim.g['vimtex_indent_enabled'] = 0
    vim.g['tex_flavor'] = 'latex' 
    vim.g['tex_indent_items'] = 0
    vim.g['tex_indent_brace'] = 0
    vim.g['vimtex_context_pdf_viewer'] = 'okular'  
    vim.g['vimtex_log_ignore'] = ({ 
      'Underfull',
      'Overfull',
      'specifier changed to',
      'Token not allowed in a PDF string',
    })
  end,
}
@lervag
Copy link
Owner

lervag commented Jun 6, 2024

My objective is to conceal a newcommand \Yo whit .

My current configuration for vimtex is this: (~/.../vimtex.lua)

I believe this should be a simplified and improved configuration with the desired added syntax rule

return {
  "lervag/vimtex",
  lazy = false,
  init = function()
    vim.g.vimtex_view_method = 'zathura_simple'
    vim.g.vimtex_quickfix_mode = 0
    vim.g.vimtex_mappings_enabled = 0
    vim.g.vimtex_indent_enabled = 0
    vim.g.vimtex_context_pdf_viewer = 'okular'
    vim.g.vimtex_log_ignore = ({
      'Underfull',
      'Overfull',
      'specifier changed to',
      'Token not allowed in a PDF string',
    })
    vim.g.vimtex_syntax_custom_cmds = {
      {
        name = 'Yo',
        mathmode = true,
        concealchar = ''
      },
    }
  end,
}

By the way, are you sure you want to disable indentation and the mappings? As a newcomer, I would think it useful to at least have the default mappings.

@lervag lervag closed this as completed Jun 6, 2024
@martipares
Copy link
Author

Thank you, this helps me a lot.
I will try this configuration with indentation and the mappings enabled.

@lervag
Copy link
Owner

lervag commented Jun 6, 2024

Glad to help!

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

No branches or pull requests

2 participants