Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ See the [ubuntu-server README](ubuntu-server/README.md) for details on the Nix c
- Shared configuration modules to eliminate duplication
- POSIX-compliant environment setup across all shells
- macOS login shell compatibility
- [inshellisense](https://github.com/microsoft/inshellisense) IDE-style inline autocomplete across all three shells (skipped in editor terminals; see [shell README](shared/.config/shell/README.md#inshellisense-ide-style-autocomplete))
- **✏️ Editors**:
- **Neovim (Kickstart)** - Default, mapped to `nvim`/`vim` commands
- **Neovim (AstroVim)** - Available via `astrovim` alias
Expand Down
6 changes: 6 additions & 0 deletions shared/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ for config_file in "$HOME/.bashrc.d/"*.sh; do
done

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"

# inshellisense autocomplete — MUST be the last command (it wraps the shell in a
# child session; keep new startup logic above this). Setup: .config/shell/README.md
if [ -f "$HOME/.inshellisense/init/bash/init.sh" ] && ! is_integrated_terminal; then
. "$HOME/.inshellisense/init/bash/init.sh"
fi
1 change: 1 addition & 0 deletions shared/.config/fish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ fisher update
- **fzf** - Fuzzy finder
- **zoxide** - Smart directory navigation
- **fisher** - Plugin manager
- **inshellisense** (`is`) - IDE-style inline autocomplete (optional; run `is init fish` to enable)

## Usage

Expand Down
6 changes: 6 additions & 0 deletions shared/.config/fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ for config_file in ~/.config/fish/config.*.fish
source $config_file
end
end

# inshellisense autocomplete — MUST be the last command (it wraps the shell in a
# child session; keep new startup logic above this). Setup: .config/shell/README.md
if status is-interactive; and test -f ~/.inshellisense/init/fish/init.fish; and not is_integrated_terminal
source ~/.inshellisense/init/fish/init.fish
end
2 changes: 1 addition & 1 deletion shared/.config/nix-darwin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This configuration manages macOS systems declaratively using Nix, providing:

### Nix Packages (System-wide)
- **Development**: `neovim`, `gh`, `lazygit`, `ripgrep`, `fd`
- **Shell**: `fish`, `zellij`, `tmux`, `fzf`, `zoxide`, `atuin`
- **Shell**: `fish`, `zellij`, `tmux`, `fzf`, `zoxide`, `atuin`, `inshellisense`
- **Tools**: `stow`, `oh-my-posh`, `volta`, `asdf-vm`
- **AI**: `claude-code`, `codex`

Expand Down
1 change: 1 addition & 0 deletions shared/.config/nix-darwin/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
git
gofumpt
gum
inshellisense
lazygit
neovim
nil
Expand Down
41 changes: 41 additions & 0 deletions shared/.config/shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,47 @@ The `shared/` profile establishes each `.d/` directory (with a `.gitkeep`). The

This complements the existing `.config/shell/` pattern (`aliases.*.sh`, `exports.*.sh`, `functions.*.sh`) for cases where profile-specific logic needs to live in the root init files rather than the shared shell config directory.

## inshellisense (IDE-style autocomplete)

[inshellisense](https://github.com/microsoft/inshellisense) provides fig-like,
IDE-style inline command autocompletion for all three shells. It works by
auto-starting a session that *wraps* the interactive shell, so the integration
has a few non-obvious requirements that are baked into this repo:

- **Must be the last command.** The source line is appended to the very end of
`.bashrc`, `.zshrc`, and `fish/config.fish` (after the profile `.d/` and
`config.*.fish` loops). inshellisense recurses into a child shell guarded by
the `ISTERM` env var, so anything after it in the rc file would not run in the
outer shell. If you add new startup logic, keep it *above* this block.
- **Skipped in IDE/editor terminals.** The block is gated behind
`is_integrated_terminal`, mirroring `auto_start_tmux`, so it stays out of
VS Code / Neovim / Emacs / Zed terminals where a nested PTY is unwanted.
- **No-op until provisioned.** Each shell sources
`~/.inshellisense/init/<shell>/init.<ext>` only if that file exists. The file
is created by `is init` (see below), so shells on un-provisioned machines and
the non-interactive CI startup-time harness are unaffected.

### Installing / enabling

The `is` binary is declared for macOS in
`shared/.config/nix-darwin/darwin.nix` (`environment.systemPackages`). On
Ubuntu / remote sandboxes install it via npm:

```sh
npm install -g @microsoft/inshellisense
```

Then generate the per-shell init files once (regenerate after upgrades):

```sh
is init # detects the current shell, or pass bash|zsh|fish
```

`is init` writes `~/.inshellisense/init/<shell>/init.<ext>`, which the rc files
already source. No changes to the rc files themselves are needed — do **not**
run `is init <shell> >> ~/.<shell>rc` (the upstream instructions), as that would
duplicate the source line this repo already manages. Run `is doctor` to verify.

## Benefits

1. **No duplication**: Shared configuration is centralized
Expand Down
6 changes: 6 additions & 0 deletions shared/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,9 @@ for config_file in "$HOME/.zshrc.d/"*.sh; do
. "$config_file"
fi
done

# inshellisense autocomplete — MUST be the last command (it wraps the shell in a
# child session; keep new startup logic above this). Setup: .config/shell/README.md
if [[ -f "$HOME/.inshellisense/init/zsh/init.zsh" ]] && ! is_integrated_terminal; then
. "$HOME/.inshellisense/init/zsh/init.zsh"
fi
Loading