From 176650f0f4ca09ef1397b882ace526a9a59345c3 Mon Sep 17 00:00:00 2001 From: ImNotTwig Date: Mon, 25 Sep 2023 19:40:59 -0500 Subject: [PATCH] changed stuff --- init.lua | 2 - lazy-lock.json | 21 ++-- lua/keymaps.lua | 3 + lua/user/alpha.lua | 66 +++++++------ lua/user/autopairs.lua | 72 +++++++------- lua/user/bufferline.lua | 179 +++++++++++++++++----------------- lua/user/cmp.lua | 169 -------------------------------- lua/user/colorbuddy.lua | 3 +- lua/user/colorizer.lua | 12 ++- lua/user/coq.lua | 12 +++ lua/user/indent-blankline.lua | 20 ++++ lua/user/lsp-zero.lua | 43 ++++---- lua/user/lsp.lua | 174 ++++++++++++++++----------------- lua/user/neoscroll.lua | 10 ++ lua/user/pywal.lua | 7 -- lua/utils/init.lua | 17 ++-- 16 files changed, 341 insertions(+), 469 deletions(-) delete mode 100644 lua/user/cmp.lua create mode 100644 lua/user/coq.lua create mode 100644 lua/user/indent-blankline.lua create mode 100644 lua/user/neoscroll.lua delete mode 100644 lua/user/pywal.lua diff --git a/init.lua b/init.lua index 0a1a1b7..00f8fe5 100644 --- a/init.lua +++ b/init.lua @@ -2,5 +2,3 @@ require "options" require "keymaps" require "Lazy" require "autocommands" - - diff --git a/lazy-lock.json b/lazy-lock.json index 0ae122e..95f2ca0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,28 +1,25 @@ { "Comment.nvim": { "branch": "master", "commit": "eab2c83a0207369900e92783f56990808082eac2" }, "DAPInstall.nvim": { "branch": "main", "commit": "8798b4c36d33723e7bba6ed6e2c202f84bb300de" }, - "LuaSnip": { "branch": "master", "commit": "9bff06b570df29434a88f9c6a9cea3b21ca17208" }, + "LuaSnip": { "branch": "master", "commit": "c5fb16a934892086d4ba01bac48b77c65435025e" }, "alpha-nvim": { "branch": "main", "commit": "dafa11a6218c2296df044e00f88d9187222ba6b0" }, - "bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" }, - "bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" }, + "bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "colorbuddy.nvim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" }, - "friendly-snippets": { "branch": "main", "commit": "a6f7a1609addb4e57daa6bedc300f77f8d225ab7" }, + "coq_nvim": { "branch": "coq", "commit": "e7304683400a65e3f85e6973fcc2ad2a1bc811e6" }, "gitsigns.nvim": { "branch": "main", "commit": "ec4742a7eebf68bec663041d359b95637242b5c3" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, + "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "abd2208cf967b911402d32262042b71bdff06c26" }, "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" }, "mason.nvim": { "branch": "main", "commit": "4546dec8b56bc56bc1d81e717e4a935bc7cd6477" }, + "neoscroll.nvim": { "branch": "master", "commit": "4bc0212e9f2a7bc7fe7a6bceb15b33e39f0f41fb" }, "null-ls.nvim": { "branch": "main", "commit": "60b4a7167c79c7d04d1ff48b55f2235bf58158a7" }, - "nvim-autopairs": { "branch": "master", "commit": "0e065d423f9cf649e1d92443c939a4b5073b6768" }, - "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, + "nvim-autopairs": { "branch": "master", "commit": "de4f7138a68d5d5063170f2182fd27faf06b0b54" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, "nvim-dap": { "branch": "master", "commit": "b3d4408e29d924fe130c9397a7c3b3630b3ea671" }, "nvim-dap-ui": { "branch": "master", "commit": "1cd4764221c91686dcf4d6b62d7a7b2d112e0b13" }, @@ -34,10 +31,8 @@ "nvim-web-devicons": { "branch": "master", "commit": "e283ab937e0197b37ec5d8013e49495193407324" }, "plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" }, "project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" }, - "pywal.nvim": { "branch": "main", "commit": "d11b673c0e3d6eb8cbee7ea8cf4a8911f6ee24b9" }, "telescope.nvim": { "branch": "master", "commit": "40c31fdde93bcd85aeb3447bb3e2a3208395a868" }, "toggleterm.nvim": { "branch": "main", "commit": "19aad0f41f47affbba1274f05e3c067e6d718e1e" }, - "tokyonight-night": { "branch": "main", "commit": "e52c41314e83232840d6970e6b072f9fba242eb9" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vim-illuminate": { "branch": "master", "commit": "d6ca7f77eeaf61b3e6ce9f0e5a978d606df44298" }, "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" } diff --git a/lua/keymaps.lua b/lua/keymaps.lua index fe63229..e159694 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -68,6 +68,9 @@ keymap("i", "", "{", opts) keymap("i", "", "E", opts) keymap("i", "", "B", opts) +-- deleting back a word +keymap("i", "", "", opts) + -- Visual -- -- Stay in indent mode keymap("v", "<", ""), - dashboard.button("e", " " .. " New file", ":ene startinsert "), - dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()"), - dashboard.button("r", "󰄉 " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), - dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), - dashboard.button("q", " " .. " Quit", ":qa"), - } - local function footer() - return "chrisatmachine.com" - end + local alpha = require "alpha" + local dashboard = require "alpha.themes.dashboard" + dashboard.section.header.val = { + [[ ███╗░░░███╗███████╗░█████╗░░██╗░░░░░░░██╗ ]], + [[ ████╗░████║██╔════╝██╔══██╗░██║░░██╗░░██║ ]], + [[ ██╔████╔██║█████╗░░██║░░██║░╚██╗████╗██╔╝ ]], + [[ ██║╚██╔╝██║██╔══╝░░██║░░██║░░████╔═████║░ ]], + [[ ██║░╚═╝░██║███████╗╚█████╔╝░░╚██╔╝░╚██╔╝░ ]], + [[ ╚═╝░░░░░╚═╝╚══════╝░╚════╝░░░░╚═╝░░░╚═╝░░ ]], + } + dashboard.section.buttons.val = { + dashboard.button("f", " " .. " Find file", ":Telescope find_files "), + dashboard.button("e", " " .. " New file", ":ene startinsert "), + dashboard.button( + "p", + " " .. " Find project", + ":lua require('telescope').extensions.projects.projects()" + ), + dashboard.button("r", "󰄉 " .. " Recent files", ":Telescope oldfiles "), + dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), + dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), + dashboard.button("q", " " .. " Quit", ":qa"), + } + local function footer() + return "Welcome, Lydia" + end - dashboard.section.footer.val = footer() + dashboard.section.footer.val = footer() - dashboard.section.footer.opts.hl = "Type" - dashboard.section.header.opts.hl = "Include" - dashboard.section.buttons.opts.hl = "Keyword" + dashboard.section.footer.opts.hl = "Function" + dashboard.section.header.opts.hl = "Boolean" + dashboard.section.buttons.opts.hl = "Keyword" - dashboard.opts.opts.noautocmd = true - alpha.setup(dashboard.opts) + dashboard.opts.opts.noautocmd = true + alpha.setup(dashboard.opts) end return M diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua index f9e7c5a..6864d11 100644 --- a/lua/user/autopairs.lua +++ b/lua/user/autopairs.lua @@ -1,44 +1,46 @@ local M = { - "windwp/nvim-autopairs", - commit = "0e065d423f9cf649e1d92443c939a4b5073b6768", - event = "InsertEnter", - dependencies = { - { - "hrsh7th/nvim-cmp", - event = { - "InsertEnter", - "CmdlineEnter", - }, - }, - }, + "windwp/nvim-autopairs", + lazy = false, } function M.config() - require("nvim-autopairs").setup { - check_ts = true, -- treesitter integration - disable_filetype = { "TelescopePrompt" }, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, - } + local remap = vim.api.nvim_set_keymap + local npairs = require "nvim-autopairs" - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - local cmp = require "cmp" + npairs.setup { map_bs = false } - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done {}) + vim.g.coq_settings = { keymap = { recommended = false } } + + -- these mappings are coq recommended mappings unrelated to nvim-autopairs + remap("i", "", [[pumvisible() ? "" : ""]], { expr = true, noremap = true }) + remap("i", "", [[pumvisible() ? "" : ""]], { expr = true, noremap = true }) + remap("i", "", [[pumvisible() ? "" : ""]], { expr = true, noremap = true }) + remap("i", "", [[pumvisible() ? "" : ""]], { expr = true, noremap = true }) + + -- skip it, if you use another global object + _G.MUtils = {} + + MUtils.CR = function() + if vim.fn.pumvisible() ~= 0 then + if vim.fn.complete_info({ "selected" }).selected ~= -1 then + return npairs.esc "" + else + return npairs.esc "" .. npairs.autopairs_cr() + end + else + return npairs.autopairs_cr() + end + end + remap("i", "", "v:lua.MUtils.CR()", { expr = true, noremap = true }) + + MUtils.BS = function() + if vim.fn.pumvisible() ~= 0 and vim.fn.complete_info({ "mode" }).mode == "eval" then + return npairs.esc "" .. npairs.autopairs_bs() + else + return npairs.autopairs_bs() + end + end + remap("i", "", "v:lua.MUtils.BS()", { expr = true, noremap = true }) end return M diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua index 3d0c780..cc18429 100644 --- a/lua/user/bufferline.lua +++ b/lua/user/bufferline.lua @@ -1,97 +1,96 @@ local M = { - "akinsho/bufferline.nvim", - commit = "c7492a76ce8218e3335f027af44930576b561013", - event = { "BufReadPre", "BufAdd", "BufNew", "BufReadPost" }, - dependencies = { - { - "famiu/bufdelete.nvim", - commit = "8933abc09df6c381d47dc271b1ee5d266541448e", + "akinsho/bufferline.nvim", + event = { "BufReadPre", "BufAdd", "BufNew", "BufReadPost" }, + dependencies = { + { + "famiu/bufdelete.nvim", + "nvim-tree/nvim-web-devicons", + }, }, - }, } function M.config() - require("bufferline").setup { - options = { - 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" - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, - }, - highlights = { - fill = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - italic = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - italic = true, - }, - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, - } + require("bufferline").setup { + options = { + 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" + offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, + separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, + }, + highlights = { + fill = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + background = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + buffer_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + close_button = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + close_button_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + tab_selected = { + fg = { attribute = "fg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + tab = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + tab_close = { + -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, + fg = { attribute = "fg", highlight = "TabLineSel" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + duplicate_selected = { + fg = { attribute = "fg", highlight = "TabLineSel" }, + bg = { attribute = "bg", highlight = "TabLineSel" }, + italic = true, + }, + duplicate_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + italic = true, + }, + duplicate = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + italic = true, + }, + modified = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + modified_selected = { + fg = { attribute = "fg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + modified_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + separator = { + fg = { attribute = "bg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + separator_selected = { + fg = { attribute = "bg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + indicator_selected = { + fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + }, + } end return M diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua deleted file mode 100644 index 0ae038a..0000000 --- a/lua/user/cmp.lua +++ /dev/null @@ -1,169 +0,0 @@ -local M = { - "hrsh7th/nvim-cmp", - commit = "cfafe0a1ca8933f7b7968a287d39904156f2c57d", - dependencies = { - { - "hrsh7th/cmp-nvim-lsp", - commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef", - }, - { - "hrsh7th/cmp-buffer", - commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa", - }, - { - "hrsh7th/cmp-path", - commit = "91ff86cd9c29299a64f968ebb45846c485725f23", - }, - { - "hrsh7th/cmp-cmdline", - commit = "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063", - }, - { - "saadparwaiz1/cmp_luasnip", - commit = "18095520391186d634a0045dacaa346291096566", - }, - { - "L3MON4D3/LuaSnip", - commit = "9bff06b570df29434a88f9c6a9cea3b21ca17208", - event = "InsertEnter", - dependencies = { - "rafamadriz/friendly-snippets", - commit = "a6f7a1609addb4e57daa6bedc300f77f8d225ab7", - }, - }, - { - "hrsh7th/cmp-nvim-lua", - commit = "f3491638d123cfd2c8048aefaf66d246ff250ca6", - }, - }, - event = { - "InsertEnter", - "CmdlineEnter", - }, -} - -function M.config() - local cmp = require "cmp" - local luasnip = require "luasnip" - require("luasnip/loaders/from_vscode").lazy_load() - - local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" - end - - local kind_icons = { - Text = "󰉿", - Method = "m", - Function = "󰊕", - Constructor = "", - Field = "", - Variable = "󰆧", - Class = "󰌗", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "", - Folder = "󰉋", - EnumMember = "", - Constant = "󰇽", - Struct = "", - Event = "", - Operator = "󰆕", - TypeParameter = "󰊄", - Codeium = "󰚩", - Copilot = "", - } - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = true }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - vim_item.kind = kind_icons[vim_item.kind] - vim_item.menu = ({ - nvim_lsp = "", - nvim_lua = "", - luasnip = "", - buffer = "", - path = "", - emoji = "", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - experimental = { - ghost_text = true, - }, - } -end - -return M diff --git a/lua/user/colorbuddy.lua b/lua/user/colorbuddy.lua index 43746c8..6a4fbb9 100644 --- a/lua/user/colorbuddy.lua +++ b/lua/user/colorbuddy.lua @@ -89,6 +89,7 @@ function M.config() Group.new('Macro' , colors.foreground) Group.new('PreProc' , colors.foreground) Group.new('NormalFloat' , colors.foreground) + Group.new('MatchParen' , colors.foreground , colors.purple , styles.bold ) Group.new('Directory' , colors.foreground) Group.new('netrwList' , colors.yellow) @@ -125,8 +126,6 @@ function M.config() Group.new('Define' , colors.green , colors.none , styles.italic ) Group.new('Function' , colors.green , colors.none , styles.italic ) Group.new('luaFunctionCall' , groups.Function , groups.Function , groups.Function) - - end return M diff --git a/lua/user/colorizer.lua b/lua/user/colorizer.lua index 6689e64..fe1a119 100644 --- a/lua/user/colorizer.lua +++ b/lua/user/colorizer.lua @@ -1,11 +1,15 @@ local M = { - "norcalli/nvim-colorizer.lua", - lazy = false, - priority = 1000, + "norcalli/nvim-colorizer.lua", + lazy = false, + priority = 1000, } function M.config() - require("colorizer").setup() + require("colorizer").setup({ + "*", + }, { + rgb_fn = true, + }) end return M diff --git a/lua/user/coq.lua b/lua/user/coq.lua new file mode 100644 index 0000000..1db033b --- /dev/null +++ b/lua/user/coq.lua @@ -0,0 +1,12 @@ +local M = { + 'ms-jpq/coq_nvim', + branch = "coq", + lazy = false, +} + + +function M.config() + vim.api.nvim_command(":COQnow") +end + +return M diff --git a/lua/user/indent-blankline.lua b/lua/user/indent-blankline.lua new file mode 100644 index 0000000..d531d7d --- /dev/null +++ b/lua/user/indent-blankline.lua @@ -0,0 +1,20 @@ +local M = { + "lukas-reineke/indent-blankline.nvim", + lazy = false, +} + +function M.config() + vim.opt.termguicolors = true + vim.cmd [[highlight IndentBlanklineIndent1 guifg=#2A2A2A gui=nocombine]] + + vim.opt.list = true + + require("indent_blankline").setup { + space_char_blankline = " ", + char_highlight_list = { + "IndentBlanklineIndent1", + }, + } +end + +return M diff --git a/lua/user/lsp-zero.lua b/lua/user/lsp-zero.lua index eed3bb2..ed896e0 100644 --- a/lua/user/lsp-zero.lua +++ b/lua/user/lsp-zero.lua @@ -1,32 +1,33 @@ M = { - "VonHeikemen/lsp-zero.nvim", - branch = "v2.x", - dependencies = { - -- LSP Support - { "neovim/nvim-lspconfig" }, -- Required - { "williamboman/mason.nvim" }, -- Optional - { "williamboman/mason-lspconfig.nvim" }, -- Optional + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + dependencies = { + -- LSP Support + { "neovim/nvim-lspconfig" }, -- Required + { "williamboman/mason.nvim" }, -- Optional + { "williamboman/mason-lspconfig.nvim" }, -- Optional - -- Autocompletion - { "hrsh7th/nvim-cmp" }, -- Required - { "hrsh7th/cmp-nvim-lsp" }, -- Required - { "L3MON4D3/LuaSnip" }, -- Required - }, + -- Autocompletion + { "hrsh7th/nvim-cmp" }, -- Required + { "hrsh7th/cmp-nvim-lsp" }, -- Required + { "L3MON4D3/LuaSnip" }, -- Required + }, } function M.config() - local lsp = require("lsp-zero").preset {} + local lsp = require("lsp-zero").preset {} - lsp.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp.default_keymaps { buffer = bufnr } - end) + lsp.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp.default_keymaps { buffer = bufnr } + end) - -- (Optional) Configure lua language server for neovim - require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) + -- (Optional) Configure lua language server for neovim + require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) + require("lspconfig").gopls.setup {} - lsp.setup() + lsp.setup() end return M diff --git a/lua/user/lsp.lua b/lua/user/lsp.lua index 59ce7e0..59b1f0a 100644 --- a/lua/user/lsp.lua +++ b/lua/user/lsp.lua @@ -1,105 +1,105 @@ local M = { - "neovim/nvim-lspconfig", - commit = "649137cbc53a044bffde36294ce3160cb18f32c7", - lazy = false, - event = { "BufReadPre" }, - dependencies = { - { - "hrsh7th/cmp-nvim-lsp", - commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef", + "neovim/nvim-lspconfig", + commit = "649137cbc53a044bffde36294ce3160cb18f32c7", + lazy = false, + event = { "BufReadPre" }, + dependencies = { + { + "hrsh7th/cmp-nvim-lsp", + commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef", + }, }, - }, } function M.config() - local cmp_nvim_lsp = require "cmp_nvim_lsp" + local cmp_nvim_lsp = require "cmp_nvim_lsp" - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities) + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities) - local function lsp_keymaps(bufnr) - local opts = { noremap = true, silent = true } - local keymap = vim.api.nvim_buf_set_keymap - keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) - keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) - keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) - keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) - keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) - keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) - keymap(bufnr, "n", "li", "LspInfo", opts) - keymap(bufnr, "n", "lI", "Mason", opts) - keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) - keymap(bufnr, "n", "lj", "lua vim.diagnostic.goto_next({buffer=0})", opts) - keymap(bufnr, "n", "lk", "lua vim.diagnostic.goto_prev({buffer=0})", opts) - keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) - keymap(bufnr, "n", "ls", "lua vim.lsp.buf.signature_help()", opts) - keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) - end - - local lspconfig = require "lspconfig" - local on_attach = function(client, bufnr) - lsp_keymaps(bufnr) - require("illuminate").on_attach(client) - end - - for _, server in pairs(require("utils").servers) do - Opts = { - on_attach = on_attach, - capabilities = capabilities, - } - - server = vim.split(server, "@")[1] - - local require_ok, conf_opts = pcall(require, "settings." .. server) - if require_ok then - Opts = vim.tbl_deep_extend("force", conf_opts, Opts) + local function lsp_keymaps(bufnr) + local opts = { noremap = true, silent = true } + local keymap = vim.api.nvim_buf_set_keymap + keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) + keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) + keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) + keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) + keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) + keymap(bufnr, "n", "li", "LspInfo", opts) + keymap(bufnr, "n", "lI", "Mason", opts) + keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) + keymap(bufnr, "n", "lj", "lua vim.diagnostic.goto_next({buffer=0})", opts) + keymap(bufnr, "n", "lk", "lua vim.diagnostic.goto_prev({buffer=0})", opts) + keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) + keymap(bufnr, "n", "ls", "lua vim.lsp.buf.signature_help()", opts) + keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) end - lspconfig[server].setup(Opts) - end + local lspconfig = require "lspconfig" + local on_attach = function(client, bufnr) + lsp_keymaps(bufnr) + require("illuminate").on_attach(client) + end - local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - } + for _, server in pairs(require("utils").servers) do + Opts = { + on_attach = on_attach, + capabilities = capabilities, + } - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) - end + server = vim.split(server, "@")[1] - local config = { - -- disable virtual text - virtual_text = false, - -- show signs - signs = { - active = signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - suffix = "", - }, - } + local require_ok, conf_opts = pcall(require, "settings." .. server) + if require_ok then + Opts = vim.tbl_deep_extend("force", conf_opts, Opts) + end - vim.diagnostic.config(config) + lspconfig[server].setup(Opts) + end - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { - border = "rounded", - }) + local signs = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, + } - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "rounded", - }) + for _, sign in ipairs(signs) do + vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) + end + + local config = { + -- disable virtual text + virtual_text = false, + -- show signs + signs = { + active = signs, + }, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + suffix = "", + }, + } + + vim.diagnostic.config(config) + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = "rounded", + }) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { + border = "rounded", + }) end return M diff --git a/lua/user/neoscroll.lua b/lua/user/neoscroll.lua new file mode 100644 index 0000000..08958e2 --- /dev/null +++ b/lua/user/neoscroll.lua @@ -0,0 +1,10 @@ +local M = { + "karb94/neoscroll.nvim", + lazy = false +} + +function M.config() + require('neoscroll').setup() +end + +return M diff --git a/lua/user/pywal.lua b/lua/user/pywal.lua deleted file mode 100644 index 2ef83d7..0000000 --- a/lua/user/pywal.lua +++ /dev/null @@ -1,7 +0,0 @@ -local M = { - "AlphaTechnolog/pywal.nvim", - lazy = false, - priority = 1000, -} - -return M diff --git a/lua/utils/init.lua b/lua/utils/init.lua index 448b943..ba45cd8 100644 --- a/lua/utils/init.lua +++ b/lua/utils/init.lua @@ -1,14 +1,15 @@ local M = {} M.servers = { - "lua_ls", - "cssls", - "html", - "tsserver", - "pyright", - "bashls", - "jsonls", - "yamlls", + "lua_ls", + "cssls", + "html", + "tsserver", + "pyright", + "bashls", + "jsonls", + "yamlls", + "gopls", } return M