razak17 / tailwind-fold.nvim

Neovim plugin to conceal long class attributes.
45 stars 7 forks source link

Example for Vim-Plug? #13

Open ic-768 opened 2 days ago

ic-768 commented 2 days ago

Could you please provide a default installation example using vim-plug?

This is what I'm trying and isn't working:

Plug 'razak17/tailwind-fold.nvim'

(.....)

lua << EOF
require('tailwind-fold').setup({opts={},ft = {'html', 'react','typescript','javascriptreact','typescriptreact'}})
EOF
razak17 commented 2 days ago

I just tested this minimal config and it works.

let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
endif

call plug#begin()
Plug 'razak17/onedark.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'

Plug 'nvim-treesitter/nvim-treesitter'
Plug 'razak17/tailwind-fold.nvim'
call plug#end()

lua << EOF
  vim.cmd.colorscheme("onedark")

  require('telescope').setup({})
  vim.keymap.set('n', '<c-p>', '<cmd>Telescope find_files<cr>')

  require("tailwind-fold").setup {
    ft = { 'html', 'svelte', 'astro', 'vue', 'typescriptreact', 'php', 'blade' },
  }
EOF

Please make sure you have the treesitter parser for the languages you intend to use installed i.e. TSInstall . Also check that your conceallevel is set to 2. (Check readme for details)

I have also added installation instructions for vim-plug to the readme