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 6fbc8c23123a6b44590a3fa6c656c2f5b98ae89e Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 18:07:49 -0500 Subject: add gitsigns update --- init.lua | 1 + lua/user/gitsigns.lua | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ lua/user/keymaps.lua | 4 ---- lua/user/plugins.lua | 3 +++ 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 lua/user/gitsigns.lua (limited to 'lua/user/plugins.lua') diff --git a/init.lua b/init.lua index f1c864d..ba4006d 100644 --- a/init.lua +++ b/init.lua @@ -8,3 +8,4 @@ require "user.telescope" require "user.treesitter" require "user.autopairs" require "user.comment" +require "user.gitsigns" diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua new file mode 100644 index 0000000..ff72b93 --- /dev/null +++ b/lua/user/gitsigns.lua @@ -0,0 +1,48 @@ +local status_ok, gitsigns = pcall(require, "gitsigns") +if not status_ok then + return +end + +gitsigns.setup { + signs = { + add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter_opts = { + relative_time = false, + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { + enable = false, + }, +} diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 9534dec..fb8fdb4 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -68,7 +68,3 @@ keymap("t", "", "h", term_opts) keymap("t", "", "j", term_opts) keymap("t", "", "k", term_opts) keymap("t", "", "l", term_opts) - --- Comment -keymap("n", "/", "lua require('Comment').toggle()", opts) -keymap("v", "/", ":lua require(\"Comment.api\").gc(vim.fn.visualmode())", opts) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 3e2c87c..24678aa 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -78,6 +78,9 @@ return packer.startup(function(use) } use 'JoosepAlviste/nvim-ts-context-commentstring' + -- Git + use "lewis6991/gitsigns.nvim" + -- Automatically set up your configuration after cloning packer.nvim -- Put this at the end after all plugins if PACKER_BOOTSTRAP then -- cgit v1.2.3 From 03ec92cafb62f4331bd04bee734d0bd2c28e668e Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 18:18:28 -0500 Subject: add nvimtree update --- init.lua | 1 + lua/user/keymaps.lua | 7 +--- lua/user/nvim-tree.lua | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ lua/user/plugins.lua | 2 + 4 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 lua/user/nvim-tree.lua (limited to 'lua/user/plugins.lua') diff --git a/init.lua b/init.lua index ba4006d..0669cb2 100644 --- a/init.lua +++ b/init.lua @@ -9,3 +9,4 @@ require "user.treesitter" require "user.autopairs" require "user.comment" require "user.gitsigns" +require "user.nvim-tree" diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 9534dec..638cab5 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -25,8 +25,6 @@ keymap("n", "", "j", opts) keymap("n", "", "k", opts) keymap("n", "", "l", opts) -keymap("n", "e", ":Lex 30", opts) - -- Resize with arrows keymap("n", "", ":resize -2", opts) keymap("n", "", ":resize +2", opts) @@ -69,6 +67,5 @@ keymap("t", "", "j", term_opts) keymap("t", "", "k", term_opts) keymap("t", "", "l", term_opts) --- Comment -keymap("n", "/", "lua require('Comment').toggle()", opts) -keymap("v", "/", ":lua require(\"Comment.api\").gc(vim.fn.visualmode())", opts) +-- Nvimtree +keymap("n", "e", ":NvimTreeToggle", opts) diff --git a/lua/user/nvim-tree.lua b/lua/user/nvim-tree.lua new file mode 100644 index 0000000..9c5170c --- /dev/null +++ b/lua/user/nvim-tree.lua @@ -0,0 +1,112 @@ +-- following options are the default +-- each of these are documented in `:help nvim-tree.OPTION_NAME` +vim.g.nvim_tree_icons = { + default = "", + symlink = "", + git = { + unstaged = "", + staged = "S", + unmerged = "", + renamed = "➜", + deleted = "", + untracked = "U", + ignored = "◌", + }, + folder = { + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + }, +} + +local status_ok, nvim_tree = pcall(require, "nvim-tree") +if not status_ok then + return +end + +local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") +if not config_status_ok then + return +end + +local tree_cb = nvim_tree_config.nvim_tree_callback + +nvim_tree.setup { + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = { + "startify", + "dashboard", + "alpha", + }, + auto_close = true, + open_on_tab = false, + hijack_cursor = false, + update_cwd = true, + update_to_buf_dir = { + enable = true, + auto_open = true, + }, + diagnostics = { + enable = true, + icons = { + hint = "", + info = "", + warning = "", + error = "", + }, + }, + update_focused_file = { + enable = true, + update_cwd = true, + ignore_list = {}, + }, + system_open = { + cmd = nil, + args = {}, + }, + filters = { + dotfiles = false, + custom = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 500, + }, + view = { + width = 30, + height = 30, + hide_root_folder = false, + side = "left", + auto_resize = true, + mappings = { + custom_only = false, + list = { + { key = { "l", "", "o" }, cb = tree_cb "edit" }, + { key = "h", cb = tree_cb "close_node" }, + { key = "v", cb = tree_cb "vsplit" }, + }, + }, + number = false, + relativenumber = false, + }, + trash = { + cmd = "trash", + require_confirm = true, + }, + quit_on_open = 0, + git_hl = 1, + disable_window_picker = 0, + root_folder_modifier = ":t", + show_icons = { + git = 1, + folders = 1, + files = 1, + folder_arrows = 1, + tree_width = 30, + }, +} diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 24678aa..04c0bc9 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -46,6 +46,8 @@ return packer.startup(function(use) 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 + use 'kyazdani42/nvim-web-devicons' + use 'kyazdani42/nvim-tree.lua' -- Colorschemes -- use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out -- cgit v1.2.3 From 122bedde844fcef84169889d7666af0592b58c46 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 18:21:42 -0500 Subject: add bufferline add bufferline update --- init.lua | 1 + lua/user/bufferline.lua | 167 ++++++++++++++++++++++++++++++++++++++++++++++++ lua/user/keymaps.lua | 4 -- lua/user/plugins.lua | 8 ++- 4 files changed, 173 insertions(+), 7 deletions(-) create mode 100644 lua/user/bufferline.lua (limited to 'lua/user/plugins.lua') diff --git a/init.lua b/init.lua index 0669cb2..5ff470c 100644 --- a/init.lua +++ b/init.lua @@ -10,3 +10,4 @@ require "user.autopairs" require "user.comment" require "user.gitsigns" require "user.nvim-tree" +require "user.bufferline" diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua new file mode 100644 index 0000000..7d98cf0 --- /dev/null +++ b/lua/user/bufferline.lua @@ -0,0 +1,167 @@ +local status_ok, bufferline = pcall(require, "bufferline") +if not status_ok then + return +end + +bufferline.setup { + options = { + numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, + close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" + right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" + left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" + middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" + -- NOTE: this plugin is designed with this icon in mind, + -- and so changing this is NOT recommended, this is intended + -- as an escape hatch for people who cannot bear it for whatever reason + indicator_icon = "▎", + buffer_close_icon = "", + -- buffer_close_icon = '', + modified_icon = "●", + close_icon = "", + -- close_icon = '', + left_trunc_marker = "", + right_trunc_marker = "", + --- name_formatter can be used to change the buffer's label in the bufferline. + --- Please note some names can/will break the + --- bufferline so use this at your discretion knowing that it has + --- some limitations that will *NOT* be fixed. + -- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" + -- -- remove extension from markdown files for example + -- if buf.name:match('%.md') then + -- return vim.fn.fnamemodify(buf.name, ':t:r') + -- end + -- end, + max_name_length = 30, + max_prefix_length = 30, -- prefix used when a buffer is de-duplicated + tab_size = 21, + diagnostics = false, -- | "nvim_lsp" | "coc", + diagnostics_update_in_insert = false, + -- diagnostics_indicator = function(count, level, diagnostics_dict, context) + -- return "("..count..")" + -- end, + -- NOTE: this will be called a lot so don't do any heavy processing here + -- custom_filter = function(buf_number) + -- -- filter out filetypes you don't want to see + -- if vim.bo[buf_number].filetype ~= "" then + -- return true + -- end + -- -- filter out by buffer name + -- if vim.fn.bufname(buf_number) ~= "" then + -- return true + -- end + -- -- filter out based on arbitrary rules + -- -- e.g. filter out vim wiki buffer from tabline in your work repo + -- if vim.fn.getcwd() == "" and vim.bo[buf_number].filetype ~= "wiki" then + -- return true + -- end + -- end, + offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = true, + show_tab_indicators = true, + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + -- can also be a table containing 2 custom separators + -- [focused and unfocused]. eg: { '|', '|' } + separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, + enforce_regular_tabs = true, + always_show_bufferline = true, + -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) + -- -- add custom logic + -- return buffer_a.modified > buffer_b.modified + -- end + }, + highlights = { + fill = { + guifg = { attribute = "fg", highlight = "#ff0000" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + background = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + + -- buffer_selected = { + -- guifg = {attribute='fg',highlight='#ff0000'}, + -- guibg = {attribute='bg',highlight='#0000ff'}, + -- gui = 'none' + -- }, + buffer_visible = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + + close_button = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + close_button_visible = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + -- close_button_selected = { + -- guifg = {attribute='fg',highlight='TabLineSel'}, + -- guibg ={attribute='bg',highlight='TabLineSel'} + -- }, + + tab_selected = { + guifg = { attribute = "fg", highlight = "Normal" }, + guibg = { attribute = "bg", highlight = "Normal" }, + }, + tab = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + tab_close = { + -- guifg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, + guifg = { attribute = "fg", highlight = "TabLineSel" }, + guibg = { attribute = "bg", highlight = "Normal" }, + }, + + duplicate_selected = { + guifg = { attribute = "fg", highlight = "TabLineSel" }, + guibg = { attribute = "bg", highlight = "TabLineSel" }, + gui = "italic", + }, + duplicate_visible = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + gui = "italic", + }, + duplicate = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + gui = "italic", + }, + + modified = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + modified_selected = { + guifg = { attribute = "fg", highlight = "Normal" }, + guibg = { attribute = "bg", highlight = "Normal" }, + }, + modified_visible = { + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + + separator = { + guifg = { attribute = "bg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, + }, + separator_selected = { + guifg = { attribute = "bg", highlight = "Normal" }, + guibg = { attribute = "bg", highlight = "Normal" }, + }, + -- separator_visible = { + -- guifg = {attribute='bg',highlight='TabLine'}, + -- guibg = {attribute='bg',highlight='TabLine'} + -- }, + indicator_selected = { + guifg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, + guibg = { attribute = "bg", highlight = "Normal" }, + }, + }, +} diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index b4d2195..638cab5 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -67,9 +67,5 @@ keymap("t", "", "j", term_opts) keymap("t", "", "k", term_opts) keymap("t", "", "l", term_opts) --- Comment -keymap("n", "/", "lua require('Comment').toggle()", opts) -keymap("v", "/", ":lua require(\"Comment.api\").gc(vim.fn.visualmode())", opts) - -- Nvimtree keymap("n", "e", ":NvimTreeToggle", opts) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 04c0bc9..530d7bf 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -46,8 +46,10 @@ return packer.startup(function(use) 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 - use 'kyazdani42/nvim-web-devicons' - use 'kyazdani42/nvim-tree.lua' + use "kyazdani42/nvim-web-devicons" + use "kyazdani42/nvim-tree.lua" + use "akinsho/bufferline.nvim" + use "moll/vim-bbye" -- Colorschemes -- use "lunarvim/colorschemes" -- A bunch of colorschemes you can try out @@ -78,7 +80,7 @@ return packer.startup(function(use) "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", } - use 'JoosepAlviste/nvim-ts-context-commentstring' + use "JoosepAlviste/nvim-ts-context-commentstring" -- Git use "lewis6991/gitsigns.nvim" -- cgit v1.2.3 From 6fddfcb743fe2f4980608853ef27fb9b5737a3ee Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 18:25:42 -0500 Subject: add null-ls fix bufferline f --- lua/user/bufferline.lua | 8 ++++---- lua/user/keymaps.lua | 4 ---- lua/user/lsp/init.lua | 5 +++-- lua/user/lsp/null-ls.lua | 19 +++++++++++++++++++ lua/user/plugins.lua | 1 + 5 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 lua/user/lsp/null-ls.lua (limited to 'lua/user/plugins.lua') diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua index 81015c5..7d98cf0 100644 --- a/lua/user/bufferline.lua +++ b/lua/user/bufferline.lua @@ -92,12 +92,12 @@ bufferline.setup { }, close_button = { - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "TabLineSel" }, + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, }, close_button_visible = { - guifg = { attribute = "fg", highlight = "TabLineSel" }, - guibg = { attribute = "bg", highlight = "TabLineSel" }, + guifg = { attribute = "fg", highlight = "TabLine" }, + guibg = { attribute = "bg", highlight = "TabLine" }, }, -- close_button_selected = { -- guifg = {attribute='fg',highlight='TabLineSel'}, diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index b4d2195..638cab5 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -67,9 +67,5 @@ keymap("t", "", "j", term_opts) keymap("t", "", "k", term_opts) keymap("t", "", "l", term_opts) --- Comment -keymap("n", "/", "lua require('Comment').toggle()", opts) -keymap("v", "/", ":lua require(\"Comment.api\").gc(vim.fn.visualmode())", opts) - -- Nvimtree keymap("n", "e", ":NvimTreeToggle", opts) diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua index a62e7aa..8158cf3 100644 --- a/lua/user/lsp/init.lua +++ b/lua/user/lsp/init.lua @@ -1,7 +1,8 @@ local status_ok, _ = pcall(require, "lspconfig") if not status_ok then - return + return end -require("user.lsp.lsp-installer") +require "user.lsp.lsp-installer" require("user.lsp.handlers").setup() +require "user.lsp.null-ls" diff --git a/lua/user/lsp/null-ls.lua b/lua/user/lsp/null-ls.lua new file mode 100644 index 0000000..874e19c --- /dev/null +++ b/lua/user/lsp/null-ls.lua @@ -0,0 +1,19 @@ +local null_ls_status_ok, null_ls = pcall(require, "null-ls") +if not null_ls_status_ok then + return +end + +-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting +local formatting = null_ls.builtins.formatting +-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics +local diagnostics = null_ls.builtins.diagnostics + +null_ls.setup({ + debug = false, + sources = { + formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), + formatting.black.with({ extra_args = { "--fast" } }), + formatting.stylua, + -- diagnostics.flake8 + }, +}) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 530d7bf..614545c 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -71,6 +71,7 @@ return packer.startup(function(use) 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 + use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters -- Telescope use "nvim-telescope/telescope.nvim" -- 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 From a9f3e7f837775601941c51abfcde7eb9ca708241 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 2 Jan 2022 14:28:26 -0500 Subject: remove plugin --- lua/user/plugins.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'lua/user/plugins.lua') diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 614545c..0035ad8 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -70,7 +70,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 use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters -- Telescope -- cgit v1.2.3