From eadd71a4d64b5bdec4c861de1ca7e8be8510104d Mon Sep 17 00:00:00 2001 From: Veighnsche Date: Tue, 18 Jun 2024 22:38:59 +0200 Subject: [PATCH] personalized it a bit --- init.lua | 35 +++++++++++++++++++++------ lua/custom/plugins/init.lua | 10 +++++++- lua/kickstart/plugins/indent_line.lua | 2 -- lua/kickstart/plugins/lint.lua | 4 +++ 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index d261c492..827f8a2a 100644 --- a/init.lua +++ b/init.lua @@ -607,6 +607,8 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'tsserver', + 'lua_ls', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -657,7 +659,8 @@ require('lazy').setup({ -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. - -- javascript = { { "prettierd", "prettier" } }, + javascript = { { 'prettierd', 'prettier' } }, + typescript = { { 'prettierd', 'prettier' } }, }, }, }, @@ -666,6 +669,10 @@ require('lazy').setup({ 'hrsh7th/nvim-cmp', event = 'InsertEnter', dependencies = { + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', -- Snippet Engine & its associated nvim-cmp source { 'L3MON4D3/LuaSnip', @@ -835,7 +842,21 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { + 'bash', + 'c', + 'diff', + 'html', + 'javascript', + 'lua', + 'luadoc', + 'markdown', + 'tsx', + 'typescript', + 'vim', + 'vimdoc', + 'yaml', + }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -874,10 +895,10 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -885,7 +906,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..630f65ed 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,12 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'github/copilot.vim', + event = 'VimEnter', + config = function() + vim.cmd 'Copilot setup' + end, + }, +} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f2693..cda8037b 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,8 +1,6 @@ return { { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` main = 'ibl', opts = {}, }, diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 7f0dc42f..6ef5b775 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -7,6 +7,10 @@ return { local lint = require 'lint' lint.linters_by_ft = { markdown = { 'markdownlint' }, + javascript = { 'eslint' }, + javascriptreact = { 'eslint' }, + typescript = { 'eslint' }, + typescriptreact = { 'eslint' }, } -- To allow other plugins to add linters to require('lint').linters_by_ft,