diff --git a/init.lua b/init.lua index 3911ee07..409d9706 100644 --- a/init.lua +++ b/init.lua @@ -121,6 +121,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- Lazy keymaps +vim.keymap.set('n', 'ml', 'Lazy', { desc = 'Lazy' }) +vim.keymap.set('n', 'mr', 'LspRestart', { desc = 'Restart LSP' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -258,6 +262,7 @@ require('lazy').setup({ { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { 'm', group = '[M]isc' }, + { 'u', group = '[U]I' }, }, }, }, @@ -620,6 +625,7 @@ require('lazy').setup({ }, }, + -- NOTE: Dont forget to `npm i -g @vtsls/language-server` vtsls = { settings = { typescript = { @@ -640,6 +646,7 @@ require('lazy').setup({ }, }, + -- NOTE: Dont forget to `npm i -g @angular/language-server` angularls = { capabilities = lsp_capabilities, filetypes = { 'typescript', 'html', 'angular', 'htmlangular' }, @@ -657,6 +664,43 @@ require('lazy').setup({ } end, }, + + -- NOTE: Dont forget to `npm i -g vscode-langservers-extracted` + cssls = { + capabilities = lsp_capabilities, + cmd = { 'vscode-css-language-server', '--stdio' }, + filetypes = { 'css', 'scss' }, + init_options = { provideFormatter = true }, + -- TODO: Maybe I should use same patter for root finding as for "angularls" server? + root_dir = require('lspconfig.util').root_pattern('package.json', '.git'), + single_file_support = true, + settings = { + css = { validate = true }, + scss = { validate = true }, + }, + }, + + -- TODO: Add emmet abbreviation + -- NOTE: Dont forget to `npm i -g vscode-langservers-extracted` + html = { + capabilities = lsp_capabilities, + cmd = { 'vscode-html-language-server', '--stdio' }, + filetypes = { 'html', 'htmlangular' }, + init_options = { + { + configurationSection = { 'html', 'css', 'javascript', 'htmlangular' }, + embeddedLanguages = { + css = true, + javascript = true, + }, + provideFormatter = true, + }, + }, + -- TODO: Maybe I should use same patter for root finding as for "angularls" server? + root_dir = require('lspconfig.util').root_pattern('package.json', '.git'), + single_file_support = true, + settings = {}, + }, } -- Ensure the servers and tools above are installed @@ -981,8 +1025,6 @@ require('lazy').setup({ end, }, - vim.keymap.set('n', 'hl', 'Lazy', { desc = 'Lazy' }), - -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations.