Set nvim CWD to opened directory
This commit is contained in:
parent
5d8ffd9e03
commit
483c103f96
1 changed files with 8 additions and 3 deletions
|
|
@ -4,9 +4,6 @@ vim.cmd("set tabstop=2")
|
|||
vim.cmd("set softtabstop=2")
|
||||
vim.cmd("set shiftwidth=2")
|
||||
|
||||
-- Configure Navigation Keys
|
||||
-- This is all handled by the vim-tmux-navigator plugin now
|
||||
|
||||
-- Configure Editor Settings
|
||||
vim.cmd("set number")
|
||||
vim.cmd("set scrolloff=8")
|
||||
|
|
@ -33,6 +30,14 @@ vim.g.mapleader = " "
|
|||
-- Init Lazy Plugin Manager
|
||||
require("config.lazy")
|
||||
|
||||
-- Set CWD to opened directory
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
desc = "cd to passed $PWD when vim starts",
|
||||
callback = function()
|
||||
vim.api.nvim_set_current_dir(vim.fn.getcwd())
|
||||
end,
|
||||
})
|
||||
|
||||
-- Configure nvim Keymaps
|
||||
vim.keymap.set("n", "<leader>r", ":source %<CR>", { desc = "Reload Config" })
|
||||
vim.keymap.set("n", "<leader>bs", ":vsplit<CR>", { desc = "Vertical Split" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue