This commit is contained in:
Ray Elliott 2022-10-08 11:11:55 +01:00
parent 0d451f9b04
commit b57d625a5d
3 changed files with 26 additions and 9 deletions

View File

@ -117,7 +117,7 @@ Plug '~/projects/nvim-paper-tonic'
"}}} "}}}
" #nvim-autopairs {{{ " #nvim-ts-autotag {{{
" https://github.com/windwp/nvim-ts-autotag " https://github.com/windwp/nvim-ts-autotag
" automatic html tag closing/renaming. " automatic html tag closing/renaming.
Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' } Plug 'windwp/nvim-ts-autotag', { 'branch': 'main' }

View File

@ -86,22 +86,22 @@ local on_attach = function(client, bufnr)
-- buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts) -- buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
if client.name == 'phpactor' then if client.name == 'phpactor' then
client.resolved_capabilities.find_references = false; client.server_capabilities.find_references = false;
end end
if client.name == 'tsserver' or client.name == 'intelephense' then if client.name == 'tsserver' or client.name == 'intelephense' then
client.resolved_capabilities.document_formatting = false; client.server_capabilities.document_formatting = false;
-- print(vim.inspect(client.resolved_capabilities)); -- print(vim.inspect(client.server_capabilities));
end end
if client.resolved_capabilities.document_formatting then if client.server_capabilities.document_formatting then
vim.cmd [[augroup lsp_formatting]] vim.cmd [[augroup lsp_formatting]]
vim.cmd [[autocmd!]] vim.cmd [[autocmd!]]
vim.cmd [[autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_seq_sync({}, 3000)]] vim.cmd [[autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_seq_sync({}, 3000)]]
vim.cmd [[augroup END]] vim.cmd [[augroup END]]
end end
if client.resolved_capabilities.document_highlight then if client.server_capabilities.document_highlight then
vim.cmd [[ vim.cmd [[
augroup lsp_document_highlight augroup lsp_document_highlight
autocmd! * <buffer> autocmd! * <buffer>
@ -201,7 +201,10 @@ local sources = {
root .. "/node_modules/@wordpress/scripts/config/.eslintignore" root .. "/node_modules/@wordpress/scripts/config/.eslintignore"
} }
}), -- }), --
null_ls.builtins.diagnostics.eslint, -- null_ls.builtins.diagnostics.eslint.with({
-- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte", "astro" },
-- command = eslint_command
-- }),
-- null_ls.builtins.diagnostics.eslint.with({ -- null_ls.builtins.diagnostics.eslint.with({
-- condition = function(utils) -- condition = function(utils)
-- local has_file1 = utils.root_has_file({".eslintrc.js"}) -- local has_file1 = utils.root_has_file({".eslintrc.js"})

View File

@ -1,6 +1,8 @@
-- nvim-autopairs -- nvim-autopairs
require('nvim-autopairs').setup {} require('nvim-autopairs').setup {}
-- you need setup cmp first put this after cmp.setup() ------
-- cmp
require("cmp").setup({ require("cmp").setup({
map_cr = false, -- map <CR> on insert mode map_cr = false, -- map <CR> on insert mode
map_complete = false, -- it will auto insert `(` after select function or method item map_complete = false, -- it will auto insert `(` after select function or method item
@ -9,7 +11,19 @@ require("cmp").setup({
------ ------
-- nvim-ts-autotag -- nvim-ts-autotag
require'nvim-treesitter.configs'.setup {autotag = {enable = true}} require'nvim-treesitter.configs'.setup {
autotag = {
enable = true,
filetypes = {
-- not working for astro files
'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx', 'rescript', 'astro',
'xml',
'php',
'markdown',
'glimmer','handlebars','hbs'
},
}
}
------ ------
-- nvim-ufo -- nvim-ufo