fix: guard macOS-only configs behind has('mac') check
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-- This ftplugin is currently configured for macOS (Homebrew + Apple Silicon).
|
||||
-- Skip on Linux until Linux paths are configured.
|
||||
if vim.fn.has("mac") ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local home = os.getenv("HOME")
|
||||
local workspace_path = home .. "/.local/share/nvim/jdtls-workspace/"
|
||||
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
|
||||
|
||||
@@ -136,8 +136,9 @@ g.loaded_ruby_provider = 0 -- Disable Ruby provider (optional)
|
||||
|
||||
g.python3_host_prog = fn.expand("~/.local/pipx/venvs/pynvim/bin/python")
|
||||
|
||||
-- Clipboard provider optimization (macOS)
|
||||
g.clipboard = {
|
||||
-- Clipboard provider optimization (macOS only)
|
||||
if vim.fn.has("mac") == 1 then
|
||||
g.clipboard = {
|
||||
name = "macOS-clipboard",
|
||||
copy = {
|
||||
["+"] = "pbcopy",
|
||||
@@ -147,7 +148,8 @@ g.clipboard = {
|
||||
["+"] = "pbpaste",
|
||||
["*"] = "pbpaste",
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- Lua specific settings
|
||||
opt.runtimepath:append(vim.fn.stdpath("config") .. "/lua")
|
||||
|
||||
@@ -10,12 +10,12 @@ return {
|
||||
"lervag/vimtex",
|
||||
ft = { "tex", "latex", "bib" },
|
||||
config = function()
|
||||
-- Use Skim on macOS (or change to your preferred PDF viewer)
|
||||
-- PDF viewer: Skim on macOS, zathura elsewhere
|
||||
if vim.fn.has("mac") == 1 then
|
||||
vim.g.vimtex_view_method = "skim"
|
||||
|
||||
-- Alternatively, use the general viewer (Preview.app)
|
||||
-- vim.g.vimtex_view_method = "general"
|
||||
-- vim.g.vimtex_view_general_viewer = "open"
|
||||
else
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
end
|
||||
|
||||
-- Compiler settings
|
||||
vim.g.vimtex_compiler_method = "latexmk"
|
||||
|
||||
Reference in New Issue
Block a user