diff --git a/README.md b/README.md index 67ec0dc..f00b9f2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,4 @@ # Neovim Config To use this neovim config, run `git clone https://code.relms.dev/Relms/neovim-config ~/.config/nvim` to clone the config to your .config folder. -When you open the config for the first time, you will get a packer.nvim window to open which will open all the required plugins. After that, close Neovim again and reopen it. It will then proceed to install a bunch of treesitter parsers. That is normal. - -## Using GitHub copilot - - TODO +When you open the config for the first time, you will get a packer.nvim window to open which will open all the required plugins. After that, close Neovim again and reopen it. diff --git a/init.lua b/init.lua index aa12f23..ddf319e 100644 --- a/init.lua +++ b/init.lua @@ -1,31 +1,5 @@ -require("user.disable") -require("user.impatient") -require("user.options") -require("user.keymaps") -require("user.plugins") -require("user.notify") -require("user.navic") -require("user.cmp") -require("user.lsp") -require("user.telescope") -require("user.autopairs") -require("user.comment") -require("user.gitsigns") -require("user.bufferline") -require("user.whitespace") -require("user.lualine") -require("user.toggleterm") -require("user.indentline") -require("user.legendary") -require("user.whichkey") -require("user.trouble") -require("user.colorizer") -require("user.discord") -require("user.spectre") -require("user.dap") -require("user.treesitter") -require("user.dressing") -require("user.cybu") -require("user.autocommands") -require("user.gps") -require("user.ufo") +require("plugins.configs.impatient") +require("core.disable") +require("core.options") +require("core.keymaps") +require("plugins.packer") diff --git a/lua/user/disable.lua b/lua/core/disable.lua similarity index 59% rename from lua/user/disable.lua rename to lua/core/disable.lua index 40f8c74..2ae1e62 100644 --- a/lua/user/disable.lua +++ b/lua/core/disable.lua @@ -1,5 +1,4 @@ --- Disable some builtin vim plugins -local disabled_built_ins = { +local default_plugins = { "2html_plugin", "getscript", "getscriptPlugin", @@ -10,16 +9,24 @@ local disabled_built_ins = { "netrwSettings", "netrwFileHandlers", "matchit", - "matchparen", "tar", "tarPlugin", "rrhelper", + "spellfile_plugin", "vimball", "vimballPlugin", "zip", "zipPlugin", + "tutor", + "rplugin", + "syntax", + "synmenu", + "optwin", + "compiler", + "bugreport", + "ftplugin", } -for _, plugin in pairs(disabled_built_ins) do +for _, plugin in pairs(default_plugins) do vim.g["loaded_" .. plugin] = 1 end diff --git a/lua/user/keymaps.lua b/lua/core/keymaps.lua similarity index 98% rename from lua/user/keymaps.lua rename to lua/core/keymaps.lua index a50101f..58e0bd2 100644 --- a/lua/user/keymaps.lua +++ b/lua/core/keymaps.lua @@ -43,8 +43,8 @@ keymap("n", "fd", ":Telescope dap commands", opts) -- Comment keymap("n", "/", ":lua require('Comment').toggle()", opts) --- Nvim-Tree -keymap("n", "e", ":NvimTreeToggle", opts) +-- Neotree +keymap("n", "e", ":Neotree toggle", opts) -- Trouble keymap("n", "xx", ":Trouble", opts) diff --git a/lua/user/options.lua b/lua/core/options.lua similarity index 88% rename from lua/user/options.lua rename to lua/core/options.lua index 0a1fbd6..781ae4b 100644 --- a/lua/user/options.lua +++ b/lua/core/options.lua @@ -4,6 +4,7 @@ vim.opt.cmdheight = 2 vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.conceallevel = 0 vim.opt.fileencoding = "utf-8" +vim.o.background = "dark" vim.opt.hlsearch = true vim.opt.ignorecase = true vim.opt.mouse = "a" @@ -36,16 +37,16 @@ vim.opt.incsearch = true vim.opt.colorcolumn = "120" vim.opt.list = true vim.opt.listchars:append("lead:.") -vim.opt.winbar = "%{%v:lua.require'user.winbar'.get_winbar()%}" vim.opt.foldcolumn = "2" vim.opt.foldlevel = 99 vim.opt.foldlevelstart = -1 vim.opt.foldenable = true vim.opt.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] - vim.cmd("set whichwrap+=<,>,[,],h,l") -vim.cmd([[set iskeyword+=-]]) -vim.cmd([[set formatoptions-=cro]]) +vim.cmd("set iskeyword+=-") +vim.cmd("set formatoptions-=cro") +vim.cmd("set foldmethod=expr") +vim.cmd("set foldexpr=nvim_treesitter#foldexpr()") vim.cmd( "let g:clipboard = { 'copy': { '+': 'xsel', '*': 'xsel' }, 'paste': { '+': 'xsel', '*': 'xsel' }, 'cache_enabled': 0 }" diff --git a/lua/user/alpha.lua b/lua/plugins/configs/alpha.lua similarity index 88% rename from lua/user/alpha.lua rename to lua/plugins/configs/alpha.lua index 749ea2c..7095115 100644 --- a/lua/user/alpha.lua +++ b/lua/plugins/configs/alpha.lua @@ -1,8 +1,4 @@ -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - +local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") dashboard.section.header.val = { " ▟▙", @@ -27,16 +23,16 @@ local function footer() local total_plugins = #vim.tbl_keys(packer_plugins) local datetime = os.date("%d-%m-%Y %H:%M:%S") local plugins_text = "  " - .. total_plugins - .. " plugins" - .. "  v" - .. vim.version().major - .. "." - .. vim.version().minor - .. "." - .. vim.version().patch - .. "  " - .. datetime + .. total_plugins + .. " plugins" + .. "  v" + .. vim.version().major + .. "." + .. vim.version().minor + .. "." + .. vim.version().patch + .. "  " + .. datetime -- Quote local fortune = require("alpha.fortune") diff --git a/lua/plugins/configs/autopairs.lua b/lua/plugins/configs/autopairs.lua new file mode 100644 index 0000000..d221ac4 --- /dev/null +++ b/lua/plugins/configs/autopairs.lua @@ -0,0 +1,10 @@ +local autopairs = require("nvim-autopairs") + +autopairs.setup({ + check_ts = true, + disable_filetype = { "TelescopePrompt" }, +}) + +local cmp_autopairs = require("nvim-autopairs.completion.cmp") +local cmp = require("cmp") +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua new file mode 100644 index 0000000..6e7456b --- /dev/null +++ b/lua/plugins/configs/cmp.lua @@ -0,0 +1,55 @@ +local cmp = require("cmp") +local lspkind = require("lspkind") + +cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + completion = { completeopt = "menu,menuone,noinsert", keyword_length = 1 }, + sources = { + { name = "nvim_lsp" }, + { name = "nvim_lua" }, + { name = "vsnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + window = { + documentation = { + border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, + }, + }, + experimental = { + ghost_text = true, + native_menu = false, + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + format = lspkind.cmp_format({ + mode = "symbol_text", + maxwidth = 50, + before = function(entry, vim_item) + vim_item.menu = ({ + nvim_lsp = "[LSP]", + nvim_lua = "[NVIM_LUA]", + vsnip = "[SNIPPET]", + buffer = "[BUFFER]", + path = "[PATH]", + })[entry.source.name] + return vim_item + end, + }), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), +}) diff --git a/lua/plugins/configs/impatient.lua b/lua/plugins/configs/impatient.lua new file mode 100644 index 0000000..0c94abe --- /dev/null +++ b/lua/plugins/configs/impatient.lua @@ -0,0 +1,5 @@ +local present, impatient = pcall(require, "impatient") + +if not present then + return +end diff --git a/lua/user/lsp/handlers.lua b/lua/plugins/configs/lsp/handlers.lua similarity index 84% rename from lua/user/lsp/handlers.lua rename to lua/plugins/configs/lsp/handlers.lua index a9b440c..e8fd9e2 100644 --- a/lua/user/lsp/handlers.lua +++ b/lua/plugins/configs/lsp/handlers.lua @@ -43,18 +43,12 @@ end local function attach_navic(client, bufnr) vim.g.navic_silence = false - local status_ok, navic = pcall(require, "nvim-navic") - if not status_ok then - return - end + local navic = require("nvim-navic") navic.attach(client, bufnr) end local function lsp_highlight_document(client) - local status_ok, illuminate = pcall(require, "illuminate") - if not status_ok then - return - end + local illuminate = require("illuminate") illuminate.on_attach(client) end @@ -84,17 +78,9 @@ end -- Define Capabilities local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.snippetSupport = true -capabilities.textDocument.foldingRange = { - dynamicRegistration = false, - lineFoldingOnly = true, -} -local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +local cmp_lsp = require("cmp_nvim_lsp") -if not status_ok then - return -end - -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) +M.capabilities = cmp_lsp.update_capabilities(capabilities) return M diff --git a/lua/plugins/configs/lsp/init.lua b/lua/plugins/configs/lsp/init.lua new file mode 100644 index 0000000..95f2cb6 --- /dev/null +++ b/lua/plugins/configs/lsp/init.lua @@ -0,0 +1,7 @@ +require("plugins.configs.lsp.handlers").setup() +require("plugins.configs.lsp.nlspsettings") +require("plugins.configs.lsp.nullls") +require("plugins.configs.lsp.mason") +require("plugins.configs.lsp.lspsaga") +require("plugins.configs.lsp.signature") +require("plugins.configs.lsp.lsplines") diff --git a/lua/plugins/configs/lsp/lsplines.lua b/lua/plugins/configs/lsp/lsplines.lua new file mode 100644 index 0000000..f4d7f07 --- /dev/null +++ b/lua/plugins/configs/lsp/lsplines.lua @@ -0,0 +1,7 @@ +local lines = require("lsp_lines") + +lines.setup() + +vim.diagnostic.config({ + virtual_text = false, +}) diff --git a/lua/plugins/configs/lsp/lspsaga.lua b/lua/plugins/configs/lsp/lspsaga.lua new file mode 100644 index 0000000..9c3601b --- /dev/null +++ b/lua/plugins/configs/lsp/lspsaga.lua @@ -0,0 +1,3 @@ +local lspsaga = require("lspsaga") + +lspsaga.init_lsp_saga({}) diff --git a/lua/plugins/configs/lsp/mason.lua b/lua/plugins/configs/lsp/mason.lua new file mode 100644 index 0000000..e455a34 --- /dev/null +++ b/lua/plugins/configs/lsp/mason.lua @@ -0,0 +1,29 @@ +local mason = require("mason") +local lspconfig = require("lspconfig") +local mason_lspconfig = require("mason-lspconfig") + +mason.setup() +mason_lspconfig.setup() + +lspconfig.util.default_config = vim.tbl_extend("force", lspconfig.util.default_config, { + on_attach = require("plugins.configs.lsp.handlers").on_attach, + capabilities = require("plugins.configs.lsp.handlers").capabilities, +}) + +mason_lspconfig.setup_handlers({ + function(server_name) + lspconfig[server_name].setup({}) + end, + ["jsonls"] = function() + local schemastore = require("schemastore") + + lspconfig.jsonls.setup({ + settings = { + json = { + schemas = schemastore.json.schemas(), + validate = { enable = true }, + }, + }, + }) + end, +}) diff --git a/lua/user/lsp/nlspsettings.lua b/lua/plugins/configs/lsp/nlspsettings.lua similarity index 71% rename from lua/user/lsp/nlspsettings.lua rename to lua/plugins/configs/lsp/nlspsettings.lua index 4e74f3e..825b93b 100644 --- a/lua/user/lsp/nlspsettings.lua +++ b/lua/plugins/configs/lsp/nlspsettings.lua @@ -1,7 +1,7 @@ local nlspsettings = require("nlspsettings") nlspsettings.setup({ - config_home = vim.fn.stdpath("config") .. "/lua/user/lsp/settings/json", + config_home = vim.fn.stdpath("config") .. "/lua/plugins/configs/lsp/settings", local_settings_dir = ".nlsp-settings", local_settings_root_markers = { ".git" }, append_default_schemas = true, diff --git a/lua/user/lsp/nullls.lua b/lua/plugins/configs/lsp/nullls.lua similarity index 62% rename from lua/user/lsp/nullls.lua rename to lua/plugins/configs/lsp/nullls.lua index 63d80b2..9d8f29d 100644 --- a/lua/user/lsp/nullls.lua +++ b/lua/plugins/configs/lsp/nullls.lua @@ -1,7 +1,4 @@ -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end +local null_ls = require("null-ls") local formatting = null_ls.builtins.formatting local code_actions = null_ls.builtins.code_actions @@ -11,13 +8,9 @@ null_ls.setup({ debug = false, sources = { formatting.stylua, - code_actions.eslint_d, - diagnostics.eslint_d, - formatting.eslint_d, diagnostics.markdownlint, formatting.markdownlint, diagnostics.yamllint, - formatting.rustfmt, diagnostics.actionlint, }, }) diff --git a/lua/plugins/configs/lsp/settings/eslint.json b/lua/plugins/configs/lsp/settings/eslint.json new file mode 100644 index 0000000..716ec4a --- /dev/null +++ b/lua/plugins/configs/lsp/settings/eslint.json @@ -0,0 +1,3 @@ +{ + "eslint.codeActionsOnSave.enable": true +} diff --git a/lua/plugins/configs/lsp/settings/sumneko_lua.json b/lua/plugins/configs/lsp/settings/sumneko_lua.json new file mode 100644 index 0000000..8f676b9 --- /dev/null +++ b/lua/plugins/configs/lsp/settings/sumneko_lua.json @@ -0,0 +1,5 @@ +{ + "Lua.diagnostics.globals": [ + "vim" + ] +} diff --git a/lua/plugins/configs/lsp/signature.lua b/lua/plugins/configs/lsp/signature.lua new file mode 100644 index 0000000..f4c2dca --- /dev/null +++ b/lua/plugins/configs/lsp/signature.lua @@ -0,0 +1,8 @@ +local signature = require("lsp_signature") + +local cfg = { + floating_window = false, +} + +signature.setup(cfg) +signature.on_attach(cfg) diff --git a/lua/plugins/configs/lualine.lua b/lua/plugins/configs/lualine.lua new file mode 100644 index 0000000..41b3fb4 --- /dev/null +++ b/lua/plugins/configs/lualine.lua @@ -0,0 +1,55 @@ +local lualine = require("lualine") +local winbar = require("plugins.configs.winbar") + +lualine.setup({ + options = { + icons_enabled = true, + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { "alpha", "neo-tree" }, + always_divide_middle = true, + refresh = { + winbar = 50, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename", "filesize" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "location" }, + }, + tabline = { + lualine_a = { "buffers" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "tabs" }, + }, + winbar = { + lualine_a = {}, + lualine_b = { winbar.get_fileicon() .. winbar.get_filename() }, + lualine_c = { winbar.get_location }, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, + inactive_winbar = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {}, + }, +}) diff --git a/lua/plugins/configs/neotree.lua b/lua/plugins/configs/neotree.lua new file mode 100644 index 0000000..f8fe739 --- /dev/null +++ b/lua/plugins/configs/neotree.lua @@ -0,0 +1,18 @@ +local neotree = require("neo-tree") + +neotree.setup({ + popup_border_style = "rounded", + filesystem = { + filtered_items = { + visible = true, + force_visible_in_empty_folder = false, + show_hidden_count = true, + hide_dotfiles = false, + hide_gitignored = false, + }, + }, + source_selector = { + winbar = true, + statusline = true, + }, +}) diff --git a/lua/plugins/configs/nightfox.lua b/lua/plugins/configs/nightfox.lua new file mode 100644 index 0000000..ce68292 --- /dev/null +++ b/lua/plugins/configs/nightfox.lua @@ -0,0 +1,5 @@ +local present, nightfox = pcall(require, "nightfox") + +if present then + vim.cmd("colorscheme nordfox") +end diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua new file mode 100644 index 0000000..249629a --- /dev/null +++ b/lua/plugins/configs/telescope.lua @@ -0,0 +1,46 @@ +local telescope = require("telescope") + +local actions = require("telescope.actions") + +telescope.setup({ + defaults = { + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "bottom", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + path_display = { "truncate" }, + winblend = 0, + border = {}, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + mappings = { + n = { ["q"] = require("telescope.actions").close }, + }, + }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "ignore_case", + }, + }, +}) + +telescope.load_extension("fzf") diff --git a/lua/user/toggleterm.lua b/lua/plugins/configs/toggleterm.lua similarity index 81% rename from lua/user/toggleterm.lua rename to lua/plugins/configs/toggleterm.lua index a12e361..265e5be 100644 --- a/lua/user/toggleterm.lua +++ b/lua/plugins/configs/toggleterm.lua @@ -1,7 +1,4 @@ -local status_ok, toggleterm = pcall(require, "toggleterm") -if not status_ok then - return -end +local toggleterm = require("toggleterm") toggleterm.setup({ size = 20, diff --git a/lua/user/treesitter.lua b/lua/plugins/configs/treesitter.lua similarity index 58% rename from lua/user/treesitter.lua rename to lua/plugins/configs/treesitter.lua index 68e1021..3a20f50 100644 --- a/lua/user/treesitter.lua +++ b/lua/plugins/configs/treesitter.lua @@ -1,18 +1,17 @@ -local configs = require("nvim-treesitter.configs") -configs.setup({ - ensure_installed = "all", +local treesitter = require("nvim-treesitter.configs") + +treesitter.setup({ sync_install = false, - ignore_install = { "" }, + auto_install = true, highlight = { enable = true, - disable = { "" }, - additional_vim_regex_highlighting = true, }, rainbow = { enable = true, }, autopairs = { enable = true, + extended_mode = true, }, context_commentstring = { enable = true, diff --git a/lua/user/winbar.lua b/lua/plugins/configs/winbar.lua similarity index 59% rename from lua/user/winbar.lua rename to lua/plugins/configs/winbar.lua index cbde77d..af3aa31 100644 --- a/lua/user/winbar.lua +++ b/lua/plugins/configs/winbar.lua @@ -7,34 +7,11 @@ local function is_empty(s) return s == nil or s == "" end -M.winbar_filetype_exclude = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", - "alpha", - "lir", - "Outline", - "spectre_panel", - "toggleterm", -} - -local excludes = function() - if vim.tbl_contains(M.winbar_filetype_exclude, vim.bo.filetype) then - vim.opt_local.winbar = nil - return true - end - return false -end - -local function get_filename() +function M.get_filename() return "%#WinBarFilename#" .. "%t" .. "%*" end -local function get_location() +function M.get_location() local location = navic.get_location() local gps_location = gps.get_location() @@ -47,7 +24,7 @@ local function get_location() end end -local function get_fileicon() +function M.get_fileicon() local hl_winbar_file_icon = "WinBarFileIcon" local file_path = vim.fn.expand("%:~:.:h") local filename = vim.fn.expand("%:t") @@ -60,22 +37,11 @@ local function get_fileicon() if not is_empty(filename) then file_icon, file_icon_color = - require("nvim-web-devicons").get_icon_color(filename, file_type, { default = true }) + require("nvim-web-devicons").get_icon_color(filename, file_type, { default = true }) vim.api.nvim_set_hl(0, hl_winbar_file_icon, { fg = file_icon_color }) end return "%#WinBarContext#" .. "%#" .. hl_winbar_file_icon .. "#" .. file_icon .. " " .. "%*" end -function M.get_winbar() - if excludes() then - return "" - end - if navic.is_available() then - return get_fileicon() .. get_filename() .. get_location() - else - return get_fileicon() .. get_filename() - end -end - return M diff --git a/lua/plugins/packer.lua b/lua/plugins/packer.lua new file mode 100644 index 0000000..9cf2f15 --- /dev/null +++ b/lua/plugins/packer.lua @@ -0,0 +1,251 @@ +local fn = vim.fn + +local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" +if fn.empty(fn.glob(install_path)) > 0 then + PACKER_BOOTSTRAP = fn.system({ + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim", + install_path, + }) + + vim.cmd("packadd packer.nvim") +end + +vim.cmd([[ + augroup packer_user_config + autocmd! + autocmd BufWritePost packer.lua source | PackerSync + augroup end +]]) + +local packer = require("packer") + +packer.init({ + display = { + open_fn = function() + return require("packer.util").float({ border = "rounded" }) + end, + }, + profile = { + enable = true, + threshold = 0, + }, +}) + +return packer.startup(function(use) + use("wbthomason/packer.nvim") + + -- Dependencies + use({ + "MunifTanjim/nui.nvim", + module = "nui", + }) + use({ + "nvim-lua/plenary.nvim", + module = "plenary", + }) + use({ + "kyazdani42/nvim-web-devicons", + module = "nvim-web-devicons", + }) + + -- Benchmark Startup + use({ + "dstein64/vim-startuptime", + cmd = "StartupTime", + }) + + -- Plugin Module Caching + use("lewis6991/impatient.nvim") + + -- Alpha Dashboard + use({ + "goolord/alpha-nvim", + config = function() + require("plugins.configs.alpha") + end, + }) + + -- Colorscheme + use({ + "EdenEast/nightfox.nvim", + run = ":NightfoxCompile", + config = function() + require("plugins.configs.nightfox") + end, + }) + + -- File Tree + use({ + "nvim-neo-tree/neo-tree.nvim", + ft = "alpha", + cmd = { "Neotree" }, + config = function() + require("plugins.configs.neotree") + end, + }) + + -- Treesitter + use({ + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + event = "BufReadPre", + config = function() + require("plugins.configs.treesitter") + end, + }) + use({ + "p00f/nvim-ts-rainbow", + after = "nvim-treesitter", + }) + use({ + "JoosepAlviste/nvim-ts-context-commentstring", + after = "nvim-treesitter", + }) + use({ + "SmiteshP/nvim-gps", + after = "nvim-treesitter", + }) + + -- Telescope + use({ + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + config = function() + require("plugins.configs.telescope") + end, + }) + use({ + "nvim-telescope/telescope-fzf-native.nvim", + run = "make", + module = "telescope._extensions.fzf", + }) + use({ + "nvim-telescope/telescope-dap.nvim", + module = "telescope._extensions.dap", + }) + + -- CMP + use({ + "hrsh7th/nvim-cmp", + event = "InsertEnter", + config = function() + require("plugins.configs.cmp") + end, + }) + use({ + "hrsh7th/cmp-nvim-lsp", + after = "nvim-cmp", + }) + use({ + "hrsh7th/cmp-path", + after = "nvim-cmp", + }) + use({ + "hrsh7th/cmp-nvim-lua", + after = "nvim-cmp", + }) + use({ + "hrsh7th/vim-vsnip", + after = "nvim-cmp", + }) + use({ + "hrsh7th/cmp-vsnip", + after = "nvim-cmp", + }) + use({ + "rafamadriz/friendly-snippets", + after = "nvim-cmp", + }) + use({ + "hrsh7th/cmp-buffer", + after = "nvim-cmp", + }) + + -- Terminal + use({ + "akinsho/toggleterm.nvim", + keys = [[]], + config = function() + require("plugins.configs.toggleterm") + end, + }) + + -- LSP + use({ + "neovim/nvim-lspconfig", + event = "BufReadPre", + config = function() + require("plugins.configs.lsp") + end, + }) + use({ + "onsails/lspkind.nvim", + module = "lspkind", + }) + use({ + "williamboman/mason.nvim", + module = "mason", + }) + use({ + "williamboman/mason-lspconfig.nvim", + module = "mason-lspconfig", + }) + use({ + "glepnir/lspsaga.nvim", + module = "lspsaga", + }) + use({ + "RRethy/vim-illuminate", + module = "illuminate", + }) + use({ + "SmiteshP/nvim-navic", + module = "nvim-navic", + }) + use({ + "tamago324/nlsp-settings.nvim", + module = "nlspsettings", + }) + use({ + "b0o/SchemaStore.nvim", + module = "schemastore", + }) + use({ + "jose-elias-alvarez/null-ls.nvim", + module = "null-ls", + }) + use({ + "ray-x/lsp_signature.nvim", + module = "lsp_signature", + }) + use({ + "Maan2003/lsp_lines.nvim", + module = "lsp_lines", + }) + + -- Statusline + use({ + "nvim-lualine/lualine.nvim", + event = "BufReadPre", + config = function() + require("plugins.configs.lualine") + end, + }) + + -- Autopairs + use({ + "windwp/nvim-autopairs", + event = "InsertEnter", + config = function() + require("plugins.configs.autopairs") + end, + }) + + if PACKER_BOOTSTRAP then + require("packer").sync() + end +end) diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua deleted file mode 100644 index b3210df..0000000 --- a/lua/user/autocommands.lua +++ /dev/null @@ -1,47 +0,0 @@ --- Use 'q' to quit from common plugins -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, - callback = function() - vim.cmd([[ - nnoremap q :close - set nobuflisted - ]]) - end, -}) - --- Remove statusline and tabline when in Alpha -vim.api.nvim_create_autocmd({ "User" }, { - pattern = { "AlphaReady" }, - callback = function() - vim.cmd([[ - set showtabline=0 | autocmd BufUnload set showtabline=2 - set laststatus=0 | autocmd BufUnload set laststatus=3 - :DisableWhitespace - ]]) - end, -}) - --- Set wrap and spell in markdown and gitcommit -vim.api.nvim_create_autocmd({ "FileType" }, { - pattern = { "gitcommit", "markdown" }, - callback = function() - vim.opt_local.wrap = true - vim.opt_local.spell = true - end, -}) - -vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif") - --- Fixes Autocomment -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { - callback = function() - vim.cmd("set formatoptions-=cro") - end, -}) - --- Highlight Yanked Text -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - callback = function() - vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) - end, -}) diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua deleted file mode 100644 index 2cf6873..0000000 --- a/lua/user/autopairs.lua +++ /dev/null @@ -1,17 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup({ - check_ts = true, -- treesitter integration - disable_filetype = { "TelescopePrompt" }, -}) - -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua deleted file mode 100644 index 777afa3..0000000 --- a/lua/user/bufferline.lua +++ /dev/null @@ -1,34 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup({ - options = { - numbers = "ordinal", - close_command = "Bdelete! %d", - right_mouse_command = "Bdelete! %d", - left_mouse_command = "buffer %d", - middle_mouse_command = nil, - indicator_icon = "▎", - buffer_close_icon = "", - modified_icon = "●", - close_icon = "", - left_trunc_marker = "", - right_trunc_marker = "", - max_name_length = 30, - max_prefix_length = 30, - tab_size = 21, - diagnostics = "nvim_lsp", - diagnostics_update_in_insert = true, - 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, - separator_style = "thin", - enforce_regular_tabs = true, - always_show_bufferline = true, - }, -}) diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua deleted file mode 100644 index 8957769..0000000 --- a/lua/user/cmp.lua +++ /dev/null @@ -1,133 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local npm_status_ok, npm = pcall(require, "cmp-npm") -if not npm_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -local lspkind_status_ok, lspkind = pcall(require, "lspkind") -if not lspkind_status_ok then - return -end - -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 - -npm.setup({}) - -cmp.setup({ - completion = { completeopt = "menu,menuone,noinsert", keyword_length = 1 }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - [""] = 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.config.disable, - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = 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 = { "abbr", "kind", "menu" }, - format = lspkind.cmp_format({ - mode = "symbol_text", - maxwidth = 50, - before = function(entry, vim_item) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - npm = "[NPM]", - crates = "[CRATES]", - nvim_lua = "[NVIM_LUA]", - luasnip = "[SNIPPET]", - buffer = "[BUFFER]", - path = "[PATH]", - })[entry.source.name] - return vim_item - end, - }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "npm" }, - { name = "crates" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = true, - native_menu = false, - }, -}) - -cmp.setup.cmdline("/", { - sources = { - { name = "buffer" }, - }, -}) - -cmp.setup.cmdline(":", { - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), -}) diff --git a/lua/user/colorizer.lua b/lua/user/colorizer.lua deleted file mode 100644 index 11f1131..0000000 --- a/lua/user/colorizer.lua +++ /dev/null @@ -1,16 +0,0 @@ -local status_ok, colorizer = pcall(require, "colorizer") -if not status_ok then - return -end - -colorizer.setup({ "*" }, { - RGB = true, - RRGGBB = true, - names = false, - RRGGBBAA = true, - rgb_fn = true, - hsl_fn = true, - css = false, - css_fn = false, - mode = "background", -}) diff --git a/lua/user/comment.lua b/lua/user/comment.lua deleted file mode 100644 index 07c1a2a..0000000 --- a/lua/user/comment.lua +++ /dev/null @@ -1,22 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup({ - pre_hook = function(ctx) - local U = require("Comment.utils") - - local location = nil - if ctx.ctype == U.ctype.block then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring({ - key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - location = location, - }) - end, -}) diff --git a/lua/user/cybu.lua b/lua/user/cybu.lua deleted file mode 100644 index c971e7b..0000000 --- a/lua/user/cybu.lua +++ /dev/null @@ -1,24 +0,0 @@ -local ok, cybu = pcall(require, "cybu") -if not ok then - return -end - -cybu.setup({ - display_time = 1750, -- time the cybu window is displayed - style = { - path = "relative", -- absolute, relative, tail (filename only) - border = "rounded", -- single, double, rounded, none - separator = " ", -- string used as separator - prefix = "…", -- string used as prefix for truncated paths - padding = 1, -- left & right padding in number of spaces - hide_buffer_id = true, - devicons = { - enabled = true, -- enable or disable web dev icons - colored = true, -- enable color for web dev icons - }, - }, -}) - -vim.keymap.set("n", "", "(CybuPrev)") -vim.keymap.set("n", "", "(CybuNext)") -vim.keymap.set("n", "", "") diff --git a/lua/user/dap.lua b/lua/user/dap.lua deleted file mode 100644 index daf3ea0..0000000 --- a/lua/user/dap.lua +++ /dev/null @@ -1,12 +0,0 @@ -local dapui_status_ok, dapui = pcall(require, "dapui") -if not dapui_status_ok then - return -end - -local vtext_status_ok, vtext = pcall(require, "nvim-dap-virtual-text") -if not vtext_status_ok then - return -end - -dapui.setup() -vtext.setup() diff --git a/lua/user/discord.lua b/lua/user/discord.lua deleted file mode 100644 index 4c0d982..0000000 --- a/lua/user/discord.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, discord = pcall(require, "presence") -if not status_ok then - return -end - -discord:setup({}) diff --git a/lua/user/dressing.lua b/lua/user/dressing.lua deleted file mode 100644 index aefd93b..0000000 --- a/lua/user/dressing.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, dressing = pcall(require, "dressing") -if not status_ok then - return -end - -dressing.setup({}) diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua deleted file mode 100644 index 62320ca..0000000 --- a/lua/user/gitsigns.lua +++ /dev/null @@ -1,52 +0,0 @@ -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, - numhl = false, - linehl = false, - word_diff = false, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = true, - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, - max_file_length = 40000, - preview_config = { - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, -}) diff --git a/lua/user/gps.lua b/lua/user/gps.lua deleted file mode 100644 index 6b9deba..0000000 --- a/lua/user/gps.lua +++ /dev/null @@ -1,33 +0,0 @@ -local status_ok, gps = pcall(require, "nvim-gps") -if not status_ok then - return -end - -gps.setup({ - icons = { - ["class-name"] = " ", - ["function-name"] = " ", - ["method-name"] = " ", - ["container-name"] = "⛶ ", - ["tag-name"] = "炙 ", - ["mapping-name"] = " ", - ["sequence-name"] = " ", - ["null-name"] = "[] ", - ["boolean-name"] = "ﰰﰴ ", - ["integer-name"] = "# ", - ["float-name"] = " ", - ["string-name"] = " ", - ["array-name"] = " ", - ["object-name"] = " ", - ["number-name"] = "# ", - ["table-name"] = " ", - ["date-name"] = " ", - ["date-time-name"] = " ", - ["inline-table-name"] = " ", - ["time-name"] = " ", - ["module-name"] = " ", - }, - separator = " > ", - depth = 0, - depth_limit_indicator = "..", -}) diff --git a/lua/user/illuminate.lua b/lua/user/illuminate.lua deleted file mode 100644 index 862843e..0000000 --- a/lua/user/illuminate.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.g.Illuminate_ftblacklist = {'alpha', 'NvimTree'} -vim.api.nvim_set_keymap('n', '', 'lua require"illuminate".next_reference{wrap=true}', {noremap=true}) -vim.api.nvim_set_keymap('n', '', 'lua require"illuminate".next_reference{reverse=true,wrap=true}', {noremap=true}) diff --git a/lua/user/impatient.lua b/lua/user/impatient.lua deleted file mode 100644 index fa64f00..0000000 --- a/lua/user/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/lua/user/indentline.lua b/lua/user/indentline.lua deleted file mode 100644 index 6ebf918..0000000 --- a/lua/user/indentline.lua +++ /dev/null @@ -1,16 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -vim.g.indent_blankline_filetype_exclude = { - "help", - "packer", - "NvimTree", - "Trouble", - "alpha", -} - -indent_blankline.setup({ - show_current_context = true, -}) diff --git a/lua/user/legendary.lua b/lua/user/legendary.lua deleted file mode 100644 index ea73c2d..0000000 --- a/lua/user/legendary.lua +++ /dev/null @@ -1,6 +0,0 @@ -local ok, legendary = pcall(require, "legendary") -if not ok then - return -end - -legendary.setup() diff --git a/lua/user/lsp/init.lua b/lua/user/lsp/init.lua deleted file mode 100644 index 882a13f..0000000 --- a/lua/user/lsp/init.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("user.lsp.handlers").setup() -require("user.lsp.nlspsettings") -require("user.lsp.mason") -require("user.lsp.nullls") -require("user.lsp.signature") -require("user.lsp.lspsaga") -require("user.lsp.virtuallines") diff --git a/lua/user/lsp/lspsaga.lua b/lua/user/lsp/lspsaga.lua deleted file mode 100644 index e41dce9..0000000 --- a/lua/user/lsp/lspsaga.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspsaga = pcall(require, "lspsaga") -if not status_ok then - return -end - -lspsaga.init_lsp_saga({}) diff --git a/lua/user/lsp/mason.lua b/lua/user/lsp/mason.lua deleted file mode 100644 index 1ca0695..0000000 --- a/lua/user/lsp/mason.lua +++ /dev/null @@ -1,32 +0,0 @@ -local status_ok, mason = pcall(require, "mason") -if not status_ok then - return -end - -local lspconfig = require("lspconfig") - -mason.setup() -require("mason-lspconfig").setup({ - automatic_installation = true, -}) - -require("mason-tool-installer").setup({ - auto_update = false, - run_on_start = true, -}) - -lspconfig.util.default_config = vim.tbl_extend("force", lspconfig.util.default_config, { - on_attach = require("user.lsp.handlers").on_attach, - capabilities = require("user.lsp.handlers").capabilities, -}) - -require("user.lsp.settings.lua.sumneko_lua") -require("user.lsp.settings.lua.jsonls") -require("user.lsp.settings.lua.tsserver") -require("user.lsp.settings.lua.yamlls") -require("user.lsp.settings.lua.volar") -require("user.lsp.settings.lua.dockerls") -require("user.lsp.settings.lua.rnix") -require("user.lsp.settings.lua.taplo") -require("user.lsp.settings.lua.omnisharp") -require("user.lsp.settings.lua.lemminx") diff --git a/lua/user/lsp/settings/json/sumneko_lua.json b/lua/user/lsp/settings/json/sumneko_lua.json deleted file mode 100644 index 68be2cb..0000000 --- a/lua/user/lsp/settings/json/sumneko_lua.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Lua.diagnostics.globals": ["vim"] -} diff --git a/lua/user/lsp/settings/lua/dockerls.lua b/lua/user/lsp/settings/lua/dockerls.lua deleted file mode 100644 index 2de2305..0000000 --- a/lua/user/lsp/settings/lua/dockerls.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.dockerls.setup({}) diff --git a/lua/user/lsp/settings/lua/jsonls.lua b/lua/user/lsp/settings/lua/jsonls.lua deleted file mode 100644 index 29140f4..0000000 --- a/lua/user/lsp/settings/lua/jsonls.lua +++ /dev/null @@ -1,18 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -local schemastore_status_ok, schemastore = pcall(require, "schemastore") -if not schemastore_status_ok then - return -end - -lspconfig.jsonls.setup({ - settings = { - json = { - schemas = schemastore.json.schemas(), - validate = { enable = true }, - }, - }, -}) diff --git a/lua/user/lsp/settings/lua/lemminx.lua b/lua/user/lsp/settings/lua/lemminx.lua deleted file mode 100644 index 5a183e2..0000000 --- a/lua/user/lsp/settings/lua/lemminx.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.lemminx.setup({}) diff --git a/lua/user/lsp/settings/lua/omnisharp.lua b/lua/user/lsp/settings/lua/omnisharp.lua deleted file mode 100644 index 4231e9e..0000000 --- a/lua/user/lsp/settings/lua/omnisharp.lua +++ /dev/null @@ -1,9 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.omnisharp.setup({ - organize_imports_on_format = true, - enable_import_completion = true, -}) diff --git a/lua/user/lsp/settings/lua/rnix.lua b/lua/user/lsp/settings/lua/rnix.lua deleted file mode 100644 index 4ecbe37..0000000 --- a/lua/user/lsp/settings/lua/rnix.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.rnix.setup({}) diff --git a/lua/user/lsp/settings/lua/sumneko_lua.lua b/lua/user/lsp/settings/lua/sumneko_lua.lua deleted file mode 100644 index a9719ee..0000000 --- a/lua/user/lsp/settings/lua/sumneko_lua.lua +++ /dev/null @@ -1,3 +0,0 @@ -local lspconfig = require("lspconfig") - -lspconfig.sumneko_lua.setup({}) diff --git a/lua/user/lsp/settings/lua/taplo.lua b/lua/user/lsp/settings/lua/taplo.lua deleted file mode 100644 index 00691f9..0000000 --- a/lua/user/lsp/settings/lua/taplo.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.taplo.setup({}) diff --git a/lua/user/lsp/settings/lua/tsserver.lua b/lua/user/lsp/settings/lua/tsserver.lua deleted file mode 100644 index c9b7428..0000000 --- a/lua/user/lsp/settings/lua/tsserver.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.tsserver.setup({}) diff --git a/lua/user/lsp/settings/lua/volar.lua b/lua/user/lsp/settings/lua/volar.lua deleted file mode 100644 index 92a4d61..0000000 --- a/lua/user/lsp/settings/lua/volar.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.volar.setup({}) diff --git a/lua/user/lsp/settings/lua/yamlls.lua b/lua/user/lsp/settings/lua/yamlls.lua deleted file mode 100644 index 35726e6..0000000 --- a/lua/user/lsp/settings/lua/yamlls.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then - return -end - -lspconfig.yamlls.setup({}) diff --git a/lua/user/lsp/signature.lua b/lua/user/lsp/signature.lua deleted file mode 100644 index fc01c76..0000000 --- a/lua/user/lsp/signature.lua +++ /dev/null @@ -1,11 +0,0 @@ -local status_ok, signature = pcall(require, "lsp_signature") -if not status_ok then - return -end - -local cfg = { - floating_window = false, -- show hint in a floating window, set to false for virtual text only mode -} - -signature.setup(cfg) -- no need to specify bufnr if you don't use toggle_key -signature.on_attach(cfg) -- no need to specify bufnr if you don't use toggle_key diff --git a/lua/user/lsp/virtuallines.lua b/lua/user/lsp/virtuallines.lua deleted file mode 100644 index e3bbe41..0000000 --- a/lua/user/lsp/virtuallines.lua +++ /dev/null @@ -1,10 +0,0 @@ -local status_ok, lines = pcall(require, "lsp_lines") -if not status_ok then - return -end - -lines.setup() - -vim.diagnostic.config({ - virtual_text = false, -}) diff --git a/lua/user/lualine.lua b/lua/user/lualine.lua deleted file mode 100644 index 1890cf6..0000000 --- a/lua/user/lualine.lua +++ /dev/null @@ -1,38 +0,0 @@ -local status_ok, lualine = pcall(require, "lualine") -if not status_ok then - return -end - -lualine.setup({ - options = { - icons_enabled = true, - theme = "onenord", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "NvimTree" }, - always_divide_middle = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename", "filesize" }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - extensions = { - "nvim-tree", - "toggleterm", - "fzf", - "quickfix", - "nvim-dap-ui", - }, -}) diff --git a/lua/user/navic.lua b/lua/user/navic.lua deleted file mode 100644 index 647e6ad..0000000 --- a/lua/user/navic.lua +++ /dev/null @@ -1,34 +0,0 @@ -local status_ok, navic = pcall(require, "nvim-navic") -if not status_ok then - return -end - -navic.setup({ - icons = { - ["class-name"] = " ", - ["function-name"] = " ", - ["method-name"] = " ", - ["container-name"] = "⛶ ", - ["tag-name"] = "炙 ", - ["mapping-name"] = " ", - ["sequence-name"] = " ", - ["null-name"] = "[] ", - ["boolean-name"] = "ﰰﰴ ", - ["integer-name"] = "# ", - ["float-name"] = " ", - ["string-name"] = " ", - ["array-name"] = " ", - ["object-name"] = " ", - ["number-name"] = "# ", - ["table-name"] = " ", - ["date-name"] = " ", - ["date-time-name"] = " ", - ["inline-table-name"] = " ", - ["time-name"] = " ", - ["module-name"] = " ", - }, - highlight = true, - separator = " > ", - depth_limit = 0, - depth_limit_indicator = "..", -}) diff --git a/lua/user/notify.lua b/lua/user/notify.lua deleted file mode 100644 index 15eec94..0000000 --- a/lua/user/notify.lua +++ /dev/null @@ -1,16 +0,0 @@ -local status_ok, notify = pcall(require, "notify") -if not status_ok then - return -end - -notify.setup({ - stages = "fade_in_slide_out", - on_open = nil, - on_close = nil, - render = "default", - timeout = 175, - background_colour = "Normal", - minimum_width = 10, -}) - -vim.notify = notify diff --git a/lua/user/nvimtree.lua b/lua/user/nvimtree.lua deleted file mode 100644 index 671a87e..0000000 --- a/lua/user/nvimtree.lua +++ /dev/null @@ -1,101 +0,0 @@ -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 -vim.api.nvim_create_autocmd("BufEnter", { - nested = true, - callback = function() - if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then - vim.cmd("quit") - end - end, -}) - -nvim_tree.setup({ - disable_netrw = true, - hijack_netrw = true, - open_on_setup = false, - ignore_ft_on_setup = { - "alpha", - }, - open_on_tab = true, - hijack_cursor = true, - update_cwd = true, - diagnostics = { - enable = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - git = { - enable = true, - ignore = false, - timeout = 500, - }, - view = { - width = 30, - height = 30, - hide_root_folder = false, - side = "left", - 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, - }, - actions = { - open_file = { - quit_on_open = false, - window_picker = { - enable = false, - }, - }, - }, - renderer = { - icons = { - glyphs = { - default = "", - symlink = "", - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌", - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - }, - }, - }, - }, - filesystem_watchers = { - enable = true, - }, -}) diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua deleted file mode 100644 index 56da536..0000000 --- a/lua/user/plugins.lua +++ /dev/null @@ -1,219 +0,0 @@ -local fn = vim.fn - -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system({ - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - }) - print("Installing packer close and reopen Neovim...") - vim.cmd([[packadd packer.nvim]]) -end - -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerSync - augroup end -]]) - -local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end - -packer.init({ - display = { - open_fn = function() - return require("packer.util").float({ border = "rounded" }) - end, - }, - profile = { - enable = true, - threshold = 0, - }, -}) - -return packer.startup(function(use) - use("wbthomason/packer.nvim") - - -- Plugin Deps - use("nvim-lua/popup.nvim") - use("nvim-lua/plenary.nvim") - use("kyazdani42/nvim-web-devicons") - use("antoinemadec/FixCursorHold.nvim") - use("kevinhwang91/promise-async") - - -- Themes - -- Theme - use({ - "rmehri01/onenord.nvim", - config = function() - require("onenord").setup() - end, - }) - use({ - "folke/lsp-colors.nvim", - config = function() - require("lsp-colors").setup() - end, - }) - - -- Completion - use("hrsh7th/nvim-cmp") - use("hrsh7th/cmp-buffer") - use("hrsh7th/cmp-path") - use("hrsh7th/cmp-cmdline") - use("saadparwaiz1/cmp_luasnip") - use("hrsh7th/cmp-nvim-lsp") - use("hrsh7th/cmp-nvim-lua") - use("David-Kunz/cmp-npm") - - -- Snippets - use("L3MON4D3/LuaSnip") - use("rafamadriz/friendly-snippets") - - -- LSP - use("neovim/nvim-lspconfig") - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig.nvim") - use("WhoIsSethDaniel/mason-tool-installer.nvim") - use("jose-elias-alvarez/null-ls.nvim") - use("b0o/SchemaStore.nvim") - use("ray-x/lsp_signature.nvim") - use("folke/trouble.nvim") - use("onsails/lspkind.nvim") - use("glepnir/lspsaga.nvim") - use("https://git.sr.ht/~whynothugo/lsp_lines.nvim") - use("SmiteshP/nvim-navic") - use("kevinhwang91/nvim-ufo") - use("tamago324/nlsp-settings.nvim") - use("gpanders/editorconfig.nvim") - - -- Rust Dev - use({ - "simrat39/rust-tools.nvim", - config = function() - require("rust-tools").setup({}) - end, - }) - use({ - "saecki/crates.nvim", - config = function() - require("crates").setup({ - null_ls = { - enabled = true, - }, - }) - end, - }) - - -- Telescope - use("nvim-telescope/telescope.nvim") - use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) - use("nvim-telescope/telescope-dap.nvim") - - -- Treesitter - use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) - use("p00f/nvim-ts-rainbow") - use("JoosepAlviste/nvim-ts-context-commentstring") - use("SmiteshP/nvim-gps") - - -- Autopairs - use("windwp/nvim-autopairs") - - -- Comments - use("numToStr/Comment.nvim") - - -- Git - use("lewis6991/gitsigns.nvim") - - -- Nvim-Tree - use({ - "kyazdani42/nvim-tree.lua", - opt = true, - cmd = { "NvimTreeToggle", "NvimTreeClose" }, - config = function() - require("user.nvimtree") - end, - }) - - -- Bufferline - use("akinsho/bufferline.nvim") - use("moll/vim-bbye") - - -- Whitespace - use("ntpeters/vim-better-whitespace") - - -- Lualine - use("nvim-lualine/lualine.nvim") - - -- Toggleterm - use("akinsho/toggleterm.nvim") - - -- Speed - use("lewis6991/impatient.nvim") - use("nathom/filetype.nvim") - use("dstein64/vim-startuptime") - - -- Indent Line - use("lukas-reineke/indent-blankline.nvim") - - -- Alpha - use({ - "goolord/alpha-nvim", - config = function() - require("user.alpha") - end, - }) - - -- Keymaps - use("folke/which-key.nvim") - use("mrjones2014/legendary.nvim") - - -- Illuminate - use("RRethy/vim-illuminate") - - -- Colorizer - use("norcalli/nvim-colorizer.lua") - - -- Wakatime - use("wakatime/vim-wakatime") - - -- Discord - use("andweeb/presence.nvim") - - -- DAP - use("mfussenegger/nvim-dap") - use("rcarriga/nvim-dap-ui") - use("theHamsta/nvim-dap-virtual-text") - - -- Spectre - use("windwp/nvim-spectre") - - -- Notify - use("rcarriga/nvim-notify") - - -- Markdown Preview - use({ - "iamcco/markdown-preview.nvim", - run = function() - vim.fn["mkdp#util#install"]() - end, - }) - - -- UI - use("stevearc/dressing.nvim") - use("ghillb/cybu.nvim") - - -- Undo Tree - use("mbbill/undotree") - - if PACKER_BOOTSTRAP then - require("packer").sync() - end -end) diff --git a/lua/user/spectre.lua b/lua/user/spectre.lua deleted file mode 100644 index 4e5f59d..0000000 --- a/lua/user/spectre.lua +++ /dev/null @@ -1,9 +0,0 @@ -local status_ok, spectre = pcall(require, "spectre") -if not status_ok then - return -end - -spectre.setup({ - live_update = true, - is_insert_mode = true, -}) diff --git a/lua/user/telescope.lua b/lua/user/telescope.lua deleted file mode 100644 index 1cce2b9..0000000 --- a/lua/user/telescope.lua +++ /dev/null @@ -1,76 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -telescope.load_extension("fzf") -telescope.load_extension("dap") - -local actions = require("telescope.actions") - -telescope.setup({ - defaults = { - prompt_prefix = " ", - selection_caret = " ", - path_display = { "smart" }, - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.close, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - [""] = actions.complete_tag, - [""] = actions.which_key, - }, - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - [""] = actions.toggle_selection + actions.move_selection_worse, - [""] = actions.toggle_selection + actions.move_selection_better, - [""] = actions.send_to_qflist + actions.open_qflist, - [""] = actions.send_selected_to_qflist + actions.open_qflist, - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - ["H"] = actions.move_to_top, - ["M"] = actions.move_to_middle, - ["L"] = actions.move_to_bottom, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - ["?"] = actions.which_key, - }, - }, - }, - pickers = {}, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "ignore_case", - }, - }, -}) diff --git a/lua/user/trouble.lua b/lua/user/trouble.lua deleted file mode 100644 index f92d2cc..0000000 --- a/lua/user/trouble.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, trouble = pcall(require, "trouble") -if not status_ok then - return -end - -trouble.setup({}) diff --git a/lua/user/ufo.lua b/lua/user/ufo.lua deleted file mode 100644 index 484b68d..0000000 --- a/lua/user/ufo.lua +++ /dev/null @@ -1,39 +0,0 @@ -local status_ok, ufo = pcall(require, "ufo") -if not status_ok then - return -end - -local handler = function(virtText, lnum, endLnum, width, truncate) - local newVirtText = {} - local suffix = ("  %d "):format(endLnum - lnum) - local sufWidth = vim.fn.strdisplaywidth(suffix) - local targetWidth = width - sufWidth - local curWidth = 0 - for _, chunk in ipairs(virtText) do - local chunkText = chunk[1] - local chunkWidth = vim.fn.strdisplaywidth(chunkText) - if targetWidth > curWidth + chunkWidth then - table.insert(newVirtText, chunk) - else - chunkText = truncate(chunkText, targetWidth - curWidth) - local hlGroup = chunk[2] - table.insert(newVirtText, { chunkText, hlGroup }) - chunkWidth = vim.fn.strdisplaywidth(chunkText) - -- str width returned from truncate() may less than 2nd argument, need padding - if curWidth + chunkWidth < targetWidth then - suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) - end - break - end - curWidth = curWidth + chunkWidth - end - table.insert(newVirtText, { suffix, "MoreMsg" }) - return newVirtText -end - -ufo.setup({ - provider_selector = function() - return { "lsp", "indent" } - end, - fold_virt_text_handler = handler, -}) diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua deleted file mode 100644 index d63b00b..0000000 --- a/lua/user/whichkey.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end - -which_key.setup({}) diff --git a/lua/user/whitespace.lua b/lua/user/whitespace.lua deleted file mode 100644 index d9d2c5a..0000000 --- a/lua/user/whitespace.lua +++ /dev/null @@ -1,15 +0,0 @@ -vim.g.better_whitespace_enabled = 1 -vim.g.strip_whitespace_on_save = 1 -vim.g.show_spaces_that_precede_tabs = 1 -vim.g.strip_whitelines_at_eof = 1 -vim.g.better_whitespace_filetypes_blacklist = { - "diff", - "git", - "gitcommit", - "unite", - "qf", - "help", - "markdown", - "fugitive", - "toggleterm", -}