-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
41 lines (32 loc) · 1.14 KB
/
init.lua
File metadata and controls
41 lines (32 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- TODO: Move Keymap and configs back to lua/plugins/<plugin>.lua
-- but I would like to keep the keymaps as a separate table
-- also create a which-key register in that plugin file
-- TODO: Add total characters selected with cursor to statusbar when visually selecting string
_G.dd = function(...)
require("snacks.debug").inspect(...)
end
_G.bt = function(...)
require("snacks.debug").backtrace()
end
vim.print = dd
-- Leader keys
-- vim.keycode translates keycodes instead of strings
vim.g.mapleader = vim.keycode("<space>")
vim.g.maplocalleader = vim.keycode("\\")
-- Support only Neovim v0.11 and nightly
if vim.fn.has("nvim-0.11") ~= 1 then
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Must be using at least Neovim v0.11 to use:\n", "ErrorMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
-- Set some global variables immediently
vim.g.nushell = vim.fn.executable "nu"
vim.g.debug = false
-- Bootstrap lazy.nvim we need to make sure any thing plugin releated is
-- loaded and available for the rest of our configuration startup
require("lazy-bootstrap")