aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc25
1 files changed, 21 insertions, 4 deletions
diff --git a/vim/vimrc b/vim/vimrc
index dffcb814..38054eaf 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -4,7 +4,7 @@ vim9script
# Tom Ryder (tejr)'s Literate Vimrc
# -----------------------------------
#
-# Last updated: Fri, 06 May 2022 12:23:48 +0000
+# Last updated: Sun, 14 Jan 2024 03:06:40 +0000
#
# > And I was lifted up in heart, and thought
# > Of all my late-shown prowess in the lists,
@@ -494,6 +494,14 @@ endif
#
set breakindent
+# I use `cd` with no argument to go $HOME in the shell all the time.
+# Analogous behavior for Vim with :cd makes sense to me. I can use :pwd (or
+# my <Leader>g mapping) if I want to see where I am.
+#
+if exists('+cdhome')
+ set cdhome
+endif
+
# Rather than rejecting operations like :write or :saveas when 'readonly' is
# set or in other situations in which data might be lost, Vim should give me
# a prompt to allow me to confirm that I know what I'm doing.
@@ -722,6 +730,15 @@ set noshowcmd
#
set shortmess+=I
+# Scrolling by screen line rather than file line makes sense to me. Turn the
+# option to do so on, if it's there. This only works with mouse scrolling,
+# which I don't use, and with CTRL-E, CTRL-Y, which I should be using more
+# anyway.
+#
+if exists('+smoothscroll')
+ set smoothscroll
+endif
+
# I find the defaults of new windows opening above or to the left of the
# previous window too jarring, because I'm used to both the i3 window manager
# and the tmux terminal multiplexer doing it the other way around, in reading
@@ -929,9 +946,9 @@ endif
# many of these.
#
-# Use backspace as an even quicker way to switch to the current buffer's
-# alternate buffer. User nickspoons of #vim was incredulous that I had never
-# used CTRL-^ and indeed did not know about it. I have since repented.
+# I use Mosh (the mobile shell) a lot, which uses CTRL-^ as its escape key.
+# That shadows Vim's shortcut to switch to the alternate buffer. Map
+# <Backspace> to do that instead.
#
nnoremap <Backspace>
\ <C-^>