nvim-rooter.lua icon indicating copy to clipboard operation
nvim-rooter.lua copied to clipboard

feat: add option to change the scope of working directory change

Open WieeRd opened this issue 7 months ago • 0 comments

https://github.com/airblade/vim-rooter?tab=readme-ov-file#miscellaneous vim-rooter supports g:rooter_cd_cmd to select the command used for changing working directory (:cd, :lcd, :tcd).

Likewise, I've added cd_scope option to the setup().

local function change_dir(dir)
  local cd_method = {
    global = vim.api.nvim_set_current_dir,
    window = vim.cmd.lcd,
    tabpage = vim.cmd.tcd,
    smart = vim.fn.chdir,
  }
  cd_method[_config.cd_scope](dir)
end

The updated change_dir() function should speak for itself.

WieeRd avatar Jun 29 '24 15:06 WieeRd