From f6621cc031a22b611c584e74dd248b192a859096 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Thu, 19 Sep 2024 11:01:47 -0700 Subject: [PATCH] Remove unecessary locals --- neovim/lua/_settings.lua | 40 +++++++++++++++++++--------------------- neovim/lua/init.lua | 10 ++++------ 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/neovim/lua/_settings.lua b/neovim/lua/_settings.lua index 36e4cb7..d90534a 100644 --- a/neovim/lua/_settings.lua +++ b/neovim/lua/_settings.lua @@ -1,10 +1,8 @@ -local o = vim.o -local g = vim.g local utils = require("utils") -- Set backup on -o.backup = true -o.backupdir = table.concat({ +vim.o.backup = true +vim.o.backupdir = table.concat({ (vim.env.XDG_DATA_HOME or "") .. "/nvim/backup//", (vim.env.XDG_CONFIG_HOME or "") .. "/nvim/backup//", "~/.config/nvim/backup//", @@ -12,31 +10,31 @@ o.backupdir = table.concat({ }, ",") -- Set leader to space -g.mapleader = " " +vim.g.mapleader = " " -- Get terminal colors and unicode working, hopefully vim.cmd([[ let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" ]]) -o.termguicolors = true --- o.term = "xterm-256color" +vim.o.termguicolors = true +-- vim.o.term = "xterm-256color" -o.number = true -o.expandtab = true -o.tabstop = 4 -o.softtabstop = 4 -o.shiftwidth = 4 -o.virtualedit = "onemore" -o.scrolljump = 5 -o.scrolloff = 3 --- o.backspace = "2" +vim.o.number = true +vim.o.expandtab = true +vim.o.tabstop = 4 +vim.o.softtabstop = 4 +vim.o.shiftwidth = 4 +vim.o.virtualedit = "onemore" +vim.o.scrolljump = 5 +vim.o.scrolloff = 3 +-- vim.o.backspace = "2" --- o.mousehide = true -o.mouse = "a" +-- vim.o.mousehide = true +vim.o.mouse = "a" -- Autocomplete options -o.completeopt = "menuone,noinsert,noselect,preview" +vim.o.completeopt = "menuone,noinsert,noselect,preview" vim.api.nvim_create_autocmd({ "CompleteDone" }, { pattern = "*", command = "if pumvisible() == 0 | pclose | endif", @@ -44,8 +42,8 @@ vim.api.nvim_create_autocmd({ "CompleteDone" }, { }) local has = vim.fn.has -g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil) -g.is_gui = vim.fn.exists("g:neovide") +vim.g.is_mac = (has("mac") or has("macunix") or has("gui_macvim") or vim.fn.system("uname"):find("^darwin") ~= nil) +vim.g.is_gui = vim.fn.exists("g:neovide") -- Require some local values utils.require_with_local("variables") diff --git a/neovim/lua/init.lua b/neovim/lua/init.lua index f038683..c6d5e74 100644 --- a/neovim/lua/init.lua +++ b/neovim/lua/init.lua @@ -2,20 +2,18 @@ if vim.fn.has("nvim-0.9.0") ~= 1 then print("ERROR: Requires nvim >= 0.9.0") end -local o = vim.o - -- Helpers require("_settings") require("_bindings") -- Use better grep programs if vim.fn.executable("rg") == 1 then - o.grepprg = "rg --vimgrep --no-heading --color=never" - o.grepformat = "%f:%l:%c:%m,%f:%l:%m" + vim.o.grepprg = "rg --vimgrep --no-heading --color=never" + vim.o.grepformat = "%f:%l:%c:%m,%f:%l:%m" elseif vim.fn.executable("ag") == 1 then - o.grepprg = "ag --vimgrep --nogroup --nocolor" + vim.o.grepprg = "ag --vimgrep --nogroup --nocolor" elseif vim.fn.executable("ack") == 1 then - o.grepprg = "ack" + vim.o.grepprg = "ack" end -- Disable polyglot for langauges I've added special support for