Skip to content

Commit

Permalink
chore: set filetype overrides for vsnip
Browse files Browse the repository at this point in the history
  • Loading branch information
sQVe committed Jun 24, 2021
1 parent 77019ee commit ae19911
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
}
6 changes: 5 additions & 1 deletion config/nvim/lua/plugins/snippets/vsnip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
return function()
vim.cmd([[
let g:vsnip_snippet_dir = expand('$XDG_CONFIG_HOME/nvim/snippets')
let g:vsnip_filetypes = {}
let g:vsnip_filetypes.javascriptreact = ['javascript', 'react']
let g:vsnip_filetypes.typescript = ['javascript', ]
let g:vsnip_filetypes.typescriptreact = ['javascript', 'react', 'typescript']
]])

-- Expand or jump.
vim.cmd([[
imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
]])
]])
end

0 comments on commit ae19911

Please sign in to comment.