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

Fixes 'tree view' mapping suggestion in doc to not change file order, and not overwrite " register #241

Closed
wants to merge 2 commits into from

Conversation

yogeshdhamija
Copy link
Contributor

@yogeshdhamija yogeshdhamija commented Oct 23, 2023

Not to suggest that maintaining a hacky workaround is the best use of anyone's time, but might as well have a correct hacky workaround ¯\_ (ツ)_/¯.

This PR is in regard to the t remap suggested in the docs, which allows subdirectories to be included in the file listing (making it sort of a tree-style view).

This PR has two commits, the first change prevents the file order from being messed with. The second saves your " register so that it's not overwritten.

Before:
before behaviour

After:
after behaviour

@justinmk
Copy link
Owner

this seems to work without using a register:

nnoremap <buffer> t o<Esc>:r !find '<C-R>=substitute(getline(line(".")-1),"\\n","","g")<CR>' -maxdepth 1 -print0 \| xargs -0 ls -Fd<CR>:silent! keeppatterns %s/\/\//\//g<CR>:silent! keeppatterns %s/[^a-zA-Z0-9\/]$//g<CR>:silent! keeppatterns g/^$/d _<CR>"_dd

@justinmk justinmk closed this in babbf69 Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants