fix: local and global declarations
This commit is contained in:
parent
694b9d4024
commit
9c2569e575
@ -4,6 +4,7 @@
|
|||||||
-- Description : neovim configuration file
|
-- Description : neovim configuration file
|
||||||
|
|
||||||
require("globals") -- ./lua/globals.lua
|
require("globals") -- ./lua/globals.lua
|
||||||
|
require("utils") -- ./lua/utils.lua
|
||||||
require("settings") -- ./lua/settings.lua
|
require("settings") -- ./lua/settings.lua
|
||||||
require("plugins") -- ./lua/plugins.lua
|
require("plugins") -- ./lua/plugins.lua
|
||||||
require("maps") -- ./lua/maps.lua
|
require("maps") -- ./lua/maps.lua
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
globals = {
|
-- Author : swytch
|
||||||
|
-- Created : Friday May 21, 2021 22:26:24 CET
|
||||||
|
-- License : GPLv3
|
||||||
|
-- Description : neovim global variables file
|
||||||
|
|
||||||
|
local M = {} -- The module to export
|
||||||
|
|
||||||
|
M = {
|
||||||
lsp_path = vim.fn.stdpath("data").. "/lsp",
|
lsp_path = vim.fn.stdpath("data").. "/lsp",
|
||||||
|
|
||||||
-- misc
|
-- misc
|
||||||
@ -7,3 +14,8 @@ globals = {
|
|||||||
sign_hint = "",
|
sign_hint = "",
|
||||||
sign_info = "",
|
sign_info = "",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Make it accessible everywhere
|
||||||
|
_G.globals = M
|
||||||
|
-- Export the module
|
||||||
|
return M
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
-- License : GPLv3
|
-- License : GPLv3
|
||||||
-- Description : neovim mappings file
|
-- Description : neovim mappings file
|
||||||
|
|
||||||
utils = require("utils")
|
|
||||||
|
|
||||||
utils.map("n", "<space>", "<leader>")
|
utils.map("n", "<space>", "<leader>")
|
||||||
utils.map("n", "<leader>j", "<cmd>bn<CR>")
|
utils.map("n", "<leader>j", "<cmd>bn<CR>")
|
||||||
utils.map("n", "<leader>k", "<cmd>bp<CR>")
|
utils.map("n", "<leader>k", "<cmd>bp<CR>")
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
-- License : GPLv3
|
-- License : GPLv3
|
||||||
-- Description : neovim settings file
|
-- Description : neovim settings file
|
||||||
|
|
||||||
utils = require("utils")
|
|
||||||
|
|
||||||
local g = vim.g
|
local g = vim.g
|
||||||
|
|
||||||
local o = vim.o
|
local o = vim.o
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
local function gen_section(hl_string, items)
|
local function gen_section(hl_string, items)
|
||||||
out = ""
|
local out = ""
|
||||||
for _, item in pairs(items) do
|
for _, item in pairs(items) do
|
||||||
if item ~= "" then
|
if item ~= "" then
|
||||||
out = out .. " " .. item
|
out = out .. " " .. item
|
||||||
@ -134,7 +134,7 @@ end
|
|||||||
|
|
||||||
local function spell_check()
|
local function spell_check()
|
||||||
if vim.wo.spell then
|
if vim.wo.spell then
|
||||||
lang = vim.o.spelllang
|
local lang = vim.o.spelllang
|
||||||
return "[SPELL=" .. lang .. "]"
|
return "[SPELL=" .. lang .. "]"
|
||||||
else
|
else
|
||||||
return ""
|
return ""
|
||||||
@ -204,7 +204,7 @@ local function statusline_not_focused()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function gen_statusline()
|
function _G.gen_statusline()
|
||||||
if vim.g.statusline_winid == vim.fn.win_getid() then
|
if vim.g.statusline_winid == vim.fn.win_getid() then
|
||||||
return statusline_focused()
|
return statusline_focused()
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user