-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Ability to create multiple files and / or directories in 1 command #302
Comments
No. It's a bit incorrect. Fern creates I understand your want but I cannot image a good interface which consistent with the current one (I'm not going to apply breaking changes for this.) Does anyone have ideas? |
Oh my machine (Ubuntu 20.04 LTS) with the latest version of Fern as of today if I run $ ls -laR
.:
total 80
drwxr-xr-x 3 nick nick 4096 Feb 23 13:44 .
drwxrwxrwt 210 root root 69632 Feb 23 13:45 ..
drwxr-xr-x 3 nick nick 4096 Feb 23 13:44 a
./a:
total 12
drwxr-xr-x 2 nick nick 4096 Feb 23 13:44 ' b'
drwxr-xr-x 3 nick nick 4096 Feb 23 13:44 .
drwxr-xr-x 3 nick nick 4096 Feb 23 13:44 ..
'./a/ b':
total 8
drwxr-xr-x 2 nick nick 4096 Feb 23 13:44 .
drwxr-xr-x 3 nick nick 4096 Feb 23 13:44 .. And inside of Fern it creates a nested |
I... don't really get what you mean. It seems the result you pasted is what exactly I expect. I expect the following when you run
Is my expectation correct in your machine? |
Yep that is what happens. I misread your initial reply because I missed the empty whitespace reference (good idea with using |
Ok, then fern worked as it designed. Let's get back to the original. Do you (or anyone) have interface idea for creating multiple files/directories. Or are you satisfied with the current design while it create a file/directory as it designed? |
It's a tricky one. It would be kind of neat if it worked like It could get complicated tho because then there's maybe doing things like |
I'm sorry but I'm not going to apply breaking changes for this while most of people satisfied with the current interface. |
I find this feature could be handy for cpp devs. We regularly need to touch function! s:fern_exec(cmd) abort
let node = fern#helper#new().sync.get_cursor_node()
if l:node['status'] == g:fern#STATUS_NONE
let node = l:node['__owner']
endif
let path = l:node['_path']
let orig_path = getcwd()
exec 'lcd ' . l:path
execute '!' . a:cmd
exec 'lcd ' . l:orig_path
endfunction
command! -complete=shellcmd -nargs=+ FernExec call s:fern_exec(<q-args>)
command! -complete=shellcmd -nargs=+ FernExecIn FernDo -stay :FernExec <args> Usage: |
Thanks, I didn't have that point 👍 |
Ah, well, I need to think about Windows... I'm sure that |
I'm not sure how all Windows users use Vim but I am on Windows here and use terminal Vim within WSL which has access to all Unix commands. Is Fern coded today in such a way that it works with GUI Vim running in Windows? |
I know some users are using fern on gVim in Windows. I believe that supporting Windows is quite important feature of fern while tons of Vim plugins doesn't work well on Windows. |
Well, brace expansion in vim is not portable even in the Unix world. AFAIK it won't work on busybox. A portable solution might need a tedious vimscript implementation (which doesn't seem worth it), or some external dependency (which might be better to put in a seperated plugin): |
Well, I agree that perfect portability does not worth while I think nobody expect fern works on busybox or so on. |
I find myself creating directories and files using Fern because it's handy, but I noticed that you can't create more than 1 file or directory at a time in a way that produces an expected result.
For example if you create a new path and enter in
a/ b/
you end up witha/b
(B is nested in A) instead ofa/ b/
(they are their own independent directories). The expected outcome would be what you'd get if you usedmkdir
ortouch
directly.To get around this I find myself running
:!mkdir a/ b/
in Vim directly which works but this also means a lot more typing (especially if it's a nested directory in a project) and also reloading Fern to pick up the changes.The text was updated successfully, but these errors were encountered: