Skip to content

Commit 9014902

Browse files
committed
Initial commit
0 parents  commit 9014902

File tree

8 files changed

+542
-0
lines changed

8 files changed

+542
-0
lines changed

.github/workflows/main.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
pre-commit:
15+
name: pre-commit
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
steps:
19+
- name: Checkout the repository
20+
uses: actions/checkout@v4
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
enable-cache: true
25+
- name: Install pre-commit
26+
run: uv tool install pre-commit
27+
- name: Cache pre-commit
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pre-commit
31+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
32+
- name: Run pre-commit
33+
run: |
34+
echo '```console' > "$GITHUB_STEP_SUMMARY"
35+
pre-commit run --all-files --show-diff-on-failure --color=always | \
36+
tee >(sed -E 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})*)?[mGK]//g' >> "$GITHUB_STEP_SUMMARY") >&1
37+
exit_code="${PIPESTATUS[0]}"
38+
echo '```' >> "$GITHUB_STEP_SUMMARY"
39+
exit "$exit_code"
40+
type-check:
41+
name: type-check
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout the repository
45+
uses: actions/checkout@v4
46+
- name: Checkout neodev
47+
uses: actions/checkout@v4
48+
with:
49+
repository: folke/neodev.nvim
50+
path: deps/neodev.nvim
51+
- name: Run type-checks
52+
uses: mrcjkb/lua-typecheck-action@v1
53+
with:
54+
directories: |
55+
lua
56+
plugin
57+
configpath: .luarc.json

