0

So basically, I'm testing out writing a Latex document in neovim. I want to make this as similar as an IDE as possible, but with some added Vim functionality. That includes having text that I'm writing display as text, not as concealed symbols. For example, I'd like my text to look like this:

enter image description here

Instead of this:

enter image description here

Below is my init.vim file. I'm very new to Vim and still learning the keybindings, so I don't know exactly what everything does, and I did just copy a lot of it:

filetype on
syntax on

filetype plugin indent on



set wrap

set textwidth=79
set formatoptions=tcqrn1
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set noshiftround

set showmode
set showcmd

set ttyfast
set matchpairs+=<:>

set number

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}


" Highlight matching search patterns
set hlsearch

" Enable incremental search
set incsearch

" Include matching uppercase words with lowercase search term
set ignorecase

" Include only uppercase words with uppercase search term
set smartcase

" Store info from no more than 100 files at a time, 9999 lines of text, 100kb of data. Useful for copying large amounts of data between files.
set viminfo='100,<9999,s100

call plug#begin('$HOME/.local/share/nvim')
Plug 'neoclide/coc.nvim' , { 'branch' : 'release' }
Plug 'sheerun/vim-polyglot'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'jiangmiao/auto-pairs'
Plug 'alvan/vim-closetag'

"File search and navigation
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'

"Editor interface and theming
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'ryanoasis/vim-devicons'
Plug 'yggdroot/indentline'


"Debugging, refactoring and version control
Plug 'puremourning/vimspector'

Plug 'lervag/vimtex'
let g:tex_flavor='latex'


Plug 'sirver/ultisnips'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
Plug 'KeitaNakamura/tex-conceal.vim'
    set conceallevel=0
    let g:tex_conceal=''
    hi Conceal ctermbg=none
call plug#end()
filetype plugin indent on
syntax enable

let g:vimtex_view_general_viewer = 'zathura'
let g:vimtex_quickfix_mode=0
let g:airline_powerline_fonts = 1
let g:coc_global_extensions = [ 'coc-tsserver' ]

colorscheme gruvbox
set bg=dark
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

:imap == <Esc>

You can see that I did set conceallevel=0 and g:tex_conceal='', but I still yield the same result as the second picture. Any help would be greatly appreciated!

1 Answer 1

1

You are using VimTeX, which overrides the built-in syntax highlighting. This means that options like g:tex_conceal is meaningless. To disable conceals with VimTeX, it is sufficient to add

let g:vimtex_syntax_conceal_disable = 1

You are also loading 'KeitaNakamura/tex-conceal.vim', which I believe should also not be relevant if you use VimTeX (and quite obviously not if you don't want conceals).

Further, your vimrc file is quite messy. I can only assume that you have copied things from various tutorials/blog posts/other users without first learning properly what it does. Don't worry, that's quite common. But I strongly suggest that you take your time and read the documentation both for Vim/neovim and for the plugins that you want to use.

I suggest you try with the following slightly cleaned up version of your vimrc file.

" LOAD PLUGINS
call plug#begin('$HOME/.local/share/nvim')
Plug 'neoclide/coc.nvim' , { 'branch' : 'release' }
" I strongly advice that you do _not_ use vim-polyglot!
"Plug 'sheerun/vim-polyglot'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'jiangmiao/auto-pairs'
Plug 'alvan/vim-closetag'

"File search and navigation
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'

"Editor interface and theming
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'ryanoasis/vim-devicons'
Plug 'yggdroot/indentline'

"Debugging, refactoring and version control
Plug 'puremourning/vimspector'

Plug 'lervag/vimtex'

Plug 'sirver/ultisnips'
call plug#end()

" SET OPTIONS
set conceallevel=0

set wrap
set textwidth=79
set formatoptions=tcqrn1
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set noshiftround

set showmode
set showcmd

set ttyfast
set matchpairs+=<:>

set number

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}

" Highlight matching search patterns
set hlsearch

" Enable incremental search
set incsearch

" Include matching uppercase words with lowercase search term
set ignorecase

" Include only uppercase words with uppercase search term
set smartcase

" Store info from no more than 100 files at a time, 9999 lines of text, 100kb of data. Useful for copying large amounts of data between files.
set viminfo='100,<9999,s100

" SET COLORSCHEME
colorscheme gruvbox
set bg=dark
" Custom highlighting should be put behind the colorscheme autocmd
autocmd ColorScheme * highlight Conceal ctermbg=none

" CUSTOM MAPPINGS
inoremap == <Esc>

" CONFIGURE PLUGINS
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'

let g:vimtex_syntax_conceal_disable = 1
let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_mode = 0

let g:airline_powerline_fonts = 1

let g:coc_global_extensions = [ 'coc-tsserver' ]
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
3
  • 2
    And of course, the usual caveat about map vs noremap, since we’re cleaning things up
    – D. Ben Knoble
    Dec 22, 2021 at 16:39
  • 2
    Fantastic answer! You really went above and beyond and I appreciate it! Thank you very much for your help!
    – qmack
    Dec 22, 2021 at 17:10
  • 1
    My pleasure. And thanks, @D.BenKnoble, I've updated the answer to change imap into inoremap (the other maps need to be recursive). Dec 24, 2021 at 19:31

Your Answer

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

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