A powerful Unix-like shell written entirely in Lua with zsh-inspired features, Catppuccin Mocha theming, and modern shell capabilities.
Note
this shell will be later added to neovim config by @ijadux2 in plugins branch sharingan.nvim
- Zsh-style Prompt - Customizable with escape sequences (%n, %m, %~, %g)
- Git Integration - Automatic git branch, dirty status, and ahead/behind indicators
- Right Prompt (RPROMPT) - Display time or other info on the right
- Zsh Globbing - Support for
**/*.luarecursive patterns - Word Modifiers -
%:h,%:t,%:r,%:e,%:pmodifiers - Global Aliases - Expand anywhere in command (e.g.,
G = "| grep")
- Syntax Highlighting - Color commands/arguments as you type
- Auto-suggestions - Greyed-out suggestions from history
- Fuzzy Tab Completion - Fzf-style completion matching
- Auto-cd - Type directory name to cd into it
- Directory Stack - pushd/popd/dirs support
- Job Control - Background jobs with fg/bg
- History Expansion -
!,!!,!pattern,!n - Better Error Messages - Suggests corrections for typos
- Enhanced export - Like zsh, lists sorted variables with colors
- path command - Manage PATH easily (
path add,path remove) - Variable Expansion -
$VAR,${VAR}with shell and environment variables - Command Substitution -
$(cmd)and backticks - Arithmetic Expansion -
$((expr))
- Catppuccin Mocha Theme - Beautiful color scheme
- Tab Completion - Commands, aliases, and file paths
- Colored Output - Syntax highlighting for better readability
- TUI App Support - Works with vim, nvim, less, htop, etc.
- Lua 5.1 or later
- Optional: luajit (for better performance)
- Optional: luafilesystem (lfs) - for native directory handling
- Optional: linenoise - for tab completion support
# Install linenoise for tab completion
luarocks --local install linenoise
# Install luafilesystem for better cd support (optional)
luarocks --local install luafilesystem- Clone or download this repository
- Copy the example config file to your home directory:
cp .shell.toml ~/.shell.toml # or use .shell.yaml, .shell.conf, etc.
- Make the script executable:
chmod +x neoshell.lua
Run the shell:
./neoshell.lua
# or
lua neoshell.luaNeoshell supports multiple configuration file formats (checked in order):
~/.shell.toml- TOML format (recommended)~/.shell.yamlor~/.shell.yml- YAML format~/.shell.json- JSON format~/.shell.confor~/.shellrc- INI format~/.neoshell- Original Lua format (backward compatible)
# Prompt configuration
prompt = "%n@%m %~ %g$ "
rprompt = "%t" # Right prompt showing time
# Theme settings
colors = true
[theme]
base = "#b4befe"
# Syntax highlighting colors
[syntax_colors]
command = "green"
argument = "text"
string = "yellow"
variable = "pink"
comment = "overlay0"
error = "red"
suggestion = "overlay0"
# Feature toggles
syntax_highlighting = true
auto_suggestions = true
fuzzy_completion = true
auto_cd = true
# Shell options
history_file = "~/.neoshell_history"
history_size = 500
# CD search path
cdpath = [".", "..", "~"]
# Aliases
[aliases]
ll = "ls -la"
la = "ls -a"
l = "ls -l"
home = "cd ~"
back = "cd -"
gs = "git status"
ga = "git add"
gc = "git commit"
gp = "git push"
# Global aliases (expand anywhere in command)
[global_aliases]
G = "| grep"
L = "| less"
H = "| head"
T = "| tail"prompt: "%n@%m %~ %g$ "
rprompt: "%t"
colors: true
aliases:
ll: "ls -la"
la: "ls -a"
gs: "git status"
global_aliases:
G: "| grep"
L: "| less"
syntax_highlighting: true
auto_suggestions: true
fuzzy_completion: true
auto_cd: trueprompt = %n@%m %~ %g$
rprompt = %t
colors = true
syntax_highlighting = true
auto_suggestions = true
[aliases]
ll = ls -la
la = ls -a
gs = git status
[global_aliases]
G = | grep
L = | less
[theme]
base = #b4befe
[syntax_colors]
command = green
argument = text
variable = pink| Sequence | Description |
|---|---|
%%n |
Username |
%%m |
Hostname (machine) |
%%~ |
Current directory (shortened, shows ~ for home) |
%%g |
Git branch (if in git repo) |
%%t |
Current time (HH:MM) |
%%# |
# for root, $ for user |
%%% |
Literal percent sign |
cd [dir]- Change directory (supports~,-, auto-cd)pwd- Print working directorypushd [dir]- Push directory to stack and cdpopd- Pop directory from stackdirs- Display directory stackexit [n]- Exit shell with optional exit codeecho [args]- Print argumentsprintf [fmt]- Printf-like outputtest [expr]- Test expressionexport [var[=val]]- Set/display environment variablesalias [name=cmd]- Define/list aliasesunalias [name]- Remove aliaspath- Display PATH directoriespath add /dir- Add directory to PATHpath remove /dir- Remove directory from PATHsource [file]- Execute commands from fileset [var=val]- Set/list shell variablesunset [var]- Unset shell variabletype [cmd]- Show command typejobs- List background jobsfg [job]- Bring job to foregroundbg [job]- Resume job in backgroundhelp- Show help message
Commands and arguments are highlighted in real-time as you type:
- Commands - Green
- Arguments - Default text color
- Strings - Yellow
- Variables - Pink
- Errors - Red
Type a few characters and see grey suggestions from your history. Accept with right arrow or End key.
Tab completion uses fuzzy matching:
vimmatchesnvim,vimdiff,gvimgcmatchesgit commit,git checkout
*.txt- Match all .txt files**/*.lua- Recursively find all .lua filessrc/**/test_*.py- Find test files in any subdirectory
After history expansion or variable expansion:
%:h- Head (directory part)%:t- Tail (filename only)%:r- Remove extension%:e- Extension only%:p- Full path
!!- Last command!n- Command number n!pattern- Last command starting with pattern!$- Last argument
jadu@localhost ~ (main)* $ ls
neoshell.lua .shell.toml README.md
jadu@localhost ~ (main)* $ cd src
jadu@localhost ~/src (main)* $ vim
[opens vim...]
jadu@localhost ~/src (main)* $ gs
On branch main
Your branch is ahead of 'origin/main' by 2 commits.
Changes not staged for commit:
modified: neoshell.lua
jadu@localhost ~/src (main)*↑2* $ path add ~/.local/bin
1 /home/jadu/.local/bin
2 /usr/local/bin
...
jadu@localhost ~/src (main)*↑2* $ export EDITOR=vim
export EDITOR="vim"
jadu@localhost ~/src (main)*↑2* $ !!
export EDITOR="vim"
jadu@localhost ~/src (main)*↑2* $ echo $EDITOR
vim
jadu@localhost ~/src (main)*↑2* $ ls **/*.lua
neoshell.lua test/test_helper.lua
jadu@localhost ~/src (main)*↑2* $ echo %:h
/home/jadu/src
jadu@localhost ~/src (main)*↑2* $ exit
MIT License