41849d4b8593

More
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 28 Nov 2023 16:23:43 -0500
parents b09db0d33e13
children e80a2a4ea7cd
branches/tags (none)
files fish/config.fish stumpwmrc vim/custom-dictionary.utf-8.add vim/vimrc

Changes

--- a/fish/config.fish	Tue Nov 14 09:58:32 2023 -0500
+++ b/fish/config.fish	Tue Nov 28 16:23:43 2023 -0500
@@ -14,6 +14,7 @@
 function eff; nvim ~/.config/fish/functions; end
 function efh; nvim ~/.local/share/fish/fish_history; end # I have visited https://github.com/fish-shell/fish-shell/issues/862 nine thousand times and I'm fucking sick of opening a web browser to figure out where the fuck fish keeps its equivalent of ~/.bash_history
 function essh; nvim ~/.ssh/config; end
+function est; nvim ~/Sync/school/TODO; end
 
 function js; cd ~/scratch; end
 function jd; cd /dump; end
--- a/stumpwmrc	Tue Nov 14 09:58:32 2023 -0500
+++ b/stumpwmrc	Tue Nov 28 16:23:43 2023 -0500
@@ -330,8 +330,8 @@
 (defun set-brightness (value)
   (run-and-echo-shell-command
     (hostcase
-      ((:gro) (format nil "xrandr --output ~A --brightness ~D"
-                      (hostcase (:gro "eDP"))
+      ((:gro :juss) (format nil "xrandr --output ~A --brightness ~D"
+                      (hostcase ((:gro :juss) "eDP"))
                       (/ value 100.0)))
       (t (message "Not sure how to set brightness on this machine.")))))
 
@@ -391,23 +391,25 @@
 (defcommand screen-laptop () ()
   (only)
   (hostcase
-    ((:gro) (loop :with laptop = "eDP"
-                  :with extern = "DisplayPort-0"
-                  :for (output commands) :in `((,laptop ("--auto"))
-                                               (,laptop ("--primary"))
-                                               (,extern ("--off")))
-                  :do (progn (uiop:run-program `("xrandr" "--output" ,output ,@commands)))))
+    ((:gro :juss) (loop :with laptop = "eDP"
+                        :with extern = (hostcase (:gro "DisplayPort-0")
+                                                 (:juss "DisplayPort-1"))
+                        :for (output commands) :in `((,laptop ("--auto"))
+                                                     (,laptop ("--primary"))
+                                                     (,extern ("--off")))
+                        :do (progn (uiop:run-program `("xrandr" "--output" ,output ,@commands)))))
     (t (message "Not configured on this system."))))
 
 (defcommand screen-external () ()
   (only)
   (hostcase
-    ((:gro) (loop :with laptop = "eDP"
-                  :with extern = "DisplayPort-0"
-                  :for (output commands) :in `((,extern ("--auto"))
-                                               (,extern ("--primary"))
-                                               (,laptop ("--off")))
-                  :do (uiop:run-program `("xrandr" "--output" ,output ,@commands))))
+    ((:gro :juss) (loop :with laptop = "eDP"
+                        :with extern = (hostcase (:gro "DisplayPort-0")
+                                                 (:juss "DisplayPort-1"))
+                        :for (output commands) :in `((,extern ("--auto"))
+                                                     (,extern ("--primary"))
+                                                     (,laptop ("--off")))
+                        :do (uiop:run-program `("xrandr" "--output" ,output ,@commands))))
     (t (message "Not configured on this system."))))
 
 (defcommand vlime () ()
@@ -448,7 +450,7 @@
 (defcommand sleep-machine ()
     ()
   (hostcase
-    ((:gro)
+    ((:gro :juss)
      (run-shell-command "exec lock-screen")
      (run-shell-command "systemctl suspend"))
     (t (message "Not sleeping this machine for safety."))))
@@ -910,7 +912,7 @@
                         (round (? sensors "amdgpu-pci-4500"  "edge"     "temp1_input"))
                         (round (? sensors "amdgpu-pci-4500"  "junction" "temp2_input"))
                         (round (? sensors "amdgpu-pci-4500"  "mem"      "temp3_input"))))
-    (:gro (format nil "[CPU ~D°C] [GPU ~D°C]"
+    ((:gro :juss) (format nil "[CPU ~D°C] [GPU ~D°C]"
                         (round (? sensors "thinkpad-isa-0000" "CPU"  "temp1_input"))
                         (round (? sensors "amdgpu-pci-0600"   "edge" "temp1_input"))))
     (t "?")))
@@ -967,7 +969,7 @@
 
       ;; battery and brightness for laptops
       (hostcase
-        ((:gro)
+        ((:gro :juss)
          '("(B %B)"
            " (BR "
            (:eval (princ-to-string (brightness)))
--- a/vim/custom-dictionary.utf-8.add	Tue Nov 14 09:58:32 2023 -0500
+++ b/vim/custom-dictionary.utf-8.add	Tue Nov 28 16:23:43 2023 -0500
@@ -359,3 +359,6 @@
 Thinkpad
 HG545
 Lenovo
+methylation
+CpG
+thermocycler
--- a/vim/vimrc	Tue Nov 14 09:58:32 2023 -0500
+++ b/vim/vimrc	Tue Nov 28 16:23:43 2023 -0500
@@ -1205,6 +1205,38 @@
 " }}}
 " Python {{{
 
+" Helper Functions {{{
+let g:current_python_lsp_client = 0
+
+function! PythonLSPConnect() "{{{
+    if g:current_python_lsp_client == 0
+        lua vim.lsp.start_client({cmd={"nc", "127.0.0.1", "9898"}})
+        " TODO lol
+        let g:current_python_lsp_client = 1
+    endif
+endfunction "}}}
+
+function! PythonLSPAttach() "{{{
+    call PythonLSPConnect()
+    lua vim.lsp.buf_attach_client(0, 1)
+    call PythonLSPMappings()
+endfunction "}}}
+
+function! PythonLSPSig() "{{{
+    lua vim.lsp.buf.signature_help()
+    return ""
+endfunction "}}}
+
+function! PythonLSPMappings() "{{{
+    setlocal omnifunc=v:lua.vim.lsp.omnifunc
+    inoremap <buffer> <c-n>    <c-x><c-o>
+    nnoremap <buffer> <c-]>    :lua vim.lsp.buf.definition()<cr>
+    nnoremap <buffer> M        :lua vim.lsp.buf.hover()<cr>
+    inoremap <buffer> <c-m>    <c-r>=PythonLSPSig()<cr>
+endfunction "}}}
+
+" }}}
+
 augroup ft_python
     au!
 
@@ -1216,6 +1248,8 @@
     au FileType python if exists("python_space_error_highlight") | unlet python_space_error_highlight | endif
 
     au FileType python nnoremap <buffer> gi :Neoformat black<cr>zx
+
+    au FileType python nnoremap <buffer> <localleader>cc :call PythonLSPAttach()<cr>
 augroup END
 
 " }}}