Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P , paren_entry: not working ! #9

Closed
NormTurtle opened this issue Apr 30, 2023 · 12 comments
Closed

P , paren_entry: not working ! #9

NormTurtle opened this issue Apr 30, 2023 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@NormTurtle
Copy link

i want to use h as parent_entry
but it only goes to the name of DIR , not goes to ../

also as described here
image

width = X , should not work in float , but its workign ! which is so confusing , since floatign window is usefull ,

please add more commets in config please
describe what options can be set, 🙏 im so confused, can't get window to way i want ! ,

also SFM is great im loving its simplicity, there is not much need of big heavy explorer, which is hard to configure like nvim-tree as beginner :(

@NormTurtle
Copy link
Author

sorry for bad english

@dinhhuy258
Copy link
Owner

Hi @omaru-ok, thank you very much for opening the issue.

  1. For the issue with parent_entry could you please send me the video with the bug, I could not reproduce the issue on my local machine. This is my config

image

  1. I checked, and the implementation was not correct. It still uses view.width even though the float is enabled. I just made a fix and hopefully, it's clear to you now.

thank you

@NormTurtle
Copy link
Author

i dont know much of lua , so i don't use complex tables, and variable, coz they will make things hard to me in the end,

i use the simple way || it may change im i become programmer and learned the real programming some day ||

  1. Lazy install Lazy-loading Tips would be appreciated , yes i want to lazyload SFm since i use Oil too
{ -- Simple file manager
  'dinhhuy258/sfm.nvim',
dependencies = { "dinhhuy258/sfm-fs.nvim" },
 config = function()
  require("File_manager")
  end
},
  1. send me the video with the bug

the Video
https://user-images.githubusercontent.com/108952834/235369417-f5428bdc-d261-4b18-8f16-504e8044ce44.mp4

  1. i want to embrace simple way , but most of readme's makes me confuse
    i tried installting Extension but it din't worked

image
is there anything wrong? i don't understand the code really provided here please make it simple

  1. if i use Default / Split , it just shows a very long Width no _matter _ what setting i change
    image

final thought, i think SFM is in early stage , there is so many new things to add

SFm has to be the simple yet-powerfull tree !, i realy din't liked nerdtree,

@dinhhuy258
Copy link
Owner

Sorry for my late response... Hmm, thank you for your information.

  1. https://user-images.githubusercontent.com/108952834/235369417-f5428bdc-d261-4b18-8f16-504e8044ce44.mp4
    Regarding your video, I still do not understand what is the issue here. Could you please tell me a little bit about the context? Such as:
  • What is your current cursor?
  • Which entry should the cursor move to when pressing action (parent_entry)?
  • What is the current behavior...
  1. if i use Default / Split , it just shows a very long Width no _matter _ what setting i change
    Can I have your setting please (your dotfiles)

  2. final thought, i think SFM is in early stage , there is so many new things to add

I understand that and the reason I created this plugin was just for fun :P ... I am very surprised and happy that you created an issue there.

@NormTurtle
Copy link
Author

NormTurtle commented May 3, 2023

  1. you din't answer my all previous questions :(
  2. regarding the video , im trying to replicate Change Dir up basically UP feature of nvim-tree using keybind h
  3. What is your current cursor?

i dont see this as a question? or i dont understand what it mean !?

  1. Which entry should the cursor move to when pressing action (parent_entry)?

as the name parent_entry says it should do UP, a parents Directory , as cd .. CLI

  1. What is the current behavior...

there is no other way provided in Readme for changing Directory's
so i guess 'parent_entry' should work :(

  1. Can I have your setting please (your dotfiles)

i do not indent to publish nvim-dots , but here it is
and here is SFM.Dots

Please check previously asked questoin ur missing the Extension part!

@dinhhuy258
Copy link
Owner

dinhhuy258 commented May 3, 2023

Hi @omaru-ok

  1. I see, you want to change the dir up, currently, I haven't supported that feature (i rarely use it then I have not implemented it) . I will prepare a pull request to support that feature soon change_root_to_parent (within 1-2 days)
  2. Regarding installing extension for sfm you can follow my setting here: https://github.com/dinhhuy258/dotfiles/blob/master/nvim/lua/plugins/sfm.lua

From your file, you need only to change like this

local sfm_explorer = require("sfm").setup({
 view = {
    side = "right", -- side of the tree, can be `left`, `right`. this setting will be ignored if view.float.enable is set to true,
    width = 2, -- this setting will be ignored if view.float.enable is set to true,
    float = {
      enable = true,
      config = {
        relative = "editor",
        border = "rounded",                 --    ┌────────────────┐
        width = 40, -- int or function      --    │                │
        height = 10, -- int or function     --    │   dinhhuy258   ├────────►  PLEASE ADD more info to comments             ╔════════╗
        row = 1, -- int or function         --    │                │            what does "int or function" mean!?    AGAIN ║ PLEASE ║
        col = 1 -- int or function          --    └────────────────┘                                                        ╚════════╝
      } } },
  mappings = {
    custom_only = true,
    list = {
      { key =    "u",  action = "parent_entry",},	-- Move cursor to the parent directory
      { key =    "h",  action = "parent_entry",},	-- Move cursor to the parent directory
      { key =    "p",  action = "parent_entry",},	-- Move cursor to the parent directory
     -- Edit
      { key =    "l",  action = "edit", },
      { key = "<cr>",  action = "edit", },
     -- { key ="<s-tab>", action = "close_entry", },
     { key =   "c>", action = "close_entry", },	-- Close current opened directory or parent
     -- Quit
      { key =     "x", action = "close", },
      { key =     "q", action = "close", },
      { key = "<esc>", action = "close", },
      { key = "<C-r>", action = "reload", }, -- Reload the explorer
     -- Splits
      { key = "<C-h>", action = "vsplit" },
      { key = "<C-v>", action = "split" },
      { key = "<C-t>", action = "tabnew" },
     -- Movement
      { key = "J",     action = "first_sibling" }, --	Navigate to the first sibling of current file or directory
      { key = "K",     action = "last_sibling" },  -- Navigate to the last sibling of current file or directory
    } },
})

sfm_explorer:load_extension("sfm-fs")
-- or 
-- sfm_explorer:load_extension("sfm-fs", {
-- your sfm-fs setting 
-- })

@dinhhuy258 dinhhuy258 self-assigned this May 3, 2023
@dinhhuy258 dinhhuy258 added the enhancement New feature or request label May 3, 2023
@dinhhuy258
Copy link
Owner

If you still have any question, feel free let me know...

@NormTurtle
Copy link
Author

i just really dig into sfm-fs.nvim
some issue i found

  1. at mapping i think copy_selections should be renamed to "Paste"
    and
  2. delete should give me enough power to safe me 😿 i mean ,
    it should let me set custom folder as TRASH, in window there is no trash-cli , but i delete's files accidentally , just for recovering them can i set delete_folder="~\.cache\.trash" PLEASE if u just did that , my life will be changed and i will be fearless ,
  3. Serious issue Can't use key the Default behavior of sfm-fs ,
    AS select a file on SPACE ,
    but i use space= key , so sfm dont register space as slection ,
    workaround !
    ! 🔴 { key = "space", action = "toggle_selection", }, -- THIS DO NOT WORK
    ! 🟢 { key = "<leader>", action = "toggle_selection", }, -- THIS WORK WELL ⭐
    ^ just for who use as SPACE

video demonstration Of ** SPACE vs <leader> **

2023-05-04_01-46-23.mp4

@dinhhuy258
Copy link
Owner

Hi @omaru-ok . I just added a feature to support changing root to parent and changing root to the current entry. For more information please refer this pr: #10

For the issue in sfm-fs. I will work on it tomorrow.

Thank you...

@NormTurtle
Copy link
Author

:) this commit was soo good, however, there is some litlte thing that is buggin me still
this is what config i end up with.

      { key = "h",     action = "change_root_to_parent",},--Change root dir, parent dir of the current entry
      { key = "o",     action = "change_root_to_entry",},	--Change root dir, current folder entry or to the parent dir of current file entry
      { key = "<tab>", action = "change_root_to_entry",},	--Change root dir, current folder entry or to the parent dir of current file entry
      { key = "u",     action = "parent_entry",},	-- Move cursor to the parent directory
      { key = "l",     action = "edit", },
      { key = "<cr>",  action = "edit", },
     { key ="<s-tab>", action = "close_entry", },	-- Close current opened directory or parent

THE ISSUE

if u want to change_root_to_parent u have do the parent_entry first , that is really annoying.
PLEASE
modify it so no matter on what file my cursor is on it should do change_root_to_parent without having to do parent_entry,
i hope u got it what i mean ?! and if u dont , please tell me i can video demonstration

btw what is actual usecase of parent_entry 🤔 anyway?, i just found it useless

@dinhhuy258
Copy link
Owner

Hi @omaru-ok

  1. You are right. The behavior of change_root_to_parent was not convenient, so I have created a PR to update it.
    Change behavior of change_root_to_parent action #11
  2. parent_entry is used to move the cursor to the parent directory of the current entry. I believe it same as this feature in nvim-tree https://github.com/nvim-tree/nvim-tree.lua/blob/master/doc/nvim-tree-lua.txt#L150

sfm-fs issues

  1. I will prepare a pr to support trash deletion this weekend.
  2. I will have a look into the SPACE issue this weekend as well.
  3. Regarding the naming of the action copy_selections, I understand that it should be paste, but I also have a move_selections action and I don't know which name is suitable for it either, so I decided to use copy_selections and move_selections so that both names are consistent.

@NormTurtle
Copy link
Author

GREAT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants