adding some tweaks to eglot and cape and tempel
This commit is contained in:
		
							parent
							
								
									03d4799f01
								
							
						
					
					
						commit
						9155495918
					
				
					 3 changed files with 54 additions and 0 deletions
				
			
		
							
								
								
									
										16
									
								
								README.org
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								README.org
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -3358,6 +3358,7 @@ I'd like to start learning and using rust if I can.
 | 
			
		|||
  (setq rustic-format-on-save t
 | 
			
		||||
        rustic-lsp-client 'eglot
 | 
			
		||||
        rustic-clippy-arguments "-- -W clippy::pedantic")
 | 
			
		||||
  (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
 | 
			
		||||
  :general
 | 
			
		||||
  (general-def 'normal rustic-mode-map
 | 
			
		||||
    "!" 'rustic-run-shell-command
 | 
			
		||||
| 
						 | 
				
			
			@ -3481,6 +3482,17 @@ Let's give eglot a try.
 | 
			
		|||
  (rust-mode . eglot-ensure)
 | 
			
		||||
  (rustic-mode . eglot-ensure)
 | 
			
		||||
  (rust-ts-mode . eglot-ensure)
 | 
			
		||||
  :config
 | 
			
		||||
  
 | 
			
		||||
  (defun chris/eglot-capf ()
 | 
			
		||||
    (setq-local completion-at-point-functions
 | 
			
		||||
                (list (cape-capf-super
 | 
			
		||||
                       #'eglot-completion-at-point
 | 
			
		||||
                       #'tempel-expand
 | 
			
		||||
                       #'cape-file))))
 | 
			
		||||
 | 
			
		||||
  (add-hook 'eglot-managed-mode-hook #'chris/eglot-capf)
 | 
			
		||||
 | 
			
		||||
  :general
 | 
			
		||||
  (general-def 'normal eglot-mode-map
 | 
			
		||||
    "ga" 'eglot-code-actions
 | 
			
		||||
| 
						 | 
				
			
			@ -3715,6 +3727,10 @@ I'm making a small function in here to open files in the appropriate program usi
 | 
			
		|||
    :keymaps 'override
 | 
			
		||||
    "od" '(dired-jump :which-key "open dired here")
 | 
			
		||||
    "oD" '(dired :which-key "open dired select"))
 | 
			
		||||
  (chris/leader-keys
 | 
			
		||||
    :states 'normal
 | 
			
		||||
    :keymaps 'override
 | 
			
		||||
    "sF" '(fd-dired :which-key "search in directory with fd"))
 | 
			
		||||
  ('normal dired-mode-map
 | 
			
		||||
    "q" 'kill-this-buffer
 | 
			
		||||
    "C-<return>" 'chris/dired-open-xdg
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										16
									
								
								init.el
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								init.el
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2449,6 +2449,7 @@ targets."
 | 
			
		|||
  (setq rustic-format-on-save t
 | 
			
		||||
        rustic-lsp-client 'eglot
 | 
			
		||||
        rustic-clippy-arguments "-- -W clippy::pedantic")
 | 
			
		||||
  (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
 | 
			
		||||
  :general
 | 
			
		||||
  (general-def 'normal rustic-mode-map
 | 
			
		||||
    "!" 'rustic-run-shell-command
 | 
			
		||||
| 
						 | 
				
			
			@ -2510,6 +2511,17 @@ targets."
 | 
			
		|||
  (rust-mode . eglot-ensure)
 | 
			
		||||
  (rustic-mode . eglot-ensure)
 | 
			
		||||
  (rust-ts-mode . eglot-ensure)
 | 
			
		||||
  :config
 | 
			
		||||
  
 | 
			
		||||
  (defun chris/eglot-capf ()
 | 
			
		||||
    (setq-local completion-at-point-functions
 | 
			
		||||
                (list (cape-capf-super
 | 
			
		||||
                       #'eglot-completion-at-point
 | 
			
		||||
                       #'tempel-expand
 | 
			
		||||
                       #'cape-file))))
 | 
			
		||||
 | 
			
		||||
  (add-hook 'eglot-managed-mode-hook #'chris/eglot-capf)
 | 
			
		||||
 | 
			
		||||
  :general
 | 
			
		||||
  (general-def 'normal eglot-mode-map
 | 
			
		||||
    "ga" 'eglot-code-actions
 | 
			
		||||
| 
						 | 
				
			
			@ -2656,6 +2668,10 @@ targets."
 | 
			
		|||
    :keymaps 'override
 | 
			
		||||
    "od" '(dired-jump :which-key "open dired here")
 | 
			
		||||
    "oD" '(dired :which-key "open dired select"))
 | 
			
		||||
  (chris/leader-keys
 | 
			
		||||
    :states 'normal
 | 
			
		||||
    :keymaps 'override
 | 
			
		||||
    "sF" '(fd-dired :which-key "search in directory with fd"))
 | 
			
		||||
  ('normal dired-mode-map
 | 
			
		||||
    "q" 'kill-this-buffer
 | 
			
		||||
    "C-<return>" 'chris/dired-open-xdg
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										22
									
								
								templates
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								templates
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -178,3 +178,25 @@ nix-mode
 | 
			
		|||
ledger-mode
 | 
			
		||||
 | 
			
		||||
(contribution "2023-10-01 Contributions" n> "Income:Supporters:" (p "supporter") > n> "Assets:Core")
 | 
			
		||||
 | 
			
		||||
rustic-mode rust-mode rust-ts-mode
 | 
			
		||||
 | 
			
		||||
(if "if " p " {" n> q n> "}" q)
 | 
			
		||||
 | 
			
		||||
(el "if " p " {" n> p n> "} else {" n> p n> "}" q)
 | 
			
		||||
 | 
			
		||||
(elif "if " p " {" n> p n> "} else if " p " {" n> p n> "}" q)
 | 
			
		||||
 | 
			
		||||
(fn "fn " p "(" p ") {" n> p n "}" q)
 | 
			
		||||
 | 
			
		||||
(fnr "fn " p "(" p ") -> " p " {" n> p n "}" q)
 | 
			
		||||
 | 
			
		||||
(crt "extern crate " q ";")
 | 
			
		||||
 | 
			
		||||
(drv & "#[derive(" p ")]" q)
 | 
			
		||||
 | 
			
		||||
(d "dbg!(" p ")" q)
 | 
			
		||||
 | 
			
		||||
(lp "loop {" n> q n> "}" q)
 | 
			
		||||
 | 
			
		||||
(imd "impl Default for " p " {" n>  n> "}")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue