9626a177bf66

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 15 Mar 2024 10:07:38 -0400
parents a945ff0fd02f
children 9a59125631d0
branches/tags (none)
files .hgsub .hgsubstate hgrc stumpwm/local-share-stumpwm/522.lisp.dump vim/custom-dictionary.utf-8.add vim/ultisnips-bullshit/README.markdown vim/ultisnips-bullshit/tex.snippets vim/vimrc

Changes

--- a/.hgsub	Fri Feb 16 14:12:21 2024 -0500
+++ b/.hgsub	Fri Mar 15 10:07:38 2024 -0400
@@ -35,6 +35,7 @@
 vim/bundle/surround              = [git]https://github.com/tpope/vim-surround
 vim/bundle/swig                  = [git]https://github.com/vim-scripts/SWIG-syntax
 vim/bundle/targets               = [git]https://github.com/wellle/targets.vim
+vim/bundle/ultisnips             = [git]https://github.com/SirVer/ultisnips
 vim/bundle/vim-go                = [git]https://github.com/fatih/vim-go
 vim/bundle/vimtex                = [git]https://github.com/lervag/vimtex
 vim/bundle/vlime                 = [git]https://github.com/sjl/vlime
--- a/.hgsubstate	Fri Feb 16 14:12:21 2024 -0500
+++ b/.hgsubstate	Fri Mar 15 10:07:38 2024 -0400
@@ -2,7 +2,7 @@
 1fc4a9fbead7e0acc4c828b346f3be2658ec3df9 mercurial/templates
 dcbfe065297d31823561ba787f51056c147aa682 vim/bundle/abolish
 36e40f9ec91bdbf6f1adf408522a73a6925c3042 vim/bundle/ack
-cbc4da8970848ba4d3cb6ca2d9273a0114ff953b vim/bundle/badwolf
+fbbdfbde7b877292940871637c57a1ee8958e365 vim/bundle/badwolf
 b7f789f305b1c5b0b4623585e0f10adb417f2966 vim/bundle/boxdraw
 b542a7bc4d9bc5da8fb12e110fe7975131fb57a4 vim/bundle/clam
 e87cd90dc09c2a203e13af9704bd0ef79303d755 vim/bundle/commentary
@@ -35,7 +35,8 @@
 aa1f120ad3a29c27cc41d581cda3751c59343cce vim/bundle/surround
 19c3d966440b6cfe8d74251881a48e961ddb8648 vim/bundle/swig
 f6f2d6618a321f5b0065586a7bc934325fec81ab vim/bundle/targets
+b393ba65386d47664421e1f8b246a87a6e8b218c vim/bundle/ultisnips
 e9d7ff3eb4a369f0cb2069c8f77ae68796bca308 vim/bundle/vim-go
-5d5c71044880443035e07009497962feacb56b20 vim/bundle/vimtex
+9df79e15bf035d1cfb32c11fffed38dd7b6a0501 vim/bundle/vimtex
 c1ac16c1a50bec4c30da87cd4ce2af12e26fb022 vim/bundle/vlime
 6876fe38b33732cb124d415ffc4156f16da5e118 vim/bundle/windowswap
--- a/hgrc	Fri Feb 16 14:12:21 2024 -0500
+++ b/hgrc	Fri Mar 15 10:07:38 2024 -0400
@@ -125,9 +125,11 @@
 
 # Some useful little aliases.
 st = status -SC
+stl = !"$HG" status -SC --color=always | less -SR
 ? = summary
 fdiff = diff -U 10000000000000
 
