Commit graph

46 commits

Author SHA1 Message Date
Devansh Sharma
81ea9f71a3
feat: add name param to ToggleTerm and TermExec (#479) 2023-09-11 08:46:23 +02:00
Akin
c8574d7a7d
feat: add a terminal select command (#429) 2023-04-24 19:34:48 +01:00
Jakub Kaczor
a7857b6cbf
feat(config): allow shell parameter to be a function (#423)
Co-authored-by: Jakub Kaczor <jakub@jakubkaczor.com>
2023-04-09 18:27:49 +01:00
Akin Sowemimo
dab339b730 test(terminal): ignore flaky test for now
classic...
2023-03-31 19:49:15 +01:00
Akin Sowemimo
50f58a0624 ci(tests): use minimal init.lua for tests 2023-03-25 22:21:44 +00:00
Akin Sowemimo
94986c39c0 tests(terminal): skip flaky test 2023-03-12 18:17:52 +00:00
Akin Sowemimo
fd63194901 test(terminal): increase wait time for flaky test 2023-03-11 15:28:54 +00:00
Akin Sowemimo
a104063215 tests(terminal): fix broken test
There is no need to assert the first argument of the method which is the
terminal itself only that the real arguments are correct
2023-03-11 15:24:08 +00:00
Stevan Milic
a5638b2206
feat: restore terminal view on smart toggle (#399)
A continuation of #397 where the idea is taken a bit further, and a complete terminal view is being toggled instead of just the last toggled terminal. When working with the terminals you often want to save your complete view that you've been working on, instead of just closing terminals one by one, and opening them up (again) one by one. There's already a utility mapping that let's you open and close all of your terminals, but this doesn't take into consideration what was previously opened. Therefore to make smart_toggle even smarter we could save the current terminal view, and then open it up the next time it is triggered.

In order to achieve this functionality we could keep a list of terminals that were closed, and use it to go over the list to open them on next smart toggle.
2023-02-20 17:36:22 +00:00
Stevan Milic
42438b3042
feat: open last toggled term on smart toggle (#397) 2023-02-17 12:16:53 +00:00
Akin Sowemimo
cd3b4d6711 refactor(terminal): ensure correct filetype is set 2022-08-30 11:47:39 +01:00
Akin Sowemimo
d148057ff4 test(state): disable mode preservation test cases
vim state is not changing as expected inside the test case
2022-08-13 19:51:59 +01:00
Akin Sowemimo
41c70858fd refactor(commandline): consolidate modules
commandline completion and commandline parsing are similar conceptually
and do not need to be handled in different modules
2022-08-02 12:06:15 +01:00
Akin
9150581633
feat(toggleterm): add a simple winbar to show terminal data (#229)
* feat(toggleterm): add a simple winbar to show terminal data

* refactor(ui): use win set value

* refactor(ui): improve winbar styling and toggleability

* chore(lsp): update emmy annotations

* fix(toggleterm): toggle terminals on click

* chore(lsp): more Emmy lua fixes

* ci(test): target nvim nightly

* fix(ui): allow opening the first terminal if no id

* docs(README): add mention of winbar and config

* chore(ci): auto generate docs

* fix(toggleterm): revert unnecessary ID changes

Co-authored-by: akinsho <akinsho@users.noreply.github.com>
2022-07-15 11:01:43 +01:00
Akin Sowemimo
1a8b330d3d style(stylua): reformat project
use collapse simple statement
2022-07-10 19:11:33 +02:00
David Mejorado
b8bb778192
feat: add command completion to TermExec and ToggleTerm (#256) 2022-07-05 08:48:23 +01:00
Akin
ce755e3a07
feat: persist terminal mode (#245)
* style(toggleterm): format with stylua

* fix(terminal): correctly annotate lazy requires

* feat(terminals): save the current terminals mode into state

* test: add failing state tests

* refactor(config): add option to control persisting mode

so users can turn it off or on

* docs(README): add persist mode

* chore(ci): auto generate docs

* refactor(terminal): simplify matching for modes

Only "nt" and "t" are actually relevant not all the variants of all the
other different modes

* test: add but skip failing test case

seems to be broken due to delays starting a shell

Co-authored-by: akinsho <akinsho@users.noreply.github.com>
2022-06-17 09:50:52 +01:00
nesqi
aaeed9e021
fix(next_id): Terminal IDs should be unique. (#240)
Simplified next_id() by removing the 'ids' table and calling
get_all() instead. The previous implementation did not always
produce unique IDs.

Remodelled the next_id test case by creating actuall terminals.

Before this patch, if you created 3 terminals with ID 1, 2, 3
and then closed the first terminal with id 1 using "exit",
the next_id was calculated to 2, resulting in a duplicate ID.
2022-06-12 06:57:16 +01:00
Akin
c525442a03
fix(colors): apply terminal highlights more consistently (#231)
* If a user specifies highlights, these should actually be applied consistently
* If they specify shading terminal, this overrides any normal highlights and applies the shaded colours
* if the colorscheme changes, pick up on it and re-apply highlights
2022-05-22 17:35:35 +01:00
Akin Sowemimo
775c88036b chore(sumneko): specify optional parameters 2022-05-22 16:00:35 +02:00
Jędrzej Boczar
bcc3d138b3
Option to pass env/clear_env to jobstart (#221)
* feat: add option to pass env/clear_env to jobstart()

* test: add tests for :spawn() and for term.env
2022-05-06 09:07:32 +02:00
Akin
e62008fe58
fix(config): config.highlights should respect prefs (#197) 2022-04-07 10:22:52 +01:00
Akin
b525f7e331
test: fix broken CI tests (#194) 2022-04-06 15:08:41 +01:00
Pedro Castro
37b2527b4c
feat(highlights): allow adding custom highlights (#166)
Co-authored-by: Akin Sowemimo <akin.sowemimo@gmail.com>
2022-04-06 13:52:57 +01:00
Akin Sowemimo
6332949554 test: disable more flaky tests 2022-02-26 20:14:11 +00:00
Akin Sowemimo
d6e6fe1c07 test: disable failing test
for some reason trying to open a terminal with a custom command no
longer works in CI. Seems to be exclusive to linux. Which is fun...
2022-02-26 20:08:31 +00:00
Yuri Pieters
882489f4eb
feat: add terminal_mappings option (#149)
Add a separate config option to allow mapping terminal mode separately from insert mode. This means insert mode can be disabled whilst still allowing open mappings to work whilst input in a terminal
2022-01-25 08:41:01 +00:00
Akin Sowemimo
ff168c8218 refactor: re-use toggle_all name 2021-11-15 19:46:50 +00:00
Hexin
08744f8bd4
feat: support sending commands without opening window (#87) 2021-08-20 19:45:25 +01:00
zeertzjq
c80b9c67cc
refactor: support dynamic window direction (#71)
Co-authored-by: Akin Sowemimo <akin.sowemimo@gmail.com>
2021-07-28 20:53:13 +01:00
Akin Sowemimo
1adb2c8288 test: add test case to ensure double quotes works
for TermExec
2021-06-20 16:08:46 +01:00
Akin
0ea3484566
feat: add ToggleTerm{Open|Close}All commands (#49) 2021-06-06 14:54:00 +01:00
Akin Sowemimo
53134b08a5 fix(exec): don't presume that the start id is 1
since custom terminals have ids it is no longer valid to presume the
start id for terminals is 1
2021-06-01 17:39:13 +01:00
Akin Sowemimo
de19886b5b test: add cases to cover insert_mappings 2021-05-31 21:33:09 +01:00
Akin
e380507b2f
feature/improve id allocation for terminals (#47) 2021-05-31 19:53:33 +01:00
Akin Sowemimo
8cafb2c021 fix: use resolve size when resizing a split 2021-05-19 20:03:55 +01:00
Akin Sowemimo
f157bd7bed test: fix variable shadowing warning 2021-05-18 22:54:19 +01:00
Luke Kershaw
be8e880209
Add option to give a function for the size (#40) 2021-05-16 22:45:39 +01:00
Akin Sowemimo
5d7b24ecf9 fix: allow specifying size and cmd for TermExec
e.g. TermExec cmd='ls %' size=40
this was broken due to confusing lua pattern stuff 😭
there are undoubtedly more edge cases
2021-05-16 22:41:22 +01:00
Akin
5bf694fce5
feat: allow expanding vim wildcards in cmd (#38) 2021-05-11 08:32:07 +01:00
Akin Sowemimo
9cce85daa3 test: convert new case to pending 2021-05-01 14:38:04 +01:00
Akin
1a52426c2f
feat: add close on exit (#32) 2021-05-01 14:30:35 +01:00
Akin
715f7006bb
feature/custom-terms (#29) 2021-04-28 18:35:44 +01:00
Akin
5bb328f139
feature: add "float" display option (#23) 2021-04-19 22:30:49 +01:00
Akin Sowemimo
9a06512448 style: format with stylua 2021-04-15 22:44:19 +01:00
Akin
232ff8a196
Refactor: Create terminal class API (#21) 2021-04-13 22:23:16 +01:00