nvim/lua/eddie/options.lua

256 lines
5.9 KiB
Lua
Raw Normal View History

2024-05-07 10:59:07 +00:00
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
2024-03-19 16:31:22 +00:00
2024-05-07 10:59:07 +00:00
if (MY_OS == 'Linux')
then
-- on Linux
vim.opt.guicursor = ""
2024-07-25 19:58:35 +00:00
--vim.opt.spelllang = 'en_gb'
--vim.opt.spell = true
2024-05-07 10:59:07 +00:00
vim.opt.nu = true
vim.opt.relativenumber = true
2024-05-07 10:59:07 +00:00
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
2024-05-07 10:59:07 +00:00
vim.opt.smartindent = true
2024-05-07 10:59:07 +00:00
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
2024-05-07 10:59:07 +00:00
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
2024-05-07 10:59:07 +00:00
vim.opt.hlsearch = false
vim.opt.incsearch = true
2024-07-26 07:01:49 +00:00
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
2024-05-07 10:59:07 +00:00
vim.opt.termguicolors = true
2024-05-07 10:59:07 +00:00
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
2024-05-07 10:59:07 +00:00
vim.opt.updatetime = 50
2024-09-20 10:24:45 +00:00
vim.opt.colorcolumn = "110"
2024-04-18 11:10:12 +00:00
2024-05-07 10:59:07 +00:00
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
2024-05-07 10:59:07 +00:00
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
2024-05-02 08:48:40 +00:00
2024-05-07 10:59:07 +00:00
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
2024-05-02 08:48:40 +00:00
2024-05-07 10:59:07 +00:00
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
2024-05-02 08:48:40 +00:00
2024-05-07 10:59:07 +00:00
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
2024-05-02 08:48:40 +00:00
2024-05-07 10:59:07 +00:00
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "/usr/share/pyenv/shims/python"
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
-- on BSD
vim.opt.guicursor = ""
vim.opt.spelllang = 'en_gb'
vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
2024-07-26 07:01:49 +00:00
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
2024-05-07 10:59:07 +00:00
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
2024-09-25 16:19:14 +00:00
vim.opt.colorcolumn = "110"
2024-05-07 10:59:07 +00:00
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_general_viewer = "zathura"
vim.g.vimtex_quickfix_mode = 0
-- OBSD options
--vim.g.vimtex_compiler_latexmk={ 'cmd': '' }
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
elseif (MY_OS == 'Darwin')
then
-- on MacOS
vim.opt.guicursor = ""
vim.opt.spelllang = 'en_gb'
vim.opt.spell = true
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
-- Fonts
vim.opt.encoding = "utf-8"
vim.opt.guifont = "FiraCodeNerdFont-Regular:h10"
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.undofile = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
2024-07-26 07:01:49 +00:00
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
2024-05-07 10:59:07 +00:00
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
2024-09-25 16:19:14 +00:00
vim.opt.colorcolumn = "110"
2024-05-07 10:59:07 +00:00
-- LSP options
vim.diagnostic.config({
virtual_text = false
})
-- Show line diagnostics automatically in hover window
vim.o.updatetime = 250
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
-- Vimtex options:
2024-12-17 11:49:19 +00:00
vim.g.vimtex_view_method = "sioyek"
vim.g.vimtex_view_sioyek_exe = "/Applications/sioyek.app/Contents/MacOS/sioyek"
-- vim.g.vimtex_view_method = "zathura"
-- vim.g.vimtex_general_viewer = "zathura"
2024-05-07 10:59:07 +00:00
vim.g.vimtex_quickfix_mode = 0
-- Ignore mappings
vim.g.vimtex_mappings_enabled = 1
---- Auto Indent
vim.g["vimtex_indent_enabled"] = 1
---- Syntax highlighting
vim.g.vimtex_syntax_enabled = 0
-- Error suppression:
vim.g.vimtex_log_ignore = ({
"Underfull",
"Overfull",
"specifier changed to",
"Token not allowed in a PDF string",
})
-- Python provider
vim.g.python3_host_prog = "/usr/local/share/pyenv/shims/python"
else
print('Should never be here LSP')
end
2024-05-02 08:48:40 +00:00