Skip to content

Commit

Permalink
Added support for the emacs editor.
Browse files Browse the repository at this point in the history
- Previously only supported vim by default
- Now supports emacs (and any other editor that supports the folllowing
  syntax for opening a specific file at a specific line:
  $ editor_name +line_num /file_path/file_name
- Updated README
- Misc trivial fixes
  • Loading branch information
sampson-chen committed Nov 3, 2012
1 parent b2240d6 commit eb7b508
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .sackrc
Expand Up @@ -21,7 +21,7 @@ sack__dev_null=/dev/null
# Determine the OS
sack__OS=$(uname)

# @todo: add support for editors other than vim
# @todo: add support for editors other than vim and emacs
sack__default_editor=vim

# # # # # # sack profiles # # # # # #
Expand Down
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -49,7 +49,7 @@ Now, instead of having to spend time tediously navigating to some deep directory

user@linux:~$ F 21

And sack will open the file associated with that particular search result with your favorite editor (-cough-vim-cough-) and even go to the right line for you automatically. (It doesn't have to be "F", see config file for reassigning the shortcut command)
And sack will open the file associated with that particular search result with your favorite editor (currently supports both vim and emacs: see ~/.sackrc after installation) and even go to the right line for you automatically. (It doesn't have to be "F", see config file for reassigning the shortcut command)

The repetitive 10-15 sec chore has now been reduced to only 2 keystrokes (~1 second)!! More importantly, now you won't lose your train of throught from mentally context switching from the task at hand to deal with menial things like typing out a file path. Yay productivity!!

Expand Down Expand Up @@ -120,7 +120,7 @@ To set new preset flags to use for the current profile:
(All searches run using this profile will use these flags)

sack -sf NEW_FLAGS
sack --setflags
sack --setflags -ia -A 2 -B 3

### Set Directory

Expand Down Expand Up @@ -148,10 +148,9 @@ To show the current available profiles:

Additional features / functionalities to be implemented:

- Implement support for other editors (emacs, sublimeText etc)
- Implement support for other editors (sublimeText etc)
- Implement high-light for vim for the searchword when following a shortcut
- Functionality for deleting a profile
- Functionality for searching for multiple directories
- Check that the user has ~/bin in their path
- Add a check in `install_sack.sh` to also install ack if it's not already on the system.
- Finish implementation for a decrement count for the beginner msg so it displays a certain number of times at the start
Expand Down
4 changes: 2 additions & 2 deletions sack
Expand Up @@ -76,7 +76,7 @@ print_help() {
echo "To set new preset flags to use for the current profile:"
echo "(All searches run using this profile will use these flags)"
echo "$sp sack -sf NEW_FLAGS"
echo "$sp sack --setflags"
echo "$sp sack --setflags -ia -A 2 -B 3"
echo ""
echo "===> Set Directory <==="
echo "To set a new preset directory to use for the current profile:"
Expand Down Expand Up @@ -153,7 +153,7 @@ create_shortcut_cmd() {
sack__shortcut_cmd_path=~/bin/$sack__shortcut_cmd
echo "#!/bin/bash" > $sack__shortcut_cmd_path
echo "sack__vim_shortcut=\$(sed -n \"\$1p\" < $sack__shortcut_file)" >> $sack__shortcut_cmd_path
echo "vim +\$sack__vim_shortcut" >> $sack__shortcut_cmd_path
echo "$sack__default_editor +\$sack__vim_shortcut" >> $sack__shortcut_cmd_path
chmod +x $sack__shortcut_cmd_path
}

Expand Down

0 comments on commit eb7b508

Please sign in to comment.