From 5dc89fe9789701abbe4a73c2998d397a6d7d964c Mon Sep 17 00:00:00 2001 From: José Juan Loeza Sierra Date: Fri, 7 Nov 2025 23:42:52 -0800 Subject: replace lazyvim with custom config --- dot-config/nvim-old/lua/config/autocmds.lua | 8 + dot-config/nvim-old/lua/config/keymaps.lua | 3 + dot-config/nvim-old/lua/config/lazy.lua | 53 ++++++ dot-config/nvim-old/lua/config/options.lua | 24 +++ dot-config/nvim-old/lua/plugins/example.lua | 197 ++++++++++++++++++++ dot-config/nvim-old/lua/plugins/handlebars.lua | 26 +++ dot-config/nvim-old/lua/plugins/hardtime.lua | 16 ++ dot-config/nvim-old/lua/plugins/hledger.lua | 18 ++ dot-config/nvim-old/lua/plugins/lualine.lua | 16 ++ dot-config/nvim-old/lua/plugins/markdown.lua | 37 ++++ dot-config/nvim-old/lua/plugins/multicursor.lua | 85 +++++++++ dot-config/nvim-old/lua/plugins/theme.lua | 227 ++++++++++++++++++++++++ dot-config/nvim-old/lua/plugins/yaml.lua | 10 ++ dot-config/nvim-old/lua/wordcount.lua | 33 ++++ 14 files changed, 753 insertions(+) create mode 100644 dot-config/nvim-old/lua/config/autocmds.lua create mode 100644 dot-config/nvim-old/lua/config/keymaps.lua create mode 100644 dot-config/nvim-old/lua/config/lazy.lua create mode 100644 dot-config/nvim-old/lua/config/options.lua create mode 100644 dot-config/nvim-old/lua/plugins/example.lua create mode 100644 dot-config/nvim-old/lua/plugins/handlebars.lua create mode 100644 dot-config/nvim-old/lua/plugins/hardtime.lua create mode 100644 dot-config/nvim-old/lua/plugins/hledger.lua create mode 100644 dot-config/nvim-old/lua/plugins/lualine.lua create mode 100644 dot-config/nvim-old/lua/plugins/markdown.lua create mode 100644 dot-config/nvim-old/lua/plugins/multicursor.lua create mode 100644 dot-config/nvim-old/lua/plugins/theme.lua create mode 100644 dot-config/nvim-old/lua/plugins/yaml.lua create mode 100644 dot-config/nvim-old/lua/wordcount.lua (limited to 'dot-config/nvim-old/lua') diff --git a/dot-config/nvim-old/lua/config/autocmds.lua b/dot-config/nvim-old/lua/config/autocmds.lua new file mode 100644 index 0000000..4221e75 --- /dev/null +++ b/dot-config/nvim-old/lua/config/autocmds.lua @@ -0,0 +1,8 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- +-- Add any additional autocmds here +-- with `vim.api.nvim_create_autocmd` +-- +-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) +-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") diff --git a/dot-config/nvim-old/lua/config/keymaps.lua b/dot-config/nvim-old/lua/config/keymaps.lua new file mode 100644 index 0000000..2c134f7 --- /dev/null +++ b/dot-config/nvim-old/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here diff --git a/dot-config/nvim-old/lua/config/lazy.lua b/dot-config/nvim-old/lua/config/lazy.lua new file mode 100644 index 0000000..d73bfa1 --- /dev/null +++ b/dot-config/nvim-old/lua/config/lazy.lua @@ -0,0 +1,53 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "habamax" } }, + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/dot-config/nvim-old/lua/config/options.lua b/dot-config/nvim-old/lua/config/options.lua new file mode 100644 index 0000000..332d2af --- /dev/null +++ b/dot-config/nvim-old/lua/config/options.lua @@ -0,0 +1,24 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here + +-- For clipboard over ssh +-- see https://github.com/LazyVim/LazyVim/discussions/2715#discussioncomment-11857449 +vim.opt.clipboard = "unnamedplus" + +vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy("+"), + ["*"] = require("vim.ui.clipboard.osc52").copy("*"), + }, + paste = { + ["+"] = require("vim.ui.clipboard.osc52").paste("+"), + ["*"] = require("vim.ui.clipboard.osc52").paste("*"), + }, +} + +-- Python: use ruff instead of pyright +-- don't want a full LSP, just linting and formatting +-- see https://www.lazyvim.org/extras/lang/python +vim.g.lazyvim_python_lsp = "ruff" diff --git a/dot-config/nvim-old/lua/plugins/example.lua b/dot-config/nvim-old/lua/plugins/example.lua new file mode 100644 index 0000000..17f53d6 --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/example.lua @@ -0,0 +1,197 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, { name = "emoji" }) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").lsp.on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/handlebars.lua b/dot-config/nvim-old/lua/plugins/handlebars.lua new file mode 100644 index 0000000..b09dc3c --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/handlebars.lua @@ -0,0 +1,26 @@ +-- add language support for handlebars (.hbs) + +return { + + -- glimmer is the treesitter parser for handlebars + -- see https://github.com/nvim-treesitter/nvim-treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "glimmer" } }, + }, + + -- we can use djLint to format handlebars + { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + handlebars = { "djlint" }, + }, + formatters = { + djlint = { + prepend_args = { "--preserve-blank-lines" }, + }, + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/hardtime.lua b/dot-config/nvim-old/lua/plugins/hardtime.lua new file mode 100644 index 0000000..8e8078a --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/hardtime.lua @@ -0,0 +1,16 @@ +-- https://github.com/m4xshen/hardtime.nvim +return { + "m4xshen/hardtime.nvim", + lazy = false, + dependencies = { "MunifTanjim/nui.nvim" }, + opts = { + -- re-enable + -- for use with mutlicursor.nvim + disabled_keys = { + [""] = false, + [""] = false, + [""] = false, + [""] = false, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/hledger.lua b/dot-config/nvim-old/lua/plugins/hledger.lua new file mode 100644 index 0000000..240d0a6 --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/hledger.lua @@ -0,0 +1,18 @@ +-- add language support for hledger +-- based on options from https://www.lazyvim.org/extras/lang/astro + +return { + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "ledger" } }, + }, + + { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + ledger = { "hledger-fmt" }, + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/lualine.lua b/dot-config/nvim-old/lua/plugins/lualine.lua new file mode 100644 index 0000000..d71612a --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/lualine.lua @@ -0,0 +1,16 @@ +local wc = require("wordcount") + +return { + "nvim-lualine/lualine.nvim", + opts = { + sections = { + lualine_y = { + -- Add wordcount + { wc.wordcount, cond = wc.is_available }, + -- Existing conf + { "progress", separator = " ", padding = { left = 1, right = 0 } }, + { "location", padding = { left = 0, right = 1 } }, + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/markdown.lua b/dot-config/nvim-old/lua/plugins/markdown.lua new file mode 100644 index 0000000..48c957d --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/markdown.lua @@ -0,0 +1,37 @@ +return { + { + -- Disable linting + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + markdown = {}, + }, + }, + }, + { + "MeanderingProgrammer/render-markdown.nvim", + opts = { + html = { + comment = { + -- Turn on / off HTML comment concealing. + conceal = false, + }, + }, + code = { + -- Whether to conceal nodes at the top and bottom of code blocks. + conceal_delimiters = false, + -- Width of the code block background. + -- | block | width of the code block | + -- | full | full width of the window | + width = "block", + -- Determines how the top / bottom of code block are rendered. + -- | none | do not render a border | + -- | thick | use the same highlight as the code body | + -- | thin | when lines are empty overlay the above & below icons | + -- | hide | conceal lines unless language name or icon is added | + border = "thick", + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/multicursor.lua b/dot-config/nvim-old/lua/plugins/multicursor.lua new file mode 100644 index 0000000..6e81074 --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/multicursor.lua @@ -0,0 +1,85 @@ +-- this is the example config shown at https://github.com/jake-stewart/multicursor.nvim/blob/main/readme.md +-- with the additional changes necessary to work with LazyVIm + +return { + "jake-stewart/multicursor.nvim", + branch = "1.0", + + -- the following changes are necessary to work with LazyVim + -- see https://github.com/jake-stewart/multicursor.nvim/issues/107 + keys = { "", "" }, -- explicitly tell LazyVim used keys to avoid replace + lazy = false, -- avoid lazy trying to lazy load based on those keys + + config = function() + local mc = require("multicursor-nvim") + mc.setup() + + local set = vim.keymap.set + + -- Add or skip cursor above/below the main cursor. + set({ "n", "x" }, "", function() + mc.lineAddCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.lineAddCursor(1) + end) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(1) + end) + + -- Add or skip adding a new cursor by matching word/selection + set({ "n", "x" }, "n", function() + mc.matchAddCursor(1) + end) + set({ "n", "x" }, "s", function() + mc.matchSkipCursor(1) + end) + set({ "n", "x" }, "N", function() + mc.matchAddCursor(-1) + end) + set({ "n", "x" }, "S", function() + mc.matchSkipCursor(-1) + end) + + -- Add and remove cursors with control + left click. + set("n", "", mc.handleMouse) + set("n", "", mc.handleMouseDrag) + set("n", "", mc.handleMouseRelease) + + -- Disable and enable cursors. + set({ "n", "x" }, "", mc.toggleCursor) + + -- Mappings defined in a keymap layer only apply when there are + -- multiple cursors. This lets you have overlapping mappings. + mc.addKeymapLayer(function(layerSet) + -- Select a different cursor as the main one. + layerSet({ "n", "x" }, "", mc.prevCursor) + layerSet({ "n", "x" }, "", mc.nextCursor) + + -- Delete the main cursor. + layerSet({ "n", "x" }, "x", mc.deleteCursor) + + -- Enable and clear cursors using escape. + layerSet("n", "", function() + if not mc.cursorsEnabled() then + mc.enableCursors() + else + mc.clearCursors() + end + end) + end) + + -- Customize how cursors look. + local hl = vim.api.nvim_set_hl + hl(0, "MultiCursorCursor", { reverse = true }) + hl(0, "MultiCursorVisual", { link = "Visual" }) + hl(0, "MultiCursorSign", { link = "SignColumn" }) + hl(0, "MultiCursorMatchPreview", { link = "Search" }) + hl(0, "MultiCursorDisabledCursor", { reverse = true }) + hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + hl(0, "MultiCursorDisabledSign", { link = "SignColumn" }) + end, +} diff --git a/dot-config/nvim-old/lua/plugins/theme.lua b/dot-config/nvim-old/lua/plugins/theme.lua new file mode 100644 index 0000000..166c3a9 --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/theme.lua @@ -0,0 +1,227 @@ +return { + -- gruvbox material + -- https://github.com/sainnhe/gruvbox-material + { + "sainnhe/gruvbox-material", + lazy = false, + priority = 1000, + config = function() + vim.g.gruvbox_material_transparent_background = 2 + end, + }, + + { + "sainnhe/everforest", + lazy = false, + priority = 1000, + config = function() + vim.g.everforest_transparent_background = 2 + end, + }, + + { + "webhooked/kanso.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + }, + }, + + { + "vague2k/vague.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + }, + }, + + { + "AlexvZyl/nordic.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = { + bg = true, + float = true, + }, + }, + }, + + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + opts = { + transparent_background = true, + float = { + transparent = true, + }, + color_overrides = { + frappe = { + -- colors from https://primer.style/product/getting-started/foundations/color-usage/ + -- see https://primer.style/primitives/storybook/?path=/story/color-base-scales--all-scales&globals=theme%3Adark_high_contrast + rosewater = "#91cbff", + flamingo = "#addcff", + pink = "#addcff", + mauve = "#ff9492", + red = "#ff9492", + maroon = "#ffffff", + peach = "#addcff", + yellow = "#f0b72f", + green = "#addcff", + teal = "#91cbff", + sky = "#91cbff", + sapphire = "#91cbff", + blue = "#dbb7ff", + lavender = "#ffffff", + text = "#ffffff", + subtext1 = "#d1d7e0", + subtext0 = "#b7bdc8", + overlay2 = "#9198a1", + overlay1 = "#656c76", + overlay0 = "#3d444d", + surface2 = "#3d444d", + surface1 = "#2f3742", + surface0 = "#2a313c", + base = "#000000", + mantle = "#000000", + crust = "#000000", + }, + }, + no_italic = true, + }, + }, + + { + "rose-pine/neovim", + name = "rose-pine", + priority = 1000, + opts = { + styles = { + transparency = true, + }, + }, + }, + + { + "sainnhe/sonokai", + lazy = false, + priority = 1000, + config = function() + vim.g.sonokai_transparent_background = 2 + end, + }, + + { + "sainnhe/edge", + lazy = false, + priority = 1000, + config = function() + vim.g.edge_transparent_background = 2 + end, + }, + + { + "projekt0n/github-nvim-theme", + lazy = false, + priority = 1000, + config = function() + require("github-theme").setup({ + options = { + transparent = true, + }, + }) + end, + }, + + { + "bluz71/vim-moonfly-colors", + name = "moonfly", + lazy = false, + priority = 1000, + config = function() + vim.g.moonflyTransparent = true + end, + }, + + { + "miikanissi/modus-themes.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + line_nr_column_background = false, + }, + }, + + { + "scottmckendry/cyberdream.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + }, + }, + + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + }, + }, + + { + "Mofiqul/vscode.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + }, + }, + + { + "EdenEast/nightfox.nvim", + lazy = false, + priority = 1000, + opts = { + options = { + transparent = true, + }, + }, + }, + + { + "nyoom-engineering/oxocarbon.nvim", + name = "oxocarbon", + lazy = false, + priority = 1000, + config = function() + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" }) + end, + }, + + { + "wtfox/jellybeans.nvim", + lazy = false, + priority = 1000, + opts = { + transparent = true, + italics = false, + bold = false, + flat_ui = true, -- toggles "flat UI" for pickers + }, + }, + + { + "LazyVim/LazyVim", + opts = { + colorscheme = "jellybeans-default", + }, + }, +} diff --git a/dot-config/nvim-old/lua/plugins/yaml.lua b/dot-config/nvim-old/lua/plugins/yaml.lua new file mode 100644 index 0000000..c14f04d --- /dev/null +++ b/dot-config/nvim-old/lua/plugins/yaml.lua @@ -0,0 +1,10 @@ +return { + { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + yaml = { "prettier" }, + }, + }, + }, +} diff --git a/dot-config/nvim-old/lua/wordcount.lua b/dot-config/nvim-old/lua/wordcount.lua new file mode 100644 index 0000000..92944e5 --- /dev/null +++ b/dot-config/nvim-old/lua/wordcount.lua @@ -0,0 +1,33 @@ +-- Wordcount in markdown +-- +-- Credits +-- https://github.com/nvim-lualine/lualine.nvim/issues/328#issuecomment-982672253 +-- https://github.com/skwee357/nvim-prose + +local M = {} + +local config = { + filetypes = { "markdown", "text", "typst" }, +} + +function M.wordcount() + local wc = vim.fn.wordcount() + + if wc.visual_words then + return tostring(wc.visual_words) .. " words" + end + + return tostring(wc.words) .. " words" +end + +function M.is_available() + for _, ft in ipairs(config.filetypes) do + if ft == vim.bo.filetype then + return true + end + end + + return false +end + +return M -- cgit v1.3