dev: removed CPLoad command in favor of the builtin 'colorscheme'

dev-doc
Pocco81 3 years ago
parent 69ab6447c7
commit 1f1782a460

@ -1,12 +1,3 @@
lua << EOF
-- clear cache so this reloads changes.
-- package.loaded['catppuccino'] = nil
-- package.loaded['catppuccino.utils.util'] = nil
-- package.loaded['catppuccino.utils.hsluv'] = nil
-- package.loaded["catppuccino.color_schemes.catppuccino"] = nil
-- package.loaded['catppuccino.config'] = nil
-- package.loaded['catppuccino.main'] = nil
-- package.loaded['catppuccino.core.mapper'] = nil
require('catppuccino').load()
EOF

@ -1,5 +0,0 @@
return {
["catppuccino"] = "catppuccino",
["neon_latte"] = "neon_latte",
["light_melya"] = "light_melya",
}

@ -1,7 +1,7 @@
local M = {}
function M.load()
require("catppuccino.main").main("load")
function M.load(args)
require("catppuccino.main").main("load", args)
end
function M.setup(custom_opts, remaps)

@ -2,14 +2,15 @@ local M = {}
local utils = require("catppuccino.utils.util")
local function load(args)
local function load(colorscheme)
local catppuccino = require("catppuccino")
if catppuccino.before_loading ~= nil then
catppuccino.before_loading()
end
local theme = require("catppuccino.core.mapper").apply(args)
-- colorscheme gets evaluated from mapper.lua
local theme = require("catppuccino.core.mapper").apply(colorscheme)
utils.load(theme)
if catppuccino.after_loading ~= nil then

@ -1,7 +0,0 @@
local M = {}
function M.available_commands()
return vim.tbl_keys(require("catppuccino.core.list_cs"))
end
return M

@ -6,27 +6,7 @@ if exists('g:loaded_catppuccino') | finish | endif
let s:save_cpo = &cpo " save user coptions
set cpo&vim " reset them to defaults
" Utils {{{
function! cpcmds#get_first_arg(...)
return "".get(a:, 1, 1).""
endfunction
" }}}
" Test Availability {{{
" aa = available arguments
function! cpcmds#available_args_flavors() abort
return luaeval('require("catppuccino.utils.cli_completion").available_commands()')
endfunction
" }}}
" Tab Completion {{{
function! s:complete_args_flavors(arg, line, pos) abort
return join(cpcmds#available_args_flavors(), "\n")
endfunction
" }}}
" Interface {{{
command! -nargs=+ -complete=custom,s:complete_args_flavors CPLoad call v:lua.require'catppuccino.main'.main('load',cpcmds#get_first_arg(<f-args>))
command! -nargs=0 CPClear call v:lua.require'catppuccino.main'.main('clear')
" }}}

Loading…
Cancel
Save