Giter Site home page Giter Site logo

vidir's Introduction

NAME

vidir - edit directory

SYNOPSIS

vidir [--verbose] [directory|file|-] ...

DESCRIPTION

vidir allows editing of the contents of a directory in a text editor. If
no directory is specified, the current directory is edited.

When editing a directory, each item in the directory will appear on its
own numbered line. These numbers are how vidir keeps track of what items
are changed. Delete lines to remove files from the directory, or edit
filenames to rename files. You can also switch pairs of numbers to swap
filenames.

Note that if "-" is specified as the directory to edit, it reads a list
of filenames from stdin and displays those for editing. Alternatively, a
list of files can be specified on the command line.

OPTIONS

-v, --verbose
    Verbosely display the actions taken by the program.

COLORS

If you want to use dircolors in vim, grab vidir-ls.vim.

Set VIDIR_EDITOR_ARGS accordingly:

export VIDIR_EDITOR_ARGS='-c :set nolist | :set ft=vidir-ls'

EXAMPLES

vidir
vidir *.jpeg
    Typical uses.

find | vidir -
    Edit subdirectory contents too. To delete subdirectories, delete all
    their contents and the subdirectory itself in the editor.

find -type f | vidir -
    Edit all files under the current directory and subdirectories.

ENVIRONMENT VARIABLES

EDITOR
    Editor to use.

VISUAL
    Also supported to determine what editor to use.

VIDIR_EDITOR_ARGS
    Optional args for editor

SEE ALSO

vidir-ls

AUTHOR

Joey Hess <[email protected]> 2006-2010

Modifications by Magnus Woldrich <[email protected]> 2011

COPYRIGHT

Copyright 2006-2011 the vidir "AUTHOR"s as listed above.

Licensed under the GNU GPL.

vidir's People

Contributors

00dani avatar olivierblanvillain avatar raimondi avatar trapd00r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vidir's Issues

Support different $TERM settings

It would be nice to support different $TERM settings at once. One way that I've gotten to work is to do a redirection in the main syntax file and have a tool write $TERM-specialized colorizings. The main syntax file would look like:

let colorfile=findfile('vidir-ls-'.$TERM.'.vim', expand('<sfile>:p:h'), 1)
if !empty(colorfile)
    exec 'source '.colorfile
end

The script to create the actual syntax files would generate it from $LS_COLORS and write the expected file using $TERM. It's based on the same code I submitted to the zsh syntax highlighting pull request I made.

Align file # / file columns

It's hard to do magic like gg^v10j and similar on files 1-10, 10-100, 100-1000 etc, because the visual selection doesn't cut in a straight line.

GPL

Thank you for vidir. I like it very much.
Can you specify with GPL is meant?
IANAL, but I think the GPL header and GPL license text are missing in the repository.

Best,
JS

mkdir -p before moving files?

I needed to edit some filenames and also move a bunch of files into a new directory, so I started up vidir and tried:

$ vidir
1 file
2 otherfile
3 someotherfile
# edit to
1 newdir/file
2 newdir/otherfile
3 newdir/someotherfile

Unfortunately, this failed because newdir didn't exist and so files couldn't be moved into it.

Would it be possible for vidir to run a mkdir -p sort of operation on the destination path for a file before trying to move it? Would this complicate the script too much, or be unintuitive behaviour? (For what it's worth, I did expect the above to work.)

Branching question and suggestion

Are there any plans to merge your version with the upstream GNU one?

Also, the origin of this repository seems to be slightly confusing to people, I think this could easily be fixed by a comment at the top of the README, explicitly noting how vidir is part of moreutils. If you agree I'll submit the PR myself.

Cannot run with newer vim

Hi,

Recently I updated my vim to 7.3 with path from 1-918. After that update, vidir cannot run successfully. Here's the error message:

Use of the encoding pragma is deprecated at /usr/bin/vidir line 6.
BEGIN failed--compilation aborted at /usr/bin/vidir line 6.

Use space only.

I think it would be better get ride of the tab between the file number and the file number and use one or several spaces instead. I have two arguments for that:

  • The recent changes take care of the alignment with spaces at the beginning of lines, which I think was the primary goal of the tab.
  • Some text editors, in particular when configured to work with space sensitive languages such as Python, automatically replace tab with spaces, which messes up with vidir.

I would be happy to write a PR if you are willing to make this change!

Support "git mv" for files tracked in git

This is a feature request. It would be awesome if I can open vidir in a directory where files are managed by git. I rename the filenames and vidir renames them for real using git mv old_name new_name. That would be a useful addition.

To implement this, vidir could check if each file that is renamed is under git control. If under git control, use git mv to rename, else use mv to rename.

Making proper manpage from README.md

Hello.

README.md is written in style of manual pages, but when I use pandoc to make manpage, result is not exactly what I want: extra indentation on the left and missing manpage name in left corner. I came with following script to fix that:

    cat << EOF > manpage.md
    ---
    title: vidir(1)
    ---
    EOF
    sed 's/    //' < README.md \
      | awk '{ print } /^# / { print "\n"; }' >> manpage.md
    pandoc -s manpage.md -o vidir.1

Unless you have another tool to generate manpage in mind, what about we apply this transformation and commit?

Also, it looks like both bin/vidir and README.md contain manpage content, and it takes some time to figure out that README.md is actually more up-to-date. What about if we remove extra copy?

Unicode mess

When vidir is invoked in a directory with files consisting of characters with a value greater than 127, bad things happen:

unicode mess

brew?

any chance you can add this to homebrew? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.