From 54c2bb07828c8e11bfa8e26f5931060ac3402358 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 18:04:23 -0500 Subject: add comments add comments --- lua/user/plugins.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lua/user/plugins.lua') diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 74fcb73..3e2c87c 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -45,6 +45,7 @@ return packer.startup(function(use) use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins use "windwp/nvim-autopairs" -- Autopairs, integrates with both cmp and treesitter + use "numToStr/Comment.nvim" -- Easily comment stuff -- Colorschemes -- use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out @@ -75,6 +76,7 @@ return packer.startup(function(use) "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", } + use 'JoosepAlviste/nvim-ts-context-commentstring' -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins -- cgit v1.2.3 From 0981b2838275468ad1863aba908379af63209e7a Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 20 Dec 2021 23:27:38 -0500 Subject: lsp updates --- init.lua | 1 + lua/user/cmp.lua | 2 ++ lua/user/lsp/lsp-installer.lua | 5 +++++ lua/user/lsp/settings/jsonls.lua | 18 ++---------------- lua/user/lsp/settings/pyright.lua | 10 ++++++++++ lua/user/plugins.lua | 2 +- 6 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 lua/user/lsp/settings/pyright.lua (limited to 'lua/user/plugins.lua') diff --git a/init.lua b/init.lua index 8a515b8..dd4c62b 100644 --- a/init.lua +++ b/init.lua @@ -4,3 +4,4 @@ require "user.plugins" require "user.colorscheme" require "user.cmp" require "user.lsp" + diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua index a151214..0ba1fc7 100644 --- a/lua/user/cmp.lua +++ b/lua/user/cmp.lua @@ -102,6 +102,7 @@ cmp.setup { -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind vim_item.menu = ({ nvim_lsp = "[LSP]", + nvim_lua = "[NVIM_LUA]", luasnip = "[Snippet]", buffer = "[Buffer]", path = "[Path]", @@ -111,6 +112,7 @@ cmp.setup { }, sources = { { name = "nvim_lsp" }, + { name = "nvim_lua" }, { name = "luasnip" }, { name = "buffer" }, { name = "path" }, diff --git a/lua/user/lsp/lsp-installer.lua b/lua/user/lsp/lsp-installer.lua index 2fe4af2..f539050 100644 --- a/lua/user/lsp/lsp-installer.lua +++ b/lua/user/lsp/lsp-installer.lua @@ -21,6 +21,11 @@ lsp_installer.on_server_ready(function(server) opts = vim.tbl_deep_extend("force", sumneko_opts, opts) end + if server.name == "pyright" then + local pyright_opts = require("user.lsp.settings.pyright") + opts = vim.tbl_deep_extend("force", pyright_opts, opts) + end + -- This setup() function is exactly the same as lspconfig's setup function. -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md server:setup(opts) diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua index 1fffa68..be362c9 100644 --- a/lua/user/lsp/settings/jsonls.lua +++ b/lua/user/lsp/settings/jsonls.lua @@ -1,9 +1,4 @@ -local default_schemas = nil -local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls") -if status_ok then - default_schemas = jsonls_settings.get_default_schemas() -end - +-- Find more schemas here: https://www.schemastore.org/json/ local schemas = { { description = "TypeScript compiler configuration file", @@ -168,19 +163,10 @@ local schemas = { }, } -local function extend(tab1, tab2) - for _, value in ipairs(tab2) do - table.insert(tab1, value) - end - return tab1 -end - -local extended_schemas = extend(schemas, default_schemas) - local opts = { settings = { json = { - schemas = extended_schemas, + schemas = schemas, }, }, setup = { diff --git a/lua/user/lsp/settings/pyright.lua b/lua/user/lsp/settings/pyright.lua new file mode 100644 index 0000000..6354274 --- /dev/null +++ b/lua/user/lsp/settings/pyright.lua @@ -0,0 +1,10 @@ +return { + settings = { + + python = { + analysis = { + typeCheckingMode = "off" + } + } + }, +} diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 45141e2..17dd7b5 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -56,6 +56,7 @@ return packer.startup(function(use) use "hrsh7th/cmp-cmdline" -- cmdline completions use "saadparwaiz1/cmp_luasnip" -- snippet completions use "hrsh7th/cmp-nvim-lsp" + use "hrsh7th/cmp-nvim-lua" -- snippets use "L3MON4D3/LuaSnip" --snippet engine @@ -64,7 +65,6 @@ return packer.startup(function(use) -- LSP use "neovim/nvim-lspconfig" -- enable LSP use "williamboman/nvim-lsp-installer" -- simple to use language server installer - use "tamago324/nlsp-settings.nvim" -- language server settings defined in json for -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins -- cgit v1.2.3 From 4b0d085006724b6f5a1d6db5b980800db44e0e88 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 21 Dec 2021 17:52:58 -0500 Subject: udpate --- init.lua | 1 + lua/user/keymaps.lua | 5 +++++ lua/user/lsp/settings/jsonls.lua | 17 +---------------- lua/user/plugins.lua | 2 +- lua/user/telescope.lua | 8 ++++++++ 5 files changed, 16 insertions(+), 17 deletions(-) (limited to 'lua/user/plugins.lua') diff --git a/init.lua b/init.lua index 1b3f3e8..8c14215 100644 --- a/init.lua +++ b/init.lua @@ -5,3 +5,4 @@ require "user.colorscheme" require "user.cmp" require "user.lsp" require "user.telescope" + diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index fb8fdb4..28718bb 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -68,3 +68,8 @@ keymap("t", "", "h", term_opts) keymap("t", "", "j", term_opts) keymap("t", "", "k", term_opts) keymap("t", "", "l", term_opts) + +-- keymap("n", "f", "Telescope find_files", opts) +keymap("n", "f", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", opts) +keymap("n", "", "Telescope live_grep", opts) + diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua index 1fffa68..8ee9544 100644 --- a/lua/user/lsp/settings/jsonls.lua +++ b/lua/user/lsp/settings/jsonls.lua @@ -1,9 +1,3 @@ -local default_schemas = nil -local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls") -if status_ok then - default_schemas = jsonls_settings.get_default_schemas() -end - local schemas = { { description = "TypeScript compiler configuration file", @@ -168,19 +162,10 @@ local schemas = { }, } -local function extend(tab1, tab2) - for _, value in ipairs(tab2) do - table.insert(tab1, value) - end - return tab1 -end - -local extended_schemas = extend(schemas, default_schemas) - local opts = { settings = { json = { - schemas = extended_schemas, + schemas = schemas, }, }, setup = { diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index c8a32cb..b173f9b 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -64,10 +64,10 @@ return packer.startup(function(use) -- LSP use "neovim/nvim-lspconfig" -- enable LSP use "williamboman/nvim-lsp-installer" -- simple to use language server installer - use "tamago324/nlsp-settings.nvim" -- language server settings defined in json for -- Telescope use "nvim-telescope/telescope.nvim" + use 'nvim-telescope/telescope-media-files.nvim' -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins diff --git a/lua/user/telescope.lua b/lua/user/telescope.lua index 0706b51..d4bf410 100644 --- a/lua/user/telescope.lua +++ b/lua/user/telescope.lua @@ -3,6 +3,8 @@ if not status_ok then return end +telescope.load_extension('media_files') + local actions = require "telescope.actions" telescope.setup { @@ -87,6 +89,12 @@ telescope.setup { -- builtin picker }, extensions = { + media_files = { + -- filetypes whitelist + -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} + filetypes = {"png", "webp", "jpg", "jpeg"}, + find_cmd = "rg" -- find command (defaults to `fd`) + } -- Your extension configuration goes here: -- extension_name = { -- extension_config_key = value, -- cgit v1.2.3 From 5b2777816a17b2d56c18cedb7b8bc1975539645e Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 28 Dec 2021 02:28:15 -0500 Subject: update --- lua/user/lsp/settings/jsonls.lua | 17 +---------------- lua/user/plugins.lua | 2 ++ lua/user/treesitter.lua | 23 +++++++++++++++++------ 3 files changed, 20 insertions(+), 22 deletions(-) (limited to 'lua/user/plugins.lua') diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua index 1fffa68..8ee9544 100644 --- a/lua/user/lsp/settings/jsonls.lua +++ b/lua/user/lsp/settings/jsonls.lua @@ -1,9 +1,3 @@ -local default_schemas = nil -local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls") -if status_ok then - default_schemas = jsonls_settings.get_default_schemas() -end - local schemas = { { description = "TypeScript compiler configuration file", @@ -168,19 +162,10 @@ local schemas = { }, } -local function extend(tab1, tab2) - for _, value in ipairs(tab2) do - table.insert(tab1, value) - end - return tab1 -end - -local extended_schemas = extend(schemas, default_schemas) - local opts = { settings = { json = { - schemas = extended_schemas, + schemas = schemas, }, }, setup = { diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index af7dfb1..87dc269 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -74,6 +74,8 @@ return packer.startup(function(use) "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", } + use "p00f/nvim-ts-rainbow" + use "nvim-treesitter/playground" -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua index f00cc2d..7d45bd4 100644 --- a/lua/user/treesitter.lua +++ b/lua/user/treesitter.lua @@ -1,16 +1,27 @@ -local status_ok, configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end + + + + + + + + + + + + + +local configs = require("nvim-treesitter.configs") configs.setup { - ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages - sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) + ensure_installed = "maintained", + sync_install = false, ignore_install = { "" }, -- List of parsers to ignore installing highlight = { enable = true, -- false will disable the whole extension disable = { "" }, -- list of language that will be disabled additional_vim_regex_highlighting = true, + }, indent = { enable = true, disable = { "yaml" } }, } -- cgit v1.2.3