Ver Fonte

Updates/changes/etc

Simon Watson há 3 anos atrás
pai
commit
cc75bce83d
3 ficheiros alterados com 17 adições e 6 exclusões
  1. 5 4
      bashrc/bashrc-all
  2. 3 1
      emacs/.emacs-all
  3. 9 1
      emacs/elisp/rclone.el

+ 5 - 4
bashrc/bashrc-all

@@ -21,8 +21,10 @@ if [ ! -z "$EXA_PATH" ]; then
 fi
 
 # Platform agnostic aliases
-alias tmuxa="tmux attach -t $1"
-alias tmuxl="tmux ls"
+export TMUX_PATH=$(which tmux --skip-alias)
+alias tmuxn="$TMUX_PATH new -s $1"
+alias tmuxa="$TMUX_PATH attach -t $1"
+alias tmuxl="$TMUX_PATH ls"
 alias tmuxq="echo $TMUX"
 
 alias httpserver="python -m SimpleHTTPServer"
@@ -36,7 +38,6 @@ case $(hostname) in
 	# Mac aliases
 	alias shorten-ps1="PS1='λ > '"
 	alias default-ps1='PS1="\w λ > \[$(tput sgr0)\]"'
-	alias tmuxn="tmux new -s $1"
 	alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs"
 
 	# PATH setups
@@ -58,7 +59,7 @@ case $(hostname) in
 	
 	export PS1="[\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]]\$ "
 	alias start_od="rclone --vfs-cache-mode writes mount ipconedrive: /home/watonsi/OneDrive/"
-	alias tmux="systemd-run --scope --user tmux"
+	alias tmuxn="systemd-run --scope --user tmux new -s $1"
 	
 	# function to set terminal title
 	function set-title() {

+ 3 - 1
emacs/.emacs-all

@@ -158,6 +158,7 @@
 (global-set-key (kbd "C-c C-.") '(lambda ()
 				  (interactive)
 				  (switch-to-buffer "*Messages*")))
+(global-set-key (kbd "C-c C-f") 'find-file-at-point)
 
 ;;; Can probably be replaced with
 ;;; a yasnippet
@@ -198,7 +199,8 @@
 
 ;; Simple rclone cli wrapper
 (load "~/Repos/dotfiles/emacs/elisp/rclone.el")
-(global-set-key (kbd "C-c o") 'rclone-copy-buffer)
+(global-set-key (kbd "C-c o") 'rclone-post-buffer)
+(global-set-key (kbd "C-c C-o") 'rclone-get-org)
 
 
 ;; Load for macOS

+ 9 - 1
emacs/elisp/rclone.el

@@ -1,4 +1,12 @@
-(defun rclone-copy-buffer ()
+(defun rclone-post-buffer ()
   "Copies path of current buffer to b2/emacs"
   (interactive)
   (shell-command (format "rclone copy %s spw-b2:/spw01Backups1/emacs/" (buffer-file-name))))
+
+;;; This assumes rclone is configured with my b2 setup
+(defun rclone-get-org ()
+  "Copies orgmode file to temp location and opens in a new buffer"
+  (interactive)
+  (progn
+    (shell-command (format "rclone copy spw-b2:/spw01Backups1/emacs/1.org %s" temporary-file-directory))
+    (find-file (concat temporary-file-directory "1.org"))))