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

ls source to list current directory, most recent first #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaromil
Copy link

@jaromil jaromil commented Mar 28, 2018

Hi there. In case you like it, I find it useful, but adds deps to xclip and awk

ciao

Copy link
Contributor

@termoshtt termoshtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks PR.

The interface for xclip is good idea, and it will be useful for X11 users. It will be better to supports pbcopy and xsel as possible.

I have two concerns:

  • There is open-file source to show the result of ls.
  • xclip feature should not be the main action for this source.

I hope you add "copy to clipboard" action for open-files source instead of creating new source, and configure it as default using custom action introduced in #96


function zaw-src-ls() {
# avoid any alias present by calling full path
savealias=`alias ls`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use local to restrict scope. You should use command ls if you concern about alias.

"append filename" "prepend filename")
}

function strip-ls-long() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to zaw-src-ls-strip or some name you prefer to restrict name scope.

function zaw-src-ls-append() {
line="$1"

BUFFER="$BUFFER `print -- $line | strip-ls-long`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use $LBUFFER and $RBUFFER

@jaromil
Copy link
Author

jaromil commented Mar 31, 2018

OK, thanks for your review, all very reasonable.
Give me some time to go over this, I'll likely be able later on by end of april.

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.

None yet

2 participants