feat(sh): add capf completion in shell scripts

For corfu (and non-lsp) users, primarily.
This commit is contained in:
Henrik Lissner
2025-04-24 21:51:38 -04:00
parent 61f69ca980
commit 795708c116
2 changed files with 15 additions and 2 deletions

View File

@ -72,6 +72,7 @@
;; autoclose backticks
(sp-local-pair 'sh-mode "`" "`" :unless '(sp-point-before-word-p sp-point-before-same-p)))
(use-package! company-shell
:when (modulep! :completion company)
:unless (modulep! +lsp)
@ -83,6 +84,15 @@
company-shell-dont-fetch-meta (featurep :system 'macos)))
(use-package! bash-completion
:when (modulep! :completion corfu)
:unless (modulep! +lsp)
:init
(add-hook! 'sh-mode-hook
(add-hook 'completion-at-point-functions
#'bash-completion-capf-nonexclusive nil t)))
(use-package! powershell
:when (modulep! +powershell)
:defer t

View File

@ -1,8 +1,11 @@
;; -*- no-byte-compile: t; -*-
;;; lang/sh/packages.el
(when (modulep! :completion company)
(package! company-shell :pin "5f959a63a6e66eb0cbdac3168cad523a62cc2ccd"))
(unless (modulep! +lsp)
(when (modulep! :completion company)
(package! company-shell :pin "5f959a63a6e66eb0cbdac3168cad523a62cc2ccd"))
(when (modulep! :completion corfu)
(package! bash-completion :pin "a4c8fbc90221b01d5376ad068d3640350d9130a8")))
(when (modulep! +fish)
(package! fish-mode :pin "2526b1803b58cf145bc70ff6ce2adb3f6c246f89"))