diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 1a64a14..728451e 100755 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -53,15 +53,37 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ cmp_mappings[''] = nil cmp_mappings[''] = nil +local lspkind = require('lspkind') + cmp.setup({ sources = { { name = 'path' }, { name = 'nvim_lsp' }, + { name = 'lsp-zero' }, { name = 'nvim_lua' }, { name = 'luasnip', keyword_length = 2 }, { name = 'buffer', keyword_length = 3 }, }, - formatting = lsp.cmp_format(), + view = { + entries = 'native', + }, + completion = { + completeopt = 'menu,menuone,noinsert' + }, + window = { + documentation = cmp.config.window.bordered() + }, + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol_text', + menu = ({ + buffer = '[Buffer]', + nvim_lsp = '[LSP]', + nvim_lua = '[Lua]', + luasnip = '[LuaSnip]' + }) + }) + }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), @@ -71,8 +93,9 @@ cmp.setup({ [''] = nil }), }) + lsp.set_preferences({ - suggest_lsp_servers = false, + suggest_lsp_servers = true, sign_icons = { error = 'E', warn = 'W', diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua index a51b983..bf0623e 100644 --- a/after/plugin/lualine.lua +++ b/after/plugin/lualine.lua @@ -1,11 +1,57 @@ +local theme = function() + local colors = { + darkgray = "#181825", + gray = "#cdd6f4", + innerbg = nil, + outerbg = "#313244", + normal = "#89b4fa", + insert = "#a6e3a1", + visual = "#cdd6f4", + replace = "#f38ba8", + command = "#fab387", + } + return { + inactive = { + a = { fg = colors.gray, bg = colors.outerbg, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + visual = { + a = { fg = colors.darkgray, bg = colors.visual, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + replace = { + a = { fg = colors.darkgray, bg = colors.replace, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + normal = { + a = { fg = colors.darkgray, bg = colors.normal, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + insert = { + a = { fg = colors.darkgray, bg = colors.insert, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + command = { + a = { fg = colors.darkgray, bg = colors.command, gui = "bold" }, + b = { fg = colors.gray, bg = colors.outerbg }, + c = { fg = colors.gray, bg = colors.innerbg }, + }, + } +end + require('lualine').setup { options = { icons_enabled = true, - theme = 'auto', + theme = theme(), component_separators = { left = '', right = '' }, section_separators = { left = '', right = '' }, disabled_filetypes = { - statusline = {}, + statusline = { 'packer' }, winbar = {}, }, ignore_focus = {}, diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 22bec77..d07463f 100755 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -2,7 +2,8 @@ local builtin = require('telescope.builtin') vim.keymap.set("n", "pf", builtin.find_files, {}) vim.keymap.set("n", "", builtin.git_files, {}) vim.keymap.set("n", "ps", function() - local status, result = pcall(function() vim.fn.input("Grep > ") end) + local status, result = pcall(function() return vim.fn.input("Grep > ") end) + -- -- prevent keyboard interrupt error if not status then return diff --git a/lua/409/packer.lua b/lua/409/packer.lua index 4cd9e6a..68c9e98 100755 --- a/lua/409/packer.lua +++ b/lua/409/packer.lua @@ -29,6 +29,8 @@ return require('packer').startup(function(use) requires = { { 'nvim-lua/plenary.nvim' } } } + use('onsails/lspkind.nvim') + use('mbbill/undotree') use('tpope/vim-fugitive') diff --git a/lua/409/set.lua b/lua/409/set.lua index dc31993..74c735e 100755 --- a/lua/409/set.lua +++ b/lua/409/set.lua @@ -34,3 +34,5 @@ vim.g.mapleader = ' ' vim.g.netrw_browse_split = 0 vim.g.netrw_banner = 0 vim.g.netrw_winsize = 25 + +vim.opt.showmode = false diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index baaf46a..5ada21a 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -99,6 +99,11 @@ _G.packer_plugins = { path = "/home/j409/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", url = "https://github.com/VonHeikemen/lsp-zero.nvim" }, + ["lspkind.nvim"] = { + loaded = true, + path = "/home/j409/.local/share/nvim/site/pack/packer/start/lspkind.nvim", + url = "https://github.com/onsails/lspkind.nvim" + }, ["lualine.nvim"] = { loaded = true, path = "/home/j409/.local/share/nvim/site/pack/packer/start/lualine.nvim",