Skip to content

Commit 5b233ca

Browse files
committed
feat(nvim): add neovide configuration
1 parent ee547ac commit 5b233ca

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
idle = true
2+
mouse-cursor-icon = "arrow"
3+
neovim-bin = "/opt/homebrew/bin/nvim"
4+
tabs = true
5+
title-hidden = false
6+
7+
[font]
8+
normal = [
9+
"FiraCode Nerd Font",
10+
# "Hack Nerd Font",
11+
] # Will use the bundled Fira Code Nerd Font by default
12+
size = 19.0
13+
hinting = "full"
14+
edging = "antialias"
15+
16+
[box-drawing]
17+
# "font-glyph", "native" or "selected-native"
18+
mode = "native"
19+
20+
[box-drawing.sizes]
21+
default = [2, 4] # Thin and thick values respectively, for all sizes
22+
12 = [1, 2] # 12px to 13.9999px
23+
14 = [2, 4]
24+
18 = [3, 6]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
if vim.g.neovide then
2+
-- Put anything you want to happen only in Neovide here
3+
4+
-- Helper function for transparency formatting
5+
local alpha = function()
6+
return string.format("%x", math.floor(255 * vim.g.transparency or 0.8))
7+
end
8+
-- g:neovide_opacity should be 0 if you want to unify transparency of content and title bar.
9+
vim.g.neovide_opacity = 0.5
10+
vim.g.transparency = 0.9
11+
vim.g.neovide_background_color = "#0f1117" .. alpha()
12+
vim.g.neovide_show_border = true
13+
14+
-- rendering
15+
vim.g.neovide_refresh_rate = 60
16+
vim.g.neovide_refresh_rate_idle = 5
17+
vim.g.neovide_confirm_quit = true
18+
19+
-- Specyfic mapping more for visual editors
20+
vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
21+
vim.keymap.set("v", "<D-c>", '"+y') -- Copy
22+
vim.keymap.set("n", "<D-v>", '"+P') -- Paste normal mode
23+
vim.keymap.set("v", "<D-v>", '"+P') -- Paste visual mode
24+
vim.keymap.set("c", "<D-v>", "<C-R>+") -- Paste command mode
25+
vim.keymap.set("i", "<D-v>", '<ESC>l"+Pli') -- Paste insert mode
26+
27+
--
28+
29+
-- change the font dynamiacally
30+
vim.g.neovide_scale_factor = 1.0
31+
local change_scale_factor = function(delta)
32+
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
33+
end
34+
vim.keymap.set("n", "<C-=>", function()
35+
change_scale_factor(1.25)
36+
end)
37+
vim.keymap.set("n", "<C-->", function()
38+
change_scale_factor(1 / 1.25)
39+
end)
40+
end

configuration/.config/nvim/init.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ local utils = require("utils/utils")
88
local semver = require("utils/semver")
99

1010
-- check if we have the latest stable version of nvim
11-
local expected_ver = semver("0.8.0")
11+
--
12+
-- Change to v0.11 as there were some changes and deprecations in NeoVim api
13+
local expected_ver = semver("0.11.0")
1214
local nvim_ver = semver(utils.get_nvim_version())
1315

1416
if expected_ver > nvim_ver then
@@ -28,6 +30,9 @@ local core_config_files = { -- order matters
2830
-- only general mappings. plugin mappings are inside plugins
2931
"mappings.lua",
3032
"plugins.lua",
33+
34+
-- special config for neovide
35+
"neovide.lua",
3136
}
3237
for _, name in ipairs(core_config_files) do
3338
local path = string.format("%s/core/%s", vim.fn.stdpath("config"), name)

configuration/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,20 @@ go install golang.org/x/vuln/cmd/govulncheck@latest
328328
go install github.com/abenz1267/gomvp@latest
329329
```
330330

331+
## neovide
332+
333+
| type | Text Editor |
334+
| ---- | ----------- |
335+
336+
This is GUI overlay over neovim text editor.
337+
338+
Neovide - <https://neovide.dev/config-file.html>
339+
340+
```bash
341+
mkdir -p ${HOME}/.config/
342+
ln -sf ${PWD}/.config/neovide ${HOME}/.config/neovide
343+
```
344+
331345
## Ollama
332346

333347
local LLM model.

0 commit comments

Comments
 (0)