+
 # Push to the git mirror at the same time.
 pg = !"$HG" push; "$HG" push git
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stumpwm/local-share-stumpwm/522.lisp.dump	Fri Mar 15 10:07:38 2024 -0400
@@ -0,0 +1,52 @@
+#S(GDUMP
+   :NUMBER 3
+   :NAME "code"
+   :TREE (((#S(FDUMP
+               :NUMBER 0
+               :X 0
+               :Y 0
+               :WIDTH 1200
+               :HEIGHT 1020
+               :WINDOWS (31457288)
+               :CURRENT 31457288)
+            #S(FDUMP
+               :NUMBER 3
+               :X 0
+               :Y 1020
+               :WIDTH 1200
+               :HEIGHT 420
+               :WINDOWS (29360133)
+               :CURRENT 29360133))
+           ((#S(FDUMP
+                :NUMBER 1
+                :X 1200
+                :Y 0
+                :WIDTH 1735
+                :HEIGHT 1440
+                :WINDOWS (33554437)
+                :CURRENT 33554437)
+             (#S(FDUMP
+                 :NUMBER 4
+                 :X 2935
+                 :Y 0
+                 :WIDTH 985
+                 :HEIGHT 720
+                 :WINDOWS (37748741)
+                 :CURRENT 37748741)
+              #S(FDUMP
+                 :NUMBER 5
+                 :X 2935
+                 :Y 720
+                 :WIDTH 985
+                 :HEIGHT 720
+                 :WINDOWS NIL
+                 :CURRENT NIL)))
+            #S(FDUMP
+               :NUMBER 2
+               :X 3920
+               :Y 0
+               :WIDTH 1200
+               :HEIGHT 1440
+               :WINDOWS (16977044)
+               :CURRENT 16977044))))
+   :CURRENT 1)
\ No newline at end of file
--- a/vim/custom-dictionary.utf-8.add	Fri Feb 16 14:12:21 2024 -0500
+++ b/vim/custom-dictionary.utf-8.add	Fri Mar 15 10:07:38 2024 -0400
@@ -416,3 +416,15 @@
 BI545
 PIBS800
 isoforms
+gyrase
+handwave
+SNPs
+Prensner
+acetylation
+arginine
+histone
+histones
+octamer
+heterochromatin
+trimethylated
+BIOINF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/ultisnips-bullshit/README.markdown	Fri Mar 15 10:07:38 2024 -0400
@@ -0,0 +1,5 @@
+This directory would be named "snippets" like a reasonable person would
+immediately think to name it, except that UltiSnips hardcodes that one
+particular directory name and magically parses it as some other snippet format,
+which fails with an inscrutable error.  So we have to name it something else.
+Great first 30 second experience, UltiSnips.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/ultisnips-bullshit/tex.snippets	Fri Mar 15 10:07:38 2024 -0400
@@ -0,0 +1,85 @@
+global !p
+def math():
+  return vim.eval('vimtex#syntax#in_mathzone()') == '1'
+endglobal
+
+# Structure -------------------------------------------------------------------
+snippet b "An environment" b
+\begin{$1}
+    $0
+\end{$1}
+endsnippet
+
+snippet sec "\section*" b
+\section*{$1}$0
+endsnippet
+
+snippet ssec "\subsection*" b
+\subsection*{$1}$0
+endsnippet
+
+snippet desc "\begin{description}" b
+\begin{description}
+    $0
+\end{description}
+endsnippet
+
+snippet lst "\begin{lstlisting}" b
+\begin{lstlisting}
+$0
+\end{lstlisting}
+endsnippet
+
+snippet i "\item[]" b
+\item[$1]$0
+endsnippet
+
+snippet eq "Equation environment" b
+\begin{equation*}
+\begin{split}
+    $0
+\end{split}
+\end{equation*}
+endsnippet
+
+snippet jot "Set jot length (should go between equation and split envs)" b
+\setlength{\jot}{${1:10}pt}$0
+endsnippet
+
+# Markup ----------------------------------------------------------------------
+
+snippet href "The hyperref package's \href{}{} command (for url links)"
+\href{${1:url}}{${2:display name}}$0
+endsnippet
+
+snippet url "A linked URL"
+\url{${1:url}}$0
+endsnippet
+
+snippet fn "Footnote"
+\footnote{${1:Note}}$0
+endsnippet
+
+snippet em "\emph{}"
+\emph{${1:${VISUAL:}}}$0
+endsnippet
+
+# Math ------------------------------------------------------------------------
+snippet "(^|[^a-zA-Z])mm" "Inline LaTeX math" rA
+`!p snip.rv = match.group(1)`\$ ${1:${VISUAL:}} \$$0
+endsnippet
+
+context "math()"
+snippet ff "(math) \frac{}{}"
+\frac{$1}{$2}$0
+endsnippet
+
+context "math()"
+snippet rm "(math) \mathrm{}"
+\mathrm{$1}$0
+endsnippet
+
+context "math()"
+snippet __ "(math) _{}" iA
+_{ $1 }$0
+endsnippet
--- a/vim/vimrc	Fri Feb 16 14:12:21 2024 -0500
+++ b/vim/vimrc	Fri Mar 15 10:07:38 2024 -0400
@@ -1013,6 +1013,7 @@
     au!
 
     au Filetype tex inoremap <buffer> <c-b> \begin{}<left>
