8da727b58a0f

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 01 Feb 2020 13:52:51 -0500
parents 6a7f7a6d7532
children e5ccdeae4a12
branches/tags (none)
files bin/e bin/nnl bin/pbc bin/pbcopy bin/pbp bin/pbpaste fish/functions/pbc.fish fish/functions/pbp.fish fish/functions/pbpb.fish gnuplot vim/vimrc

Changes

--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/e	Sat Feb 01 13:52:51 2020 -0500
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+"$EDITOR" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/nnl	Sat Feb 01 13:52:51 2020 -0500
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+tr -d '\n'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/pbc	Sat Feb 01 13:52:51 2020 -0500
@@ -0,0 +1,1 @@
+pbcopy
\ No newline at end of file
--- a/bin/pbcopy	Sat Feb 01 12:56:34 2020 -0500
+++ b/bin/pbcopy	Sat Feb 01 13:52:51 2020 -0500
@@ -1,3 +1,5 @@
 #!/usr/bin/env bash
 
-xclip -selection clipboard -i
+set -euo pipefail
+
+xsel --clipboard --input
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/pbp	Sat Feb 01 13:52:51 2020 -0500
@@ -0,0 +1,1 @@
+pbpaste
\ No newline at end of file
--- a/bin/pbpaste	Sat Feb 01 12:56:34 2020 -0500
+++ b/bin/pbpaste	Sat Feb 01 13:52:51 2020 -0500
@@ -1,3 +1,5 @@
 #!/usr/bin/env bash
 
-xclip -selection clipboard -o
+set -euo pipefail
+
+xsel --clipboard
--- a/fish/functions/pbc.fish	Sat Feb 01 12:56:34 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function pbc -d "pbcopy"
-    xsel --clipboard --input
-end
--- a/fish/functions/pbp.fish	Sat Feb 01 12:56:34 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function pbp -d "pbpaste"
-    xsel --clipboard
-end
--- a/fish/functions/pbpb.fish	Sat Feb 01 12:56:34 2020 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function pbpb -d "pbpaste to pastebin site"
-    pbp | pb
-end
--- a/gnuplot	Sat Feb 01 12:56:34 2020 -0500
+++ b/gnuplot	Sat Feb 01 13:52:51 2020 -0500
@@ -1,9 +1,51 @@
+# Basic Settings ---------------------------------------------------------- {{{
+
+set encoding utf8
 set terminal qt noraise
 set samples 1000
 
+# }}}
+# Constants --------------------------------------------------------------- {{{
+
 tau = 2 * pi
 e = 2.71828182845905
 r2 = sqrt(2.0)
 
+# }}}
+# Utility Functions ------------------------------------------------------- {{{
+
 min(a, b) = (a<b) ? a : b
 max(a, b) = (a>b) ? a : b
+
+# }}}
+# Exporting --------------------------------------------------------------- {{{
+
+export(file, terminal) = sprintf( \
+        "set terminal push;" . \
+        "set terminal %s;" . \
+        "set output '%s';" . \
+        "replot;" . \
+        "set output;" . \
+        "set terminal pop;" . \
+        "print system('realpath %s | nnl | pbcopy');" \
+    , terminal, file, file)
+
+export_pdf(file) = export(file . '.pdf', "pdfcairo")
+export_png(file) = export(file . '.png', "pngcairo")
+
+pdf = "eval export_pdf('graph')"
+png = "eval export_png('graph')"
+
+# }}}
+# Other ------------------------------------------------------------------- {{{
+
+kdens(file, column, bandwidth) = sprintf( \
+        "stats '%s' using %d;" . \
+        "plot '%s' using %d:(1.0/STATS_records) smooth kdensity bandwidth %f;" \
+    , file, column, file, column, bandwidth)
+
+cdf(file, column) = sprintf( \
+        "plot '%s' using %d:(1.0) smooth cnormal;" \
+    , file, column)
+
+# }}}
--- a/vim/vimrc	Sat Feb 01 12:56:34 2020 -0500
+++ b/vim/vimrc	Sat Feb 01 13:52:51 2020 -0500
@@ -1405,7 +1405,7 @@
 augroup ft_gnuplot
     au!
 
-    au BufNewFile,BufRead *.gp setlocal filetype=gnuplot
+    au BufNewFile,BufRead *.gp,.gnuplot setlocal filetype=gnuplot
 
     au FileType gnuplot nnoremap <buffer> <silent> <localleader>o :call OpenGnuplotRepl()<cr>