Skip to content

Commit

Permalink
Neovide config tweak
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Gheorghiu <vsoftco@gmail.com>
  • Loading branch information
vsoftco committed May 23, 2024
1 parent b5cff0e commit 88b0b9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lua/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ function M.smart_bd()
local buf_no = vim.api.nvim_get_current_buf()
local buf_name = vim.api.nvim_buf_get_name(buf_no)

local buf_ft = vim.api.nvim_buf_get_option(buf_no, "filetype")
local buf_bt = vim.api.nvim_buf_get_option(buf_no, "buftype")
local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = buf_no })
local buf_bt = vim.api.nvim_get_option_value("buftype", { buf = buf_no })
if debug then
print(string.format("filetype: [%s] | buftype: [%s]", buf_ft, buf_bt))
end
Expand Down
9 changes: 6 additions & 3 deletions lua/neovide/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ util.map_keys(keymaps.scale, { noremap = true, silent = true })
vim.cmd("set guifont=JetBrainsMono\\ Nerd\\ Font:h16")

------------------------------------------------------------------------------
-- Set the current working directory to home directory
-- Set current working directory to home directory if we are in '/' or 'C:\'
local current_dir = vim.fn.getcwd()
local home_dir = os.getenv("HOME") or os.getenv("USERPROFILE")
if home_dir then
vim.cmd("cd " .. home_dir)
if current_dir == "/" or current_dir == "C:\\Program Files\\Neovide" then
if home_dir then
vim.cmd("cd " .. home_dir)
end
end

0 comments on commit 88b0b9c

Please sign in to comment.