Code Monkey home page Code Monkey logo

bashmarks's People

Contributors

chadbraunduin avatar daveharris avatar erikw avatar huyng avatar nikreiman avatar sjsrey avatar w9 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  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

bashmarks's Issues

Add directions to README for Windows Users

For example, if someone is using Git Bash for Windows, they will not have the ability to run the make command.
This command could be replaced by a few mkdir and a cp.

I was personally able to figure it out on my own, but it would be nice if the commands were simply in the README.

"l" question

the current function "l" is typically aliased to something else on Ubuntu

What's the recommend way to alter the alias for bashmarks, with modifying the code? i.e. l -> lll

relative (to home directory) paths?

I love bashmarks. I had been keeping all kinds of aliases in .bashrc and this has changed my life at the terminal.

I'd love to see a feature where the bashmarks can be saved (and executed) as paths relative to ~. It would make it possible for me to sync .sdirs between OSes (linux/mac) that have different home directory paths.

Thanks!
Clark

Whitespace in $HOME directory.

hi,

my home directory has, unfortunately, a space in it. specifically "Macintosh HD". This makes bash marks useable. Aside from renaming the hard drive, is there a fix for this?

examples below:

$ l
-bash: source: /Volumes/Macintosh: is a directory
$ s something
-bash: $SDIRS: ambiguous redirect
$ p something
-bash: source: /Volumes/Macintosh: is a directory

Add to homebrew for mac?

I think this project is perfect to add to homebrew so that Mac users can easily install it. Please consider doing so.

Not works for ubuntu

error:

