aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IDEAS.md2
-rw-r--r--bin/d2u.sh2
-rw-r--r--bin/sd2u.awk6
-rw-r--r--bin/su2d.awk6
-rw-r--r--bin/u2d.sh3
-rw-r--r--man/man1/d2u.1df2
-rw-r--r--man/man1/sd2u.1df2
-rw-r--r--man/man1/su2d.1df2
-rw-r--r--man/man1/u2d.1df2
-rw-r--r--vim/command.vim39
-rw-r--r--vim/config/command.vim4
11 files changed, 15 insertions, 55 deletions
diff --git a/IDEAS.md b/IDEAS.md
index 6bb4af82..37857163 100644
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -19,8 +19,6 @@ Ideas
* I can probably get rid of all that nasty templated shell by writing
something that wraps around td(1df) and generates shell script to run, and
calls that via `eval`.
-* The BigFileMeasures() function in .vim/config/bigfile.vim should maybe be a
- self-contained plugin rather than a config subfile.
* Ideally, the .awk and/or .sed scripts in the bin and games dirs should be
syntax-checked or linted. I could at least add some patient application of
appropriate `gawk --lint` calls for each of the .awk scripts.
diff --git a/bin/d2u.sh b/bin/d2u.sh
index 22c8e16b..892c446b 100644
--- a/bin/d2u.sh
+++ b/bin/d2u.sh
@@ -16,7 +16,7 @@ for fn ; do
# $r within it to get a literal carriage return; the escape characters
# prescribed for ed(1) by POSIX are very limited
ed -s -- "$fn" <<EOF || ex=1
-g/$r\$/ s/$r\$//
+,s/$r\$//
w
EOF
done
diff --git a/bin/sd2u.awk b/bin/sd2u.awk
index 02584952..b6e3da89 100644
--- a/bin/sd2u.awk
+++ b/bin/sd2u.awk
@@ -1,3 +1,3 @@
-# Convert DOS line endings to UNIX ones
-{ sub(/\r$/, "") }
-{ print }
+# Convert stream DOS line endings to UNIX ones
+BEGIN { RS = "\r\n" }
+1
diff --git a/bin/su2d.awk b/bin/su2d.awk
index 34a8c5ae..5a8eabaf 100644
--- a/bin/su2d.awk
+++ b/bin/su2d.awk
@@ -1,3 +1,3 @@
-# Convert UNIX line endings to DOS ones
-!/\r$/ { $0 = $0 "\r" }
-{ print }
+# Convert stream UNIX line endings to DOS ones
+BEGIN { ORS = "\r\n" }
+1
diff --git a/bin/u2d.sh b/bin/u2d.sh
index 9f4e800a..31030341 100644
--- a/bin/u2d.sh
+++ b/bin/u2d.sh
@@ -16,8 +16,7 @@ for fn ; do
# $r within it to get a literal carriage return; the escape characters
# prescribed for ed(1) by POSIX are very limited
ed -s -- "$fn" <<EOF || ex=1
-g/[^$r]\$/ s/\$/$r/
-g/^\$/ s/\$/$r/
+,s/\$/$r/
w
EOF
done
diff --git a/man/man1/d2u.1df b/man/man1/d2u.1df
index 18c27829..c652434c 100644
--- a/man/man1/d2u.1df
+++ b/man/man1/d2u.1df
@@ -6,7 +6,7 @@
.B d2u FILE1 [FILE2 ...]
.SH DESCRIPTION
Applies ed(1) to change DOS \\r\\n (CRLF) line endings to UNIX \\n line
-endings. Files already in UNIX format should be unchanged.
+endings.
.SH SEE ALSO
ed(1), u2d(1df), sd2u(1df), su2d(1df)
.SH AUTHOR
diff --git a/man/man1/sd2u.1df b/man/man1/sd2u.1df
index f07ebdb9..ee00c473 100644
--- a/man/man1/sd2u.1df
+++ b/man/man1/sd2u.1df
@@ -13,7 +13,7 @@ program |
.B sd2u
.SH DESCRIPTION
Applies awk(1) to change DOS \\r\\n (CRLF) line endings to UNIX \\n line
-endings. Lines already in UNIX format should be unchanged.
+endings.
.SH SEE ALSO
awk(1), su2d(1df), d2u(1df), u2d(1df)
.SH AUTHOR
diff --git a/man/man1/su2d.1df b/man/man1/su2d.1df
index aa6a8821..22aa80bd 100644
--- a/man/man1/su2d.1df
+++ b/man/man1/su2d.1df
@@ -13,7 +13,7 @@ program |
.B su2d
.SH DESCRIPTION
Applies awk(1) to change UNIX \\n line endings to DOS \\r\\n (CRLF) line
-endings. Lines already in DOS format should be unchanged.
+endings.
.SH SEE ALSO
awk(1), sd2u(1df), d2u(1df), u2d(1df)
.SH AUTHOR
diff --git a/man/man1/u2d.1df b/man/man1/u2d.1df
index 3bb16092..9af792bf 100644
--- a/man/man1/u2d.1df
+++ b/man/man1/u2d.1df
@@ -6,7 +6,7 @@
.B u2d FILE1 [FILE2 ...]
.SH DESCRIPTION
Applies ed(1) to change UNIX \\n line endings to DOS \\r\\n (CRLF) line
-endings. Files already in DOS format should be unchanged.
+endings.
.SH SEE ALSO
ed(1), d2u(1df), sd2u(1df), su2d(1df)
.SH AUTHOR
diff --git a/vim/command.vim b/vim/command.vim
deleted file mode 100644
index af7c8e36..00000000
--- a/vim/command.vim
+++ /dev/null
@@ -1,39 +0,0 @@
-" Keep plenty of command and search history, because disk space is cheap
-set history=2000
-
-" Always tell me the number of lines changed by a command
-set report=0
-
-" Command-line based features
-if has('cmdline_info')
-
- " Show my current position in the status bar
- set ruler
-
- " Show the keystrokes being entered in the screen
- set showcmd
-
- " Show the mode we're using if not normal mode (e.g. --INSERT--)
- set showmode
-endif
-
-" Always use forward slashes, I very seldom need to use Vim on Windows for
-" more than scratch space anyway
-if exists('+shellslash')
- set shellslash
-endif
-
-" Tolerate typos like :Wq, :Q, or :Qa and do what I mean, including any
-" arguments or modifiers; I fat-finger these commands a lot because I type
-" them so rapidly, and they don't correspond to any other commands I use
-if has('user_commands')
- command! -bang -complete=file -nargs=? E e<bang> <args>
- command! -bang -complete=file -nargs=? W w<bang> <args>
- command! -bang -complete=file -nargs=? WQ wq<bang> <args>
- command! -bang -complete=file -nargs=? Wq wq<bang> <args>
- command! -bang Q q<bang>
- command! -bang Qa qa<bang>
- command! -bang QA qa<bang>
- command! -bang Wa wa<bang>
- command! -bang WA wa<bang>
-endif
diff --git a/vim/config/command.vim b/vim/config/command.vim
index 1d2b647a..2a60bab3 100644
--- a/vim/config/command.vim
+++ b/vim/config/command.vim
@@ -22,7 +22,9 @@ set shellpipe=>
" Always use forward slashes, I very seldom need to use Vim on Windows for
" more than scratch space anyway
-set shellslash
+if exists('+shellslash')
+ set shellslash
+endif
" Tolerate typos like :Wq, :Q, or :Qa and do what I mean, including any
" arguments or modifiers; I fat-finger these commands a lot because I type