Skip to content

Commit

Permalink
home/nvim: automatically determine cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodachi94 committed Jun 24, 2024
1 parent f5dcc36 commit 05cfbb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions home/common/nvim/lua/tomodachi94/autocmds/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require("tomodachi94.autocmds.set_cwd_automatically")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
vim.api.nvim_create_autocmd("BufEnter", {
callback = function(event_args)
local root = vim.fs.root(event_args.buf, { ".git", ".hg", "_FOSSIL", ".svn" })
if root then
vim.uv.chdir(root)
end
end,
})
1 change: 1 addition & 0 deletions home/common/nvim/lua/tomodachi94/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vim.cmd("source ~/.config/nvim/vimscript/no-autoload/source-vimscript.vim")

require("tomodachi94.options")
require("tomodachi94.keybinds")
require("tomodachi94.autocmds")
require("tomodachi94.setup-plugins")
require("tomodachi94.filetype.mcmeta")
require("tomodachi94.filetype.gemrc")
Expand Down

0 comments on commit 05cfbb9

Please sign in to comment.