From 00461d9404e0e851136a9a920f55eb064ff757f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Wed, 10 Apr 2024 13:17:49 +0200 Subject: [PATCH] Start work on using oil.nvim for navigation --- .config/nvim/lua/plugins/oil.lua | 13 +++++++++++-- .config/zsh/.zshrc | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index 4f13f72..98b2367 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,10 +1,20 @@ +local function store_select() + require("oil").select({}, function() + local f = io.open("/tmp/oil_dir", "w") + if f then + f:write(require("oil").get_current_dir()) + f:close() + end + end) +end + return { 'stevearc/oil.nvim', dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true, opts = { keymaps = { ["g?"] = "actions.show_help", - [""] = "actions.select", + [""] = store_select, ["v"] = "actions.select_vsplit", ["s"] = "actions.select_split", ["p"] = "actions.preview", @@ -16,7 +26,6 @@ return { ["~"] = "actions.tcd", ["g."] = "actions.toggle_hidden", }, - -- Set to false to disable all of the above keymaps use_default_keymaps = false, } } diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index ef0b614..7be9ee0 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -262,6 +262,7 @@ alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config" alias python=python3 alias r=". ranger" +alias v="vim . && cd \"\$(cat /tmp/oil_dir)\"" alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1" alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files" alias rg="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"