diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2c134f7..f92ad5e 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -1,3 +1,31 @@ -- 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 + +function ToggleExpandTab() + local current_setting = vim.opt.expandtab:get() + vim.opt.expandtab = not current_setting + if vim.opt.expandtab:get() then + print(": Spaces Enabled") + else + print(": Tabs Enabled") + end +end + +vim.api.nvim_set_keymap('n', '', ':lua ToggleExpandTab()', { noremap = true, silent = true }) + +function ShowExpandTabStatus() + if vim.opt.expandtab:get() then + print(": Spaces Enabled") + else + print(": Tabs Enabled") + end +end + +----------------------------------------------------------- +-- Startup +----------------------------------------------------------- +-- Delay the function call by 1000 milliseconds (1 second) +vim.defer_fn(ShowExpandTabStatus, 1000) + + diff --git a/lua/config/options.lua b/lua/config/options.lua index 16bae5a..8f3c82b 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -39,7 +39,7 @@ opt.laststatus=3 -- Set global statusline ----------------------------------------------------------- -- Tabs, indent ----------------------------------------------------------- -opt.expandtab = true -- Use spaces instead of tabs +opt.expandtab = false -- Use spaces instead of tabs opt.shiftwidth = 4 -- Shift 4 spaces when tab opt.tabstop = 4 -- 1 tab == 4 spaces opt.smartindent = true -- Autoindent new lines @@ -56,38 +56,3 @@ opt.updatetime = 250 -- ms to wait for trigger an event ----------------------------------------------------------- -- Startup ----------------------------------------------------------- --- Disable nvim intro -opt.shortmess:append "sI" - --- -- Disable builtin plugins -local disabled_built_ins = { - "2html_plugin", - "getscript", - "getscriptPlugin", - "gzip", - "logipat", - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "matchit", - "tar", - "tarPlugin", - "rrhelper", - "spellfile_plugin", - "vimball", - "vimballPlugin", - "zip", - "zipPlugin", - "tutor", - "rplugin", - "synmenu", - "optwin", - "compiler", - "bugreport", - "ftplugin", -} - -for _, plugin in pairs(disabled_built_ins) do - g["loaded_" .. plugin] = 1 -end