root@test:/opt# source /root/.local/bin/bashmarks.sh
: command not found
: command not found
: command not found
-bash: /root/.local/bin/bashmarks.sh: line 45: syntax error near unexpected token $'{\r'' 'bash: /root/.local/bin/bashmarks.sh: line 45: function s {

my ubuntu uname info:

Linux test|3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Install and share Bashmarks between multiple user?

Sorry if this question already aked anywhere... I didn't found it. But can remember that i read something about it in the past.

To share the marks between multiple user... i think it is enough to sync the .sdirs file.
But I would like to know how I've to install Bashmarks to make it usable for all users.

Or did I really have to install it on each user again?

Compability with oh-my-zsh

Hi!

I'm unsure as to exactly what causes this but when i use this on my server with zsh and oh-my-zsh installed this happens

http://www.screencast.com/users/flexd/folders/Jing/media/ade8103f-e9fd-4979-a99b-47de78ec2b37

I had the exact same problem with rvm and zsh (if you have heard of rvm, http://rvm.beginrescueend.com/integration/zsh/). To solve that with rvm i had to do "unsetopt auto_name_dirs"

That probably changes some setting inside rvm but should also be a clue on how to fix it? I can take a look at the rvm source to see if i can find a solution but it's going to have to be next week some time. I figured i'd post this here in the mean time so perhaps someone else knew how to fix it or figured it out :-)

Thanks for making such a useful and obvious little feature, can't really see why nobody has thought of this before!

Function names conflict with fasd. Suggestion to a new script design... Read details.

I suggest a change to the architecture.

Make the function names more descriptive. eg. bashmark_jump instead of g and so on.
Then alias them.

Take this snippet:

function bashmark_jump() {
    # do stuff here
}

# other functions

alias g='bashmark_jump'
alias s='bashmark_save'
# so on

Even better option would be to add the alias definitions in another file or to simply echo it to .bash_aliases or .bashrc.

This is merely a suggestion and I don't know how portable this approach will be (zsh, OSX etc.).

I have tested this on bash and it works fine. If you want, I can submit a pull too because that's how I have set it up on my system.

bashmarks does not work with "set -o noclobber" in bash

While having set -o noclobber in my .bashrc, bashmarks start to get errors while adding marks

After changing the # purge line in the function _purge_line from
sed "/$2/d" "$1" > "$t"
to
sed "/$2/d" "$1" >| "$t"
it works.

I suggest a function that checks if the noclobber option is set while the script is sourced and adjust the script true a variable if it is.

If a script is run normally the "noclobber" option does not concern but as this script loads with the shell it would be good if it took this option in to concern.

Feature request - shortcut for current directory

Hi,

I use bashmarks all the time and it is extremely useful to me.

Feature request: a shortcut to set the current directory as a bookmark without typing the name

I would have a list of directories that function as work places I frequently navigate to. Every time I have to set a bashmark as in

cd my-very-long-working-directory
s myverylongworkingdirectory
cd to-where-I-was-before

The shortcut would be to simply state

s cwd

where cwd is the name of the current working directory that is parsed to remove characters that bashmarks do not allow. The cwd can be anything else, it need not be cwd as long as bashmarks recognise it as the current working directory.

A trivial feature, but one that will be useful to some.

Thanks

Feature request - go to marks based on directory root

Hello,

This is a brilliant tool that saves a lot of time. However, here is a case where it could even work better:

I often have several directories I traverse to in the software project using the marks. However I usually have multiple versions of the project, e.g. /opt/v1/ opt/v2/ /opt/v3/ etc. If I could have relative marks I would not have to re-record all directories when I switch between v1/ and v2 for example.

Maybe while saving a mark, there could be a relative option where we specify the starting point?

Thanks,
Bahadir

Wishlist: use system's default bookmarks file

Hi everyone,
The default bookmarks file is ~/.config/gtk3.0/bookmarks, it has this format:
file:///filepath bookmark_name
If use the system file, bash bookmarks will be available in a file manager.

.description ?

Maybe add file .description in path:

s pathname "bla-bla-bla"

and read this file when listing:

l
pathname /media/.../path 
bla-bla-bla
pathname2 /media/.../path2
[ cat /media/.../path2/.description ]
pathname3 /media/.../path3
[ cat /media/.../path3/.description ]
...

?

Feature request: Change directory using numbered list

Gurus,

This tool is great, and I think more value can be added if we can show a numbered list, and allow users to jump to a directory based on the number.

This is similar to how you run the history command, you see a numbered list of history commands, and then you can use !n to re run a particular command. Similarly,

$ l
1     foo         /Users/roubles/foo
2     bar         /Users/roubles/bar
3     fubar       /Users/roubles/fubar
4     nada        /Users/roubles/nada
5     alice       /Users/roubles/git/alice
6     bob         /Users/roubles/git/bob

And then users can use something like 'n 5' and jump to /Users/roubles/git/alice.

$ n 5
$ pwd
$ /Users/roubles/git/alice

This simplifies the workflow a lot.

Path with whitespaces

First of all I want to thank you. This is an awesome tool!

However I have issues going to paths with whitespaces such as ~/Library/Application Support/
Setting a path with bashmarks "s" works perfectly but I can't go in that folder with "g".

Sincerely
Ömer Avci

Autocomplete not working

When I type g <tab> I get g 1:IR_deployer. My ~/.sdirs contains export DIR_deployer="$HOME/Sites/deployer"

Clear all bookmarks with d_c

Sometimes I want to clear all bookmarks. Can you add a d_c option for that?
Maybe even a 'are you sure?' prompt.

Feature: Improved CLI structure (single command w/ options)

The current CLI of s, g, d, l, and p takes up single-letter designations that many developers prefer to use for custom aliases. It is also unconventional, in that most *nix CLIs are a single command with option flags for the different actions.

This also causes forward-compatibility issues. For example, if #77 is implemented the current convention would argue for a c(leanup) command, but this may unexpectedly collide if someone already has a c alias or function.

Furthermore, the only action that really merits a single-letter designation is the g command [edit: sorry, I meant 'g', not 'c']. That's the only one that is used enough to warrant the single-letter shortcut. (Navigating to a directory occurs 100x more often than setting, listing, or deleting.)

Thus, I suggest switching the CLI to a single command (e.g. 'mark'), thusly:

Old New Comment
g mark (no options) aliased as g
s mark --set or mark -s
d mark --delete or mark -d
l mark --list or mark -l
p mark --print or mark -p
(new) mark --help or mark -h usage and help info
(new) mark --legacy Creates s, d, l, p aliases (which would not be configured by default)
(new) mark --clean or mark -c Cleanup. see #77

UTF-8 support in bookmark names

I'm in a UTF-8 environment and a lot of my directories' names have characters above ASCII in them. For many of those it'd be natural to assign bookmark names that also have characters beyond ASCII. For example, my "Desktop" directory is localized as ~/Työpöytä, and I'd like to name that bookmark "työpöytä".

jani@saegusa:Työpöytä$ s työpöytä
bookmark name is not valid

This fails because bashmarks validates names using the regexp /[^A-Za-z0-9_]/. It's simple enough to patch to account for the 6 additional characters in my Scandinavian locale, but bashmarks also derives an environment variable name from the bookmark name, and apparently Bash does not support UTF-8 for those:

jani@saegusa:~$ LC_MESSAGES=C export DIR_työpöytä=$HOME/Työpöytä/
bash: export: `DIR_työpöytä=/home/jani/Työpöytä/': not a valid identifier

There may be other obstacles as well, those are just the two I could find at a glance.

Obviously I can work around this by not using UTF-8 in bookmark names, but it needlessly increases the mental effort required to recall the names and also the chances of name collisions.

default g

just s makes the current dir the default g. Or something like that. Just a default g would be great. Like cd defaults to ~/

.sdirs symlinks

I use yadm to manage my dotfiles across many different systems. The current
mechanism they have for managing files that are different are symlinks, so for
example

.sdirs## <- default
.sdirs##classA <- special one-off system (i.e. different and/or extra bashmarks)

A yadm alt command will link .sdirs --> .sdirs##classA or .sdirs --> .sdirs## based on
configuration.

The current bashmarks will stop on the symlink during a "s" and my guess "d"

Possible solution, to see if SDIRS is a link, if so follow it to the real file
change:

if [ ! -n "$SDIRS" ]; then
    SDIRS=~/.sdirs
fi
touch $SDIRS

to

if [ ! -n "$SDIRS" ]; then
    SDIRS=~/.sdirs
fi

tmp=$(readlink $SDIRS)
if [ -n "$tmp" ]; then
#    echo "Updating sdirs: $tmp"
    SDIRS=$tmp
fi
touch $SDIRS

Homebrew integration for Mac?

This project would profit greatly from a home-brew integration for easy installation on Macs.

Edit: I forgot I had already requested this :)

`g` should exit noisily, and with a non-zero error code, when trying to go to undefined bookmark

Failing silently (by defaulting to the user's home directory) is unexpected and dangerous. For example:

cd nonexistant_dir && rm *
-bash: cd: nonexistant_dir: No such file or directory
# Didn't accidentally delete files in the current directory, yay!

whereas ...

g undefined_alias && rm *

Fuck, we just deleted all the files in whatever the current directory was :(

What should happen ...

cd nonexistant_dir && rm *
-bashmarks: g: no alias for 'nonexistant_dir'
# rm command should not execute here

Feature: Command to remove all bookmarks that link to undefined directories

Thanks (again) for a great tool. I've been using this for years and it's an essential part of my workflow.

One thing I've found is that as my work flows from one project to the next and I delete (or move) old projects, many of the bookmarks I've saved become invalid (dead). Cleaning these up is somewhat annoying process. One has to try each bookmark individually to see if it still works and, if not, delete it.

It would be nice if there were a shortcut that would do this as a single command.

zsh complains "_purge_line:7: file exists"

It's actually a zsh issue, but can be a problem to it's users.
It writes down "_purge_line:7: file exists:" and does strange things with bookmarks, like overwrites previous or doesn't save new ones.

The problem is with zsh config option NOCLOBBER,

From zsh docs on CLOBBER:
Allows > redirection to truncate existing files, and >> to create files. Otherwise >! must be used to truncate a file, and >>! to create a file.

I'm not a bash ninja, so I can't provide a patch for this issue, I just turned it off in zsh config file
setopt CLOBBER

How do I delete a weird named bashmark?

For some reason, the script accidentally created this bookmark:

$ l
-bash: export: `DIR_apt-605=/Users/marcamillion/folders/some-project': not a valid identifier

How do I get rid of it?

I tried d and that entire line, but it doesn't work.

Thoughts?

It actually sends me to a prompt, it seems the ``` character is throwing it off:

$ d -bash: export: `DIR_apt-605
> `
-bash: DIR_apt-605: command not found
-bash: d: command not found

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.