+    au Filetype tex nnoremap <buffer> <localleader>q :%s/[‘’]/'/<cr>
 augroup END
 
 " }}}
@@ -1284,34 +1285,49 @@
 let R_args = ['--no-save', '--quiet']
 let R_save_win_pos = 0
 let R_arrange_windows = 0
-let R_assign_map = 0
+let R_assign = 0
 let R_clear_line = 1
 let R_nvim_wd = 1
 let R_user_maps_only = 1
 let R_nvimpager = 'vertical'
 let R_help_w = 81
+let r_indent_ess_comments = 0
+let r_indent_ess_compatible = 0
+let r_indent_align_args = 0
 
 function! s:customNvimRMappings()
    " Normal Mode
-   nmap <buffer> <localleader>Or <Plug>RStart
-   nmap <buffer> <localleader>Cr <Plug>RClose
-   nmap <buffer> <localleader>c  <Plug>RClearConsole
-   nmap <buffer> <localleader>h  <Plug>RHelp
-   nmap <buffer> M               <Plug>RHelp
-   nmap <buffer> <localleader>e  <Plug>RSendParagraph
-   nmap <buffer> <localleader>E  <Plug>RSendLine
-   nmap <buffer> <localleader>f  <Plug>RSendFile
-   nmap <buffer> <localleader>i  <Plug>RViewDFv
-   nmap <buffer> <localleader>I  <Plug>RViewDFs
-   nmap <buffer> gi              <Plug>RIndent
-
-   " Visual Mode
-   vmap <buffer> <localleader>e  <Plug>RSendSelection
+    nmap <buffer> <localleader>Or <Plug>RStart
+    nmap <buffer> <localleader>Cr <Plug>RClose
+    nmap <buffer> <localleader>c  <Plug>RClearConsole
+    nmap <buffer> <localleader>h  <Plug>RHelp
+    nmap <buffer> M               <Plug>RShowArgs
+    nmap <buffer> <localleader>e  <Plug>RSendParagraph
+    nmap <buffer> <localleader>w  mzviw<Plug>RSendSelection<esc>'z
+    nmap <buffer> <localleader>W  mzviW<Plug>RSendSelection<esc>'z
+    nmap <buffer> <localleader>S  <Plug>RSendLine
+    nmap <buffer> <localleader>E  <Plug>RSendLine
+    nmap <buffer> <localleader>f  <Plug>RSendFile
+    nmap <buffer> <localleader>i  <Plug>RViewDFv
+    nmap <buffer> <localleader>I  <Plug>RViewDFs
+    nmap <buffer> gi              mzvip:Rformat<cr>'z
+
+    inoremap <buffer> <c-n> <c-x><c-o>
+
+    " Insert Mode
+    inoremap <buffer> <c-.> <esc>A \|><cr>
+    inoremap <buffer> <c-,> <-<space>
+    inoremap <buffer> <c-'> <esc>A +<cr>
+
+    " Visual Mode
+    vmap <buffer> <localleader>e  <Plug>RSendSelection
+    vmap <buffer> gi              :Rformat<cr>
 endfunction
 
 augroup ft_r
     au!
 
+    autocmd filetype r setlocal shiftwidth=2
     autocmd filetype r call s:customNvimRMappings()
 augroup END
 
@@ -1950,6 +1966,15 @@
 let g:targets_pairs = '()b {}B []r <>'
 
 " }}}
+" Ultisnips {{{
+
+let g:UltiSnipsExpandTrigger       = '<Tab>'
+let g:UltiSnipsJumpForwardTrigger  = '<Tab>'
+let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'
+
+let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/ultisnips-bullshit']
+
+" }}}
 " Vlime {{{