Comments (5)
All I have myself so far is: "move yanked file to current dir" which turns out to be at the bottom of the list for me 😅
nnoremap <silent><buffer> m :!mv <c-r>" %<CR>
from vim-dirvish.
Another helpful bit is to put all these bindings under an augroup like detailed in the help files:
augroup dirvish_config
autocmd!
autocmd FileType dirvish nnoremap <silent><buffer> m :!mv <c-r>" %<CR>
augroup END
from vim-dirvish.
I managed to do one, and that's all I have time for right now 😭 .
- move file / folder to provided path
function! g:DirvishDoMove() abort
let target = trim(getline('.'))
let filename = fnamemodify(target, ':t')
let newname = input('Move to: ')
let cmd = 'mv ' . shellescape(target) . ' ' . shellescape(expand("%") . newname . '/' . filename)
let output = system(cmd)
if v:shell_error
call s:logError(output)
endif
" Reload the buffer
Dirvish %
endfunction
Bound like so:
autocmd FileType dirvish nnoremap <silent><buffer> m :call DirvishDoMove()<CR>
Just noticed that this does not tab-complete the path as you write it. That'd be nice to have but I'd say outside of the scope.
Another nice-to-have here is that if the moved file is open in a buffer, this buffer does not get updated.
from vim-dirvish.
Too much work for me, closing this for now.
from vim-dirvish.
Thanks for looking into this. I'm open to adding some well-selected default behaviors, but ...
Must have:
- copy file/folder to provided path
- move file/folder to provided path
- delete file/folder
"delete" is just so easy already (.rm<cr>
or .rm -rf<cr>Z!
), and making a destructive even easier is questionable. I'm also skeptical about copy/move. Separate prompts are not convincingly superior to... a shell script.
copy arglist to current dir
move arglist to current dir
I agree these are awkward currently.
delete arglist
This is already easy: [count].rm<cr>Z!
copy file/folder under cursor to provided path
What interface is going to be better than the already-existing :
interface? Prompts are prompts.
Renaming multiple is a beast of its own. I think the most natural would be for the command to accept input after triggering for a single file
Yeah, this was one of the original motivations for Dirvish. Editing a script is easier, more intuitive, and (if Vim is doing its job...) faster, than learning a quasi-pseudo-DSL for another tool.
Thanks for the great dirvish plugin! 💛
Thanks for the kind words!
from vim-dirvish.
Related Issues (20)
- Weird behavior when directory is opened with vim.cmd (Neovim's Lua API) HOT 2
- `-` (with vim-fugitive) clobbers in-progress git commit messages HOT 2
- The hash value column fails dovish HOT 4
- Setting g:dirvish_relative_paths=1 will disable icon and g:dirvish_mode HOT 2
- "E37: Buffer would be deleted" from startify HOT 13
- [Feature request] Add config for map / HOT 1
- remap :Explore command HOT 4
- Delete buffer HOT 1
- dir up stopped working HOT 9
- Any way to display whether a file is symlinked similar to netrw? HOT 1
- respect b:did_ftplugin HOT 5
- i do have a need to set `&buftype=wipe` for a dirvish buf HOT 6
- win32 UNC path (in this case: wsl) is not well supported
- Bindings are not silent on neovim HOT 2
- How to tell whether the current buffer is Dirvish? HOT 2
- `vidir` like functionality in dirvish HOT 1
- dirvish_up extremly slow HOT 3
- show the metadata next to filename HOT 1
- [question]: purpose of "forcing normal mode" in filetype normal mode mapping HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-dirvish.