diff options
Diffstat (limited to 'lua/talha/functions.lua')
-rw-r--r-- | lua/talha/functions.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/talha/functions.lua b/lua/talha/functions.lua index e17cada..b0e8020 100644 --- a/lua/talha/functions.lua +++ b/lua/talha/functions.lua @@ -1,5 +1,11 @@ local Path = require"plenary.path" +function FormatFile() + local filename = vim.api.nvim_buf_get_name(0) + vim.cmd(":silent !autopep8 -i " .. filename) + vim.cmd(":silent !isort " .. filename) +end + function CreateDailyNote() local file_path = vim.api.nvim_buf_get_name(0) local dir_path = file_path @@ -61,6 +67,12 @@ function ToggleSpellCheck() vim.opt.spelllang = 'en_us' end +function SetFocusColors(mode) + vim.o.background = "light" + vim.opt.cursorline = false + vim.cmd("colorscheme vscode") +end + function GetHomeDir() -- for linux/mac local home = os.getenv("HOME") @@ -72,6 +84,5 @@ function GetHomeDir() elseif user_profile ~= nil then return user_profile end - return nil end |