diff options
20 files changed, 144 insertions, 418 deletions
| diff --git a/configs/nvim/config-root/.gitignore b/configs/nvim/config-root/.gitignore new file mode 100644 index 0000000..722d5e7 --- /dev/null +++ b/configs/nvim/config-root/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/configs/nvim/config-root/.luarc.json b/configs/nvim/config-root/.luarc.json new file mode 100644 index 0000000..f704d01 --- /dev/null +++ b/configs/nvim/config-root/.luarc.json @@ -0,0 +1,4 @@ +{ +    "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", +    "runtime.version": "LuaJIT" +}
\ No newline at end of file diff --git a/configs/nvim/config-root/init.lua b/configs/nvim/config-root/init.lua index f11ecfb..9de0b2c 100644 --- a/configs/nvim/config-root/init.lua +++ b/configs/nvim/config-root/init.lua @@ -2,7 +2,7 @@ if vim.g.neovide then      -- spellchecker: disable-next-line      vim.opt.guifont = "FiraCode Nerd Font";      vim.g.neovide_window_blurred = true; -    vim.g.neovide_transparency = 0.85; +    vim.g.neovide_transparency = 0.9;      vim.g.neovide_input_ime = false;      vim.g.neovide_cursor_animate_in_insert_mode = false      vim.g.neovide_cursor_vfx_mode = "pixiedust"; @@ -61,4 +61,3 @@ require("crupest.nvim.plugins").setup()  require("crupest.nvim.keymap").setup()  vim.cmd("autocmd FileType gitcommit,gitrebase,gitconfig set bufhidden=delete") - diff --git a/configs/nvim/config-root/lazy-lock.json b/configs/nvim/config-root/lazy-lock.json index 30a3cb5..3d08239 100644 --- a/configs/nvim/config-root/lazy-lock.json +++ b/configs/nvim/config-root/lazy-lock.json @@ -1,22 +1,20 @@  { -  "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, -  "catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" }, +  "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, +  "catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },    "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },    "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },    "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },    "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, -  "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, -  "gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, -  "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, -  "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, -  "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, -  "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, -  "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, -  "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, -  "nvim-lint": { "branch": "master", "commit": "27f44d1cc3d733a38a736acb902f94879d99c76c" }, -  "nvim-lspconfig": { "branch": "master", "commit": "3f9fe72100b5f8ca8da00e54ab70707647c822b3" }, -  "nvim-web-devicons": { "branch": "master", "commit": "6b53401918a9033a41159d012160c5fb5eb249ae" }, +  "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, +  "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, +  "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, +  "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, +  "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, +  "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, +  "nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, +  "nvim-lspconfig": { "branch": "master", "commit": "4ae9796c4e95ca84ec77946a9f9089b8f1a3eec9" }, +  "nvim-tree.lua": { "branch": "master", "commit": "ca7c4c33cac2ad66ec69d45e465379716ef0cc97" }, +  "nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" },    "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, -  "telescope.nvim": { "branch": "master", "commit": "eae0d8fbde590b0eaa2f9481948cd6fd7dd21656" }, -  "toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" } +  "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }  } diff --git a/configs/nvim/config-root/lua/crupest/nvim/lsp/bash.lua b/configs/nvim/config-root/lua/crupest/nvim/lsp/bash.lua deleted file mode 100644 index 12038e5..0000000 --- a/configs/nvim/config-root/lua/crupest/nvim/lsp/bash.lua +++ /dev/null @@ -1,12 +0,0 @@ -local lspconfig = require("lspconfig") -local capabilities = require("cmp_nvim_lsp").default_capabilities() - -local function setup() -    lspconfig.cmake.setup { -        capabilities = capabilities, -    } -end - -return { -    setup = setup -} diff --git a/configs/nvim/config-root/lua/crupest/nvim/lsp/c.lua b/configs/nvim/config-root/lua/crupest/nvim/lsp/c.lua index e0466b1..bb1f6f7 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/lsp/c.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/lsp/c.lua @@ -1,21 +1,17 @@  local lspconfig = require("lspconfig") -local capabilities = require("cmp_nvim_lsp").default_capabilities() - -local get_exe = require("crupest.utils.find").get_exe  local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"  local function setup()      local clangd = "clangd" -    if get_exe(brew_clangd_path) then +    if vim.uv.fs_stat(brew_clangd_path) ~= nil then          clangd = brew_clangd_path      end      -- setup lsp clangd      lspconfig.clangd.setup {          cmd = { clangd }, -        capabilities = capabilities,          on_attach = function(_, bufnr)              vim.keymap.set('n', '<space>s', "<cmd>ClangdSwitchSourceHeader<cr>", {                  buffer = bufnr diff --git a/configs/nvim/config-root/lua/crupest/nvim/lsp/cmake.lua b/configs/nvim/config-root/lua/crupest/nvim/lsp/cmake.lua deleted file mode 100644 index 8f740bc..0000000 --- a/configs/nvim/config-root/lua/crupest/nvim/lsp/cmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -local lspconfig = require("lspconfig") -local capabilities = require("cmp_nvim_lsp").default_capabilities() - -local function setup() -    lspconfig.bashls.setup { -        capabilities = capabilities, -    } -end - -return { -    setup = setup -} diff --git a/configs/nvim/config-root/lua/crupest/nvim/lsp/init.lua b/configs/nvim/config-root/lua/crupest/nvim/lsp/init.lua index 0a20e3a..0fd29a3 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/lsp/init.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/lsp/init.lua @@ -1,10 +1,24 @@ +local lspconfig = require("lspconfig") +local cmp_nvim_lsp = require("cmp_nvim_lsp") +local cmp_default_caps = cmp_nvim_lsp.default_capabilities() + +local lspconfig_default_caps = lspconfig.util.default_config.capabilities + +lspconfig.util.default_config = vim.tbl_extend( +    "force", +    lspconfig.util.default_config, +    { +        capabilities = vim.tbl_extend("force",  lspconfig_default_caps, cmp_default_caps), +        autostart = false, +    }) +  local function setup() -    require("crupest.nvim.lsp.bash").setup() +    lspconfig.cmake.setup {} +    lspconfig.bashls.setup {}      require("crupest.nvim.lsp.c").setup() -    require("crupest.nvim.lsp.cmake").setup()      require("crupest.nvim.lsp.lua").setup() -    -- Use LspAttach autocommand to only map the following keys +    -- Use LspAttach auto command to only map the following keys      -- after the language server attaches to the current buffer      vim.api.nvim_create_autocmd('LspAttach', {          group = vim.api.nvim_create_augroup('UserLspConfig', {}), diff --git a/configs/nvim/config-root/lua/crupest/nvim/lsp/lua.lua b/configs/nvim/config-root/lua/crupest/nvim/lsp/lua.lua index 1785515..93aa503 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/lsp/lua.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/lsp/lua.lua @@ -1,9 +1,7 @@  local lspconfig = require("lspconfig") -local capabilities = require("cmp_nvim_lsp").default_capabilities()  local function setup()      lspconfig.lua_ls.setup { -        capabilities = capabilities,          settings = {              Lua = {                  runtime = { diff --git a/configs/nvim/config-root/lua/crupest/nvim/plugins/gitsign.lua b/configs/nvim/config-root/lua/crupest/nvim/plugins/gitsigns.lua index 220c91a..220c91a 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/plugins/gitsign.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/plugins/gitsigns.lua diff --git a/configs/nvim/config-root/lua/crupest/nvim/plugins/init.lua b/configs/nvim/config-root/lua/crupest/nvim/plugins/init.lua index 09a5ba7..24e0c2e 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/plugins/init.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/plugins/init.lua @@ -3,7 +3,7 @@ local function setup()      require("crupest.nvim.plugins.snip").setup()      require("crupest.nvim.plugins.cmp").setup()      require("crupest.nvim.plugins.telescope").setup() -    require("crupest.nvim.plugins.gitsign").setup() +    require("crupest.nvim.plugins.gitsigns").setup()      require("crupest.nvim.plugins.others").setup()  end diff --git a/configs/nvim/config-root/lua/crupest/nvim/plugins/lint.lua b/configs/nvim/config-root/lua/crupest/nvim/plugins/lint.lua index 6649e74..5e348d6 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/plugins/lint.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/plugins/lint.lua @@ -1,4 +1,5 @@  local lint = require("lint") +  local find = require('crupest.utils.find')  local is_win = vim.fn.has("win32") ~= 0 @@ -16,10 +17,11 @@ local cspell_config_patterns = {      "cspell.yml",  } +--- @type FindExeForBufOpts[]  local my_linters = {      {          name = "cspell", -        exe_places = { "npm", "global" }, +        places = { "node_modules", "global" },          config_files = cspell_config_patterns,      },  } @@ -77,5 +79,4 @@ end  return {      setup = setup, -    run = run  } diff --git a/configs/nvim/config-root/lua/crupest/nvim/plugins/others.lua b/configs/nvim/config-root/lua/crupest/nvim/plugins/others.lua index 2d728ae..2ef0d75 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/plugins/others.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/plugins/others.lua @@ -1,17 +1,6 @@  local function setup() -    require("neo-tree").setup { -        filesystem = { -            filtered_items = { -                hide_dotfiles = false, -                hide_gitignored = false, -                hide_hidden = false, -- only works on Windows for hidden files/directories -            }, -            use_libuv_file_watcher = true -        } -    } -      require('lualine').setup {} - +    require("nvim-tree").setup {}      require("nvim-autopairs").setup {}  end diff --git a/configs/nvim/config-root/lua/crupest/nvim/plugins/snip.lua b/configs/nvim/config-root/lua/crupest/nvim/plugins/snip.lua index 1cf9800..78ed2eb 100644 --- a/configs/nvim/config-root/lua/crupest/nvim/plugins/snip.lua +++ b/configs/nvim/config-root/lua/crupest/nvim/plugins/snip.lua @@ -1,3 +1,5 @@ +--- spellchecker: disable +  local luasnip = require("luasnip")  local ls = luasnip diff --git a/configs/nvim/config-root/lua/crupest/utils/find.lua b/configs/nvim/config-root/lua/crupest/utils/find.lua index 83968d2..dd1f663 100644 --- a/configs/nvim/config-root/lua/crupest/utils/find.lua +++ b/configs/nvim/config-root/lua/crupest/utils/find.lua @@ -1,152 +1,101 @@ -local fs = require("crupest.utils.fs");  local is_win = vim.fn.has("win32") ~= 0 -local win_exe_exts = { "exe", "CMD", "cmd", "ps1" } +local M = {} -local function get_exe(path) -    if is_win then -        for _, ext in ipairs(win_exe_exts) do -            if string.find(path, "%." .. ext .. "$") and fs.isfile(path) then -                return path -            end -        end -        for _, ext in ipairs(win_exe_exts) do -            local p = path .. "." .. ext -            if fs.isfile(p) then return p end -        end -        return nil -    end - -    if vim.fn.executable(path) ~= 0 then -        return path -    end - -    return nil -end +local windows_exe_ext = { "exe", "bat", "cmd", "ps1" } -local function find_global_exe(name) -    if vim.fn.executable(name) ~= 0 then -        return name +--- Find real path (with ext) for an executable. +--- @param dir string +--- @param name string | string[] +--- @return string | nil +function M.find_exe_file(dir, name) +    if type(name) == "string" then +        name = { name }      end - -    return nil -end - -local function first_exe(paths) -    for _, v in ipairs(paths) do -        local exe = get_exe(v) -        if exe then return exe end -    end - -    return nil -end - -local function find_file_or_directory(path, name) -    return fs.walk_up(path, function(current_path) -        local p = current_path .. "/" .. name -        if fs.isdir(p) then -            return p, "directory" -        elseif fs.isfile(p) then -            return p, "file" +    for _, n in ipairs(name) do +        if vim.uv.fs_stat(vim.fs.joinpath(dir, n)) ~= nil then +            return n          end -        return nil -    end) -end - -local function find_file(path, name) -    return fs.walk_up(path, function(current_path) -        local p = current_path .. "/" .. name -        if fs.isfile(p) then -            return p +        if is_win then +            for _, ext in ipairs(windows_exe_ext) do +                if vim.uv.fs_stat(vim.fs.joinpath(dir, n .. "." .. ext)) ~= nil then +                    return n .. "." .. ext +                end +            end          end -        return nil -    end) -end - -local function find_files_or_directories(path, names) -    for _, name in ipairs(names) do -        local p, type = find_file_or_directory(path, name) -        if p then return p, type end -    end -    return nil -end - -local function find_files(path, names) -    for _, name in ipairs(names) do -        local p = find_file(path, name) -        if p then return p end      end      return nil  end -local function find_node_modules(path) -    return fs.walk_up(path, function(current_path) -        local node_modules_path = current_path .. "/node_modules" -        if fs.isdir(node_modules_path) then -            return node_modules_path -        end -        return nil -    end) +--- Walk up until found an executable in node_modules. +--- @param path string +--- @param name string +--- @return string | nil exe_path Path to the executable. +function M.find_node_modules_exe(path, name) +    local bin_dirs = vim.fs.find("node_modules/.bin", { path = path, upward = true, type = "directory" }) +    if #bin_dirs == 0 then return nil end +    local exe = M.find_exe_file(bin_dirs[1], name) +    return exe and vim.fs.joinpath(bin_dirs[1], exe)  end -local function find_npm_exe(path, exe) -    local node_modules_path = find_node_modules(path) -    if not node_modules_path then return nil end -    local try_exe_path = node_modules_path .. "/.bin/" .. exe -    local exe_path = get_exe(try_exe_path) -    if exe_path then return exe_path end -    return nil +--- Find executable in PATH. +--- @param name string +--- @return string | nil +function M.find_global_exe(name) +    local exe = vim.fn.exepath(name) +    if exe == "" then return nil end +    return exe  end -local function find_exe(path, exe, places) +--- @alias ExePlace "node_modules" | "global" +--- @param path string +--- @param name string +--- @param places ExePlace[] +--- @return string | nil, ExePlace? +function M.find_exe(path, name, places)      for _, place in ipairs(places) do -        if place == "npm" then -            local r = find_npm_exe(path, exe) -            if r then return r end +        if place == "node_modules" then +            local r = M.find_node_modules_exe(path, name) +            if r then return r, "node_modules" end          end          if place == "global" then -            local r = find_global_exe(exe) -            if r then return r end +            local r = M.find_global_exe(name) +            if r then return r, "global" end          end      end -    return nil +    return nil, nil  end -local function find_exe_for_buf(buf, opts) -    local r = {} +--- @alias FindExeForBufOpts { name: string, exe: string?, places: ExePlace[], config_files: string[]?, filetypes: string[]? } +--- @alias FindExeForBufResult { name: string, file: string, exe: string, exe_path: string, place: ExePlace, config_file: string?, filetype: string? } +--- @param buf number +--- @param opts FindExeForBufOpts +--- @return FindExeForBufResult | nil +function M.find_exe_for_buf(buf, opts) +    local r = {} --- @type FindExeForBufResult      r.name = opts.name      r.file = vim.api.nvim_buf_get_name(buf) -    r.filetype = vim.api.nvim_buf_get_option(buf, "filetype") -    r.exe_name = opts.name -    r.exe_places = opts.exe_places or { "global" } +    r.exe = opts.exe or opts.name -    if opts.config_files then -        r.config_file = find_files(r.file, opts.config_files) -        if r.config_file == nil then return nil end +    if opts.filetypes then +        r.filetype = vim.api.nvim_get_option_value("filetype", { scope = "buffer", buf = buf }) +        if not vim.tbl_contains(opts.filetypes, r.filetype) then return nil end      end -    if opts.filetypes then -        if not require("crupest.table").includes(opts.filetypes, r.filetype) then -            return nil -        end +    if opts.config_files then +        local config_file_list = vim.fs.find(opts.config_files, { path = r.file, upward = true }) +        if #config_file_list == 0 then return nil end +        r.config_file = config_file_list[1]      end -    r.exe_path = find_exe(r.file, r.exe_name, r.exe_places) -    if r.exe_path == nil then return nil end +    local exe_path, place = M.find_exe(r.file, r.exe, opts.places) +    if exe_path == nil then return nil end +    r.exe_path = exe_path + +    --- @cast place ExePlace +    r.place = place      return r  end -return { -    get_exe = get_exe, -    find_global_exe = find_global_exe, -    first_exe = first_exe, -    find_file_or_directory = find_file_or_directory, -    find_files_or_directories = find_files_or_directories, -    find_file = find_file, -    find_files = find_files, -    find_node_modules = find_node_modules, -    find_npm_exe = find_npm_exe, -    find_exe = find_exe, -    find_exe_for_buf = find_exe_for_buf, -} +return M diff --git a/configs/nvim/config-root/lua/crupest/utils/fs.lua b/configs/nvim/config-root/lua/crupest/utils/fs.lua deleted file mode 100644 index f1363ff..0000000 --- a/configs/nvim/config-root/lua/crupest/utils/fs.lua +++ /dev/null @@ -1,104 +0,0 @@ -local is_win = vim.fn.has("win32") ~= 0 - -local function clean_path(path) -    if path == "/" then return path end -    path = string.gsub(path, "[/\\]+", "/") -    if string.sub(path, string.len(path)) == '/' then -        path = string.sub(path, 1, string.len(path) - 1) -    end -    return path -end - -local function full_path(name) -    if is_win and string.match(name, "^[a-zA-Z]:[/\\]?$") then return clean_path(name) end -    local path = vim.fn.fnamemodify(name, ":p") -    return clean_path(path) -end - -local function escape_space(str) -    return (string.gsub(str, " ", "\\ ")) -end - -local function path_get_dir(path) -    return full_path(vim.fn.fnamemodify(clean_path(path), ":h")) -end - -local function walk_up(path, func) -    local current_path = full_path(path) -    while true do -        local result = func(current_path) -        if result ~= nil then -            return result -        end -        local new_path = path_get_dir(current_path) -        if new_path == current_path then -            break -        end -        current_path = new_path -    end -    return nil -end - -local function exist(path) -    return vim.uv.fs_stat(path) -end - -local function isfile(path) -    local s = vim.uv.fs_stat(path) -    if not s then return false end -    return s.type == "file" -end - -local function isdir(path) -    local s = vim.uv.fs_stat(path) -    if not s then return false end -    return s.type == "directory" -end - -local function mkdir(dir) -    local parents = {} - -    walk_up(dir, function(p) -        table.insert(parents, 1, p) -    end) - -    for _, v in ipairs(parents) do -        if exist(v) and not isdir(v) then -            vim.notify(v .. " is not a dir. Can't make dir " .. dir, vim.log.levels.ERROR) -            return -        end -        if not exist(v) then -            vim.notify("Creating dir " .. v) -            assert(vim.uv.fs_mkdir(v, 504)) -- mode = 0770 -        end -    end -end - -local function copy(old, new) -    mkdir(path_get_dir(new)) -    assert(vim.uv.fs_copyfile(old, new)) -end - -local function remove(path) -    assert(vim.uv.fs_unlink(path)) -end - -local function move(old, new) -    mkdir(path_get_dir(new)) -    assert(vim.uv.fs_rename(old, new)) -end - -return { -    clean_path = clean_path, -    full_path = full_path, -    escape_space = escape_space, -    path_get_dir = path_get_dir, -    walk_up = walk_up, -    exist = exist, -    isfile = isfile, -    isdir = isdir, -    mkdir = mkdir, -    copy = copy, -    remove = remove, -    move = move -} diff --git a/configs/nvim/config-root/lua/crupest/utils/nvim.lua b/configs/nvim/config-root/lua/crupest/utils/nvim.lua index ac732fd..4477ecc 100644 --- a/configs/nvim/config-root/lua/crupest/utils/nvim.lua +++ b/configs/nvim/config-root/lua/crupest/utils/nvim.lua @@ -1,32 +1,6 @@ -local function list_listed_bufs() -    local bufs = vim.api.nvim_list_bufs() -    local result = {} -    for _, v in ipairs(bufs) do -        if vim.fn.buflisted(v) ~= 0 then -            table.insert(result, v) -        end -    end -    return result -end - --- list the windows that are currently editing the given buffer -local function list_wins_editing_buf(buf) -    local wins = vim.api.nvim_list_wins() -    local result = {} -    for _, win in ipairs(wins) do -        if vim.api.nvim_win_get_buf(win) == buf then -            table.insert(result, win) -        end -    end -    return result -end - -local function buf_is_normal(buf) -    return vim.fn.bufexists(buf) ~= 0 and vim.fn.buflisted(buf) ~= 0 -end - +local M = {} -local function close_float() +function M.close_float()      local wins = vim.api.nvim_list_wins()      for _, v in ipairs(wins) do          if vim.api.nvim_win_get_config(v).relative ~= '' then @@ -35,10 +9,4 @@ local function close_float()      end  end -return { -    list_listed_bufs = list_listed_bufs, -    buf_is_normal = buf_is_normal, -    list_wins_editing_buf = list_wins_editing_buf, -    close_float = close_float, -} - +return M diff --git a/configs/nvim/config-root/lua/crupest/utils/table.lua b/configs/nvim/config-root/lua/crupest/utils/table.lua deleted file mode 100644 index 22419b0..0000000 --- a/configs/nvim/config-root/lua/crupest/utils/table.lua +++ /dev/null @@ -1,42 +0,0 @@ -local function remove_element(tbl, element) -    local index = nil -    for i, v in ipairs(tbl) do -        if element == v then -            index = i -            break -        end -    end -    if index then -        table.remove(tbl, index) -    end -    return tbl -end - -local function element_at(tbl, element) -    local at = nil -    for i, v in ipairs(tbl) do -        if element == v then -            at = i -            break -        end -    end -    return at -end - -local function includes(tbl, element) -    for _, v in ipairs(tbl) do -        if v == element then return true end -    end -    return false -end - -local function string_start_with(str, prefix) -    return string.find(str, prefix, 0, true) == 1 -end - -return { -    remove_element = remove_element, -    element_at = element_at, -    includes = includes, -    string_start_with = string_start_with, -} diff --git a/configs/nvim/config-root/lua/plugins.lua b/configs/nvim/config-root/lua/plugins.lua index d7d0247..b689559 100644 --- a/configs/nvim/config-root/lua/plugins.lua +++ b/configs/nvim/config-root/lua/plugins.lua @@ -2,14 +2,21 @@  return {      { "catppuccin/nvim", name = "catppuccin", priority = 1000 },      "neovim/nvim-lspconfig", +    "L3MON4D3/LuaSnip",      "hrsh7th/nvim-cmp",      "hrsh7th/cmp-nvim-lsp",      "hrsh7th/cmp-buffer",      "hrsh7th/cmp-path",      "hrsh7th/cmp-cmdline", -    "L3MON4D3/LuaSnip",      "saadparwaiz1/cmp_luasnip",      { +        "nvim-tree/nvim-tree.lua", +        lazy = false, +        dependencies = { +            "nvim-tree/nvim-web-devicons", +        }, +    }, +    {          "nvim-lualine/lualine.nvim",          dependencies = { 'nvim-tree/nvim-web-devicons' }      }, @@ -19,14 +26,5 @@ return {      },      "windwp/nvim-autopairs",      "mfussenegger/nvim-lint", -    "akinsho/toggleterm.nvim",      "lewis6991/gitsigns.nvim", -    { -        "nvim-neo-tree/neo-tree.nvim", -        dependencies = { -            "nvim-lua/plenary.nvim", -            "nvim-tree/nvim-web-devicons", -            "MunifTanjim/nui.nvim", -        }, -    },  } diff --git a/configs/nvim/config-root/nvim-words.txt b/configs/nvim/config-root/nvim-words.txt index e4a2d60..564904f 100644 --- a/configs/nvim/config-root/nvim-words.txt +++ b/configs/nvim/config-root/nvim-words.txt @@ -1,48 +1,27 @@  nvim -neovide -lspconfig -keymap -libuv -omnifunc -autocommand -autocmd -augroup -stdpath -setloclist +vimruntime  bnext -bufs -buflisted -bufexists -getjumplist +bufhidden +exepath +stdpath +augroup +autocmd +autobrief +autopairs +keymap +joinpath  bufnr -fnamemodify -isfile -isdir -fargs -nargs -vimruntime -copyfile -isdirectory -lnum -# plugins -dotfiles -lualine -luasnip -toggleterm -everforest -autopairs -neotree -gitsigns +neovide +pixiedust -# languages +lspconfig  clangd -omnisharp -omni -codebases -rulesets -unimported -prereleases -cssls -deno -denols +bashls + +catppuccin +macchiato +diffthis +gitsigns +lualine +luasnip | 
