feat(config): add ability to add ensured_installed for treesitter
This commit is contained in:
parent
8dde6a3f09
commit
9ed1d49ae5
3 changed files with 30 additions and 15 deletions
|
@ -8,6 +8,19 @@ config.statusline = {
|
||||||
main_icon = '★',
|
main_icon = '★',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.treesitter = {
|
||||||
|
ensure_installed = {
|
||||||
|
'typescript',
|
||||||
|
'javascript',
|
||||||
|
'tsx',
|
||||||
|
'html',
|
||||||
|
'css',
|
||||||
|
'lua',
|
||||||
|
'json',
|
||||||
|
'scss',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
config.lsp = {
|
config.lsp = {
|
||||||
|
|
||||||
-- true/false or table of filetypes {'.ts', '.js',}
|
-- true/false or table of filetypes {'.ts', '.js',}
|
||||||
|
@ -17,6 +30,7 @@ config.lsp = {
|
||||||
rename_notification = false,
|
rename_notification = false,
|
||||||
|
|
||||||
diagnostic = {
|
diagnostic = {
|
||||||
|
|
||||||
-- disable diagnostic virtual text (see :h vim.diagnostic.config for all options)
|
-- disable diagnostic virtual text (see :h vim.diagnostic.config for all options)
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
|
|
||||||
|
@ -28,6 +42,7 @@ config.lsp = {
|
||||||
|
|
||||||
-- disable underline for diagnostic
|
-- disable underline for diagnostic
|
||||||
underline = false,
|
underline = false,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
servers = {
|
servers = {
|
||||||
|
@ -36,7 +51,7 @@ config.lsp = {
|
||||||
eslint = false,
|
eslint = false,
|
||||||
|
|
||||||
-- enable non-default servers, use default lsp config
|
-- enable non-default servers, use default lsp config
|
||||||
-- check here for configs that will be used: https://github.com/williamboman/nvim-lsp-installer/tree/main/lua/nvim-lsp-installer/servers
|
-- check here for configs that will be used by default: https://github.com/williamboman/nvim-lsp-installer/tree/main/lua/nvim-lsp-installer/servers
|
||||||
rust_analyzer = true,
|
rust_analyzer = true,
|
||||||
|
|
||||||
tsserver = {
|
tsserver = {
|
||||||
|
|
|
@ -15,6 +15,18 @@ local default_config = {
|
||||||
statusline = {
|
statusline = {
|
||||||
main_icon = require('cosmic.core.theme.icons').ghost,
|
main_icon = require('cosmic.core.theme.icons').ghost,
|
||||||
},
|
},
|
||||||
|
treesitter = {
|
||||||
|
ensure_installed = {
|
||||||
|
'typescript',
|
||||||
|
'javascript',
|
||||||
|
'tsx',
|
||||||
|
'html',
|
||||||
|
'css',
|
||||||
|
'lua',
|
||||||
|
'json',
|
||||||
|
'scss',
|
||||||
|
},
|
||||||
|
},
|
||||||
lsp = {
|
lsp = {
|
||||||
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
|
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
|
||||||
rename_notification = true,
|
rename_notification = true,
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
|
local config = require('cosmic.config')
|
||||||
require('nvim-treesitter.configs').setup({
|
require('nvim-treesitter.configs').setup({
|
||||||
ensure_installed = {
|
ensure_installed = config.treesitter.ensure_installed,
|
||||||
'typescript',
|
|
||||||
'javascript',
|
|
||||||
'tsx',
|
|
||||||
'html',
|
|
||||||
'css',
|
|
||||||
'bash',
|
|
||||||
'lua',
|
|
||||||
'json',
|
|
||||||
'python',
|
|
||||||
'php',
|
|
||||||
'scss',
|
|
||||||
'go',
|
|
||||||
},
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
use_languagetree = true,
|
use_languagetree = true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue