diff options
Diffstat (limited to 'lua/utils/init.lua')
-rw-r--r-- | lua/utils/init.lua | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lua/utils/init.lua b/lua/utils/init.lua index df472c66..208871bf 100644 --- a/lua/utils/init.lua +++ b/lua/utils/init.lua @@ -1,4 +1,6 @@ local utils = {} +local Log = require "core.log" +local uv = vim.loop -- recursive Print (structure, limit, separator) local function r_inspect_settings(structure, limit, separator) @@ -68,6 +70,9 @@ function utils.toggle_autoformat() }, }, } + if Log:get_default() then + Log:get_default().info "Format on save active" + end end if not lvim.format_on_save then @@ -76,6 +81,9 @@ function utils.toggle_autoformat() :autocmd! autoformat endif ]] + if Log:get_default() then + Log:get_default().info "Format on save off" + end end end @@ -91,6 +99,7 @@ function utils.reload_lv_config() vim.cmd ":PackerInstall" require("keymappings").setup() -- vim.cmd ":PackerClean" + Log:get_default().info "Reloaded configuration" end function utils.check_lsp_client_active(name) @@ -157,10 +166,12 @@ function utils.gsub_args(args) return args end -function utils.lvim_log(msg) - if lvim.debug then - vim.notify(msg, vim.log.levels.DEBUG) - end +--- Checks whether a given path exists and is a file. +--@param filename (string) path to check +--@returns (bool) +function utils.is_file(filename) + local stat = uv.fs_stat(filename) + return stat and stat.type == "file" or false end return utils |