https://github.com/dan7h3x/neaterm.nvim
A little (smart maybe) terminal plugin for neovim.
https://github.com/dan7h3x/neaterm.nvim
neovim neovim-plugin terminal vim
Last synced: 4 months ago
JSON representation
A little (smart maybe) terminal plugin for neovim.
- Host: GitHub
- URL: https://github.com/dan7h3x/neaterm.nvim
- Owner: Dan7h3x
- License: gpl-3.0
- Created: 2024-10-10T11:51:30.000Z (over 1 year ago)
- Default Branch: stable
- Last Pushed: 2024-11-16T15:36:33.000Z (over 1 year ago)
- Last Synced: 2024-11-16T16:30:49.655Z (over 1 year ago)
- Topics: neovim, neovim-plugin, terminal, vim
- Language: Lua
- Homepage:
- Size: 71.3 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neaterm.nvim
A little (smart maybe) terminal plugin for neovim.
`neaterm` makes a tiling window manager inside neovim, see `demo`.
## Demo
Demo Video
A small example of using `neaterm` in neovim:

## Installation
Using `lazy.nvim` you can install the `neaterm` (stable)
with following default configuration:
```lua
{
"Dan7h3x/neaterm.nvim",
branch = "stable",
event = "VeryLazy",
opts = {
-- Your custom options here (optional)
},
dependencies = {
"nvim-lua/plenary.nvim",
"ibhagwan/fzf-lua",
},
}
```
or change the config based on what you want:
```lua
default_opts = {
-- Terminal settings
shell = vim.o.shell,
float_width = 0.5,
float_height = 0.4,
move_amount = 3,
resize_amount = 2,
border = 'rounded',
-- Appearance
highlights = {
normal = 'Normal',
border = 'FloatBorder',
title = 'Title',
},
-- Window management
min_width = 20,
min_height = 3,
-- custom terminals
terminals = {
ranger = {
name = "Ranger",
cmd = "ranger",
type = "float",
float_width = 0.8,
float_height = 0.8,
keymaps = {
quit = "q",
select = "",
preview = "p",
},
on_exit = function(selected_file)
if selected_file then
vim.cmd('edit ' .. selected_file)
end
end
},
lazygit = {
name = "LazyGit",
cmd = "lazygit",
type = "float",
float_width = 0.9,
float_height = 0.9,
keymaps = {
quit = "q",
commit = "c",
push = "P",
},
},
btop = {
name = "Btop",
cmd = "btop",
type = "float",
float_width = 0.8,
float_height = 0.8,
keymaps = {
quit = "q",
help = "h",
},
},
},
-- Default keymaps
use_default_keymaps = true,
keymaps = {
toggle = '',
new_vertical = '',
new_horizontal = '',
new_float = '',
close = '',
next = '',
prev = '',
move_up = '',
move_down = '',
move_left = '',
move_right = '',
resize_up = '',
resize_down = '',
resize_left = '',
resize_right = '',
focus_bar = '',
repl_toggle = 'rt',
repl_send_line = 'rl',
repl_send_selection = 'rs',
repl_send_buffer = 'rb',
repl_clear = 'rc',
repl_history = 'rh',
repl_variables = 'rv',
repl_restart = 'rR',
},
-- REPL configurations
repl = {
float_width = 0.6,
float_height = 0.4,
save_history = true,
history_file = vim.fn.stdpath('data') .. '/neaterm_repl_history.json',
max_history = 100,
update_interval = 5000,
},
-- REPL language configurations
repl_configs = {
python = {
name = "Python (IPython)",
cmd = "ipython --no-autoindent --colors='Linux'",
startup_cmds = {
-- "import sys",
-- "sys.ps1 = 'In []: '",
-- "sys.ps2 = ' ....: '",
},
get_variables_cmd = "whos",
inspect_variable_cmd = "?",
exit_cmd = "exit()",
},
r = {
name = "R (Radian)",
cmd = "radian",
startup_cmds = {
-- "options(width = 80)",
-- "options(prompt = 'R> ')",
},
get_variables_cmd = "ls.str()",
inspect_variable_cmd = "str(",
exit_cmd = "q(save='no')",
},
lua = {
name = "Lua",
cmd = "lua",
exit_cmd = "os.exit()",
},
node = {
name = "Node.js",
cmd = "node",
get_variables_cmd = "Object.keys(global)",
exit_cmd = ".exit",
},
sh = {
name = "Shell",
cmd = vim.o.shell,
startup_cmds = {
"PS1='$ '",
"TERM=xterm-256color",
},
get_variables_cmd = "set",
inspect_variable_cmd = "echo $",
exit_cmd = "exit",
},
},
-- Terminal features
features = {
auto_insert = true,
auto_close = true,
restore_layout = true,
smart_sizing = true,
persistent_history = true,
native_search = true,
clipboard_sync = true,
shell_integration = true,
},
}
```
## Contributing
I don't how, but if you want to help me and this plugin, please contact me in `Telegram` : `@Dan7h3x` or mail me `m.jalili.barbin@gmail.com`.:)