.luarc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3+
"Lua.runtime.version": "LuaJIT",
4+
"Lua.workspace.checkThirdParty": false,
5+
"Lua.diagnostics.globals": ["vim"],
6+
"Lua.hint.enable": true,
7+
"Lua.completion.callSnippet": "Replace"
8+
}

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-json
7+
- id: check-merge-conflict
8+
- id: check-vcs-permalinks
9+
- id: check-yaml
10+
- id: destroyed-symlinks
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
- repo: https://github.com/JohnnyMorganz/StyLua
15+
rev: v2.1.0
16+
hooks:
17+
- id: stylua
18+
- repo: https://github.com/adhtruong/mirrors-typos
19+
rev: v1.35.5
20+
hooks:
21+
- id: typos

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Tom Kusonsuphanimit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# nvim-activate
2+
3+
Displays an 'Activate Neovim' message in the bottom-right corner of the editor.
4+
5+
![Screenshot](https://raw.githubusercontent.com/tjkuson/misc-binaries/main/tjkuson/nvim-activate/screenshot.png)
6+
7+
## Installation
8+
9+
Install using your package manager of choice. Calling `require("nvim-activate").setup()` is optional (the plugin auto-initializes).
10+
11+
## Usage
12+
13+
### Commands
14+
15+
```vim
16+
:NvimActivateShow
17+
:NvimActivateHide
18+
:NvimActivateToggle
19+
```
20+
21+
### Configuration
22+
23+
```lua
24+
-- Global disable
25+
vim.g.nvimactivate_disable = true
26+
27+
-- Buffer-specific disable
28+
vim.b.nvimactivate_disable = true
29+
```
30+
31+
### Recipes
32+
33+
Hide after a delay on startup:
34+
35+
```vim
36+
autocmd VimEnter * ++once lua vim.defer_fn(function()
37+
vim.g.nvimactivate_disable = true
38+
require("nvim-activate").hide()
39+
end, 1500)
40+
```
41+
42+
```lua
43+
vim.api.nvim_create_autocmd("VimEnter", {
44+
once = true,
45+
callback = function()
46+
vim.defer_fn(function()
47+
vim.g.nvimactivate_disable = true
48+
require("nvim-activate").hide()
49+
end, 1500)
50+
end,
51+
})
52+
```
53+
54+
Hide during Insert mode, show on exit:
55+
56+
```vim
57+
autocmd InsertEnter * NvimActivateHide
58+
autocmd InsertLeave * NvimActivateShow
59+
```
60+
61+
```lua
62+
vim.api.nvim_create_autocmd("InsertEnter", {
63+
callback = function() require("nvim-activate").hide() end,
64+
})
65+
vim.api.nvim_create_autocmd("InsertLeave", {
66+
callback = function() require("nvim-activate").show() end,
67+
})
68+
```
69+
70+
Enable only in specific filetypes (when globally disabled):
71+
72+
```vim
73+
let g:nvimactivate_disable = v:true
74+
augroup NvimActivateExamples
75+
autocmd!
76+
autocmd FileType python let b:nvimactivate_disable = v:false
77+
augroup END
78+
```
79+
80+
```lua
81+
vim.g.nvimactivate_disable = true
82+
local grp = vim.api.nvim_create_augroup("NvimActivateExamples", { clear = true })
83+
vim.api.nvim_create_autocmd("FileType", {
84+
group = grp,
85+
pattern = { "python" },
86+
callback = function()
87+
vim.b.nvimactivate_disable = false
88+
end,
89+
})
90+
```

doc/nvim-activate.txt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
*nvim-activate*
2+
3+
Authors: Tom Kuson <mail@tjkuson.me>
4+
Version: NA
5+
Homepage: <https://github.com/tjkuson/nvim-activate>
6+
7+
==============================================================================
8+
INTRODUCTION *nvim-activate*
9+
10+
A plugin to display reminder the bottom-right corner of the editor to
11+
activate Neovim.
12+
13+
==============================================================================
14+
CONFIGURATION *NvimActivate.config*
15+
16+
This plugin is intentionally minimal and has no options.
17+
18+
Use autocommands to control visibility in contexts (see
19+
|nvim-activate-recipes| and |nvim-activate-setup| section notes about
20+
|vim.b.nvimactivate_disable|).
21+
22+
Note: calling |setup()| is not required to initialize the plugin.
23+
You can disable globally or per-buffer:
24+
>
25+
vim.g.nvimactivate_disable = true
26+
-- or
27+
vim.b.nvimactivate_disable = true
28+
<
29+
30+
==============================================================================
31+
COMMANDS *nvim-activate-commands*
32+
33+
The plugin provides these user commands:
34+
>
35+
:NvimActivateShow
36+
:NvimActivateHide
37+
:NvimActivateToggle
38+
<
39+
40+
==============================================================================
41+
RECIPES *nvim-activate-recipes*
42+
43+
Hide after a delay on startup:
44+
45+
Vimscript:
46+
>
47+
autocmd VimEnter * ++once lua vim.defer_fn(function()
48+
vim.g.nvimactivate_disable = true
49+
require("nvim-activate").hide()
50+
end, 1500)
51+
<
52+
53+
Lua:
54+
>
55+
vim.api.nvim_create_autocmd("VimEnter", {
56+
once = true,
57+
callback = function()
58+
vim.defer_fn(function()
59+
vim.g.nvimactivate_disable = true
60+
require("nvim-activate").hide()
61+
end, 1500)
62+
end,
63+
})
64+
<
65+
66+
Hide during Insert mode, show on exit:
67+
68+
Vimscript:
69+
>
70+
autocmd InsertEnter * NvimActivateHide
71+
autocmd InsertLeave * NvimActivateShow
72+
<
73+
74+
Lua:
75+
>
76+
vim.api.nvim_create_autocmd("InsertEnter", {
77+
callback = function() require("nvim-activate").hide() end,
78+
})
79+
vim.api.nvim_create_autocmd("InsertLeave", {
80+
callback = function() require("nvim-activate").show() end,
81+
})
82+
<
83+
84+
Enable only in specific filetypes (when globally disabled):
85+
86+
Vimscript:
87+
>
88+
let g:nvimactivate_disable = v:true
89+
augroup NvimActivateExamples
90+
autocmd!
91+
autocmd FileType lua,python let b:nvimactivate_disable = v:false
92+
augroup END
93+
<
94+
95+
Lua:
96+
>
97+
vim.g.nvimactivate_disable = true
98+
local grp = vim.api.nvim_create_augroup("NvimActivateExamples", { clear = true })
99+
vim.api.nvim_create_autocmd("FileType", {
100+
group = grp,
101+
pattern = { "lua", "python" },
102+
callback = function()
103+
vim.b.nvimactivate_disable = false
104+
end,
105+
})
106+
<
107+
------------------------------------------------------------------------------
108+
vim:tw=78:ts=8:ft=help:norl:

0 commit comments

Comments
 (0)