| @@ -176,6 +176,36 @@ plugins.options["twitter_client.use_jmp"] = true; | |||||
| //////////////////////////////////////////// | //////////////////////////////////////////// | ||||
| // my ext | // my ext | ||||
| (function(){ | |||||
| function getOrganizer(){ | |||||
| // [How to call for Firefox bookmark dialog? - Stack Overflow] | |||||
| // (http://stackoverflow.com/questions/9158187/how-to-call-for-firefox-bookmark-dialog) | |||||
| Components.utils.import("resource://gre/modules/Services.jsm"); | |||||
| var organizer = Services.wm.getMostRecentWindow("Places:Organizer"); | |||||
| if (!organizer) { | |||||
| // No currently open places window, so open one with the specified mode. | |||||
| openDialog("chrome://browser/content/places/places.xul", | |||||
| "", "chrome,toolbar=yes,dialog=no,resizable", "AllBookmarks"); | |||||
| return null; | |||||
| } else { | |||||
| return organizer; | |||||
| } | |||||
| } | |||||
| ext.add("export-bookmarks", function(ev, arg){ | |||||
| var organizer = getOrganizer(); | |||||
| if (organizer) { | |||||
| organizer.PlacesOrganizer.exportBookmarks(); | |||||
| } | |||||
| }, "export bookmarks"); | |||||
| ext.add("import-bookmarks", function(ev, arg){ | |||||
| var organizer = getOrganizer(); | |||||
| if (organizer) { | |||||
| organizer.PlacesOrganizer.importBookmarks(); | |||||
| } | |||||
| }, "import bookmarks"); | |||||
| })(); | |||||
| ext.add("my-index-html", function(ev, arg){ | ext.add("my-index-html", function(ev, arg){ | ||||
| homepath = util.getEnv("HOME"); | homepath = util.getEnv("HOME"); | ||||
| file = ".index.html"; | file = ".index.html"; | ||||
| @@ -56,7 +56,7 @@ git_config(){ | |||||
| git config --global status.relativePaths false | git config --global status.relativePaths false | ||||
| git config --global status.showUntrackedFiles normal | git config --global status.showUntrackedFiles normal | ||||
| git config --global log.date iso | git config --global log.date iso | ||||
| git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"<%C(green)%h%C(reset)> %C(white)%ad%C(reset) [%C(red)%an%C(reset)] %C(yellow)%d%C(reset) %C(white bold)%s%C(reset)\" --all --date=iso -n 499" | |||||
| git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"%C(green)%h%C(reset) %C(white)%ad%C(reset) %C(red)%an%C(reset)%C(yellow)%d%C(reset) %C(white bold)%s%C(reset)\" --all --date=iso -n 499" | |||||
| git config --global alias.st "status -s -b" | git config --global alias.st "status -s -b" | ||||
| git config --global alias.b "branch" | git config --global alias.b "branch" | ||||
| git config --global alias.sb "show-branch" | git config --global alias.sb "show-branch" | ||||
| @@ -42,6 +42,8 @@ sub set_key { | |||||
| } | } | ||||
| sub set_prefs { | sub set_prefs { | ||||
| set("base-index", "1"); | |||||
| set("pane-base-index", "1"); | |||||
| setw("mode-keys", "vi"); | setw("mode-keys", "vi"); | ||||
| set("default-command", "/bin/bash"); | set("default-command", "/bin/bash"); | ||||
| set("default-path", $ENV{"HOME"}); | set("default-path", $ENV{"HOME"}); | ||||
| @@ -49,16 +51,25 @@ sub set_prefs { | |||||
| set("display-panes-time", "5000"); | set("display-panes-time", "5000"); | ||||
| } | } | ||||
| sub get_hostname { | |||||
| my $hostname = $ENV{"HOSTNAME"}; | |||||
| if (! $hostname) { | |||||
| $hostname = `hostname`; | |||||
| $hostname =~ s/\n//; | |||||
| } | |||||
| return $hostname; | |||||
| } | |||||
| sub set_status_line { | sub set_status_line { | ||||
| my $user = $ENV{"USER"}; | my $user = $ENV{"USER"}; | ||||
| my $hostname = $ENV{"HOSTNAME"}; | |||||
| my $hostname = get_hostname(); | |||||
| my $tmux_v = `tmux -V`; | my $tmux_v = `tmux -V`; | ||||
| $tmux_v =~ s/\n//; | $tmux_v =~ s/\n//; | ||||
| set("status-right", "${user}\@${hostname} | ${tmux_v} "); | set("status-right", "${user}\@${hostname} | ${tmux_v} "); | ||||
| } | } | ||||
| sub set_colors { | sub set_colors { | ||||
| my $hostname = $ENV{"HOSTNAME"}; | |||||
| my $hostname = get_hostname(); | |||||
| my $color = $color_prefs{$hostname}; | my $color = $color_prefs{$hostname}; | ||||
| if (! $color) { | if (! $color) { | ||||
| $color = $color_def; | $color = $color_def; | ||||