.config/nvim/lua/kamu/options.lua aktualisiert

This commit is contained in:
2024-03-30 06:47:17 +01:00
parent dfd598f066
commit 21c5164c3d

View File

@@ -1,56 +1,72 @@
in_wsl = os.getenv('WSL_DISTRO_NAME') ~= nil in_wsl = os.getenv('WSL_DISTRO_NAME') ~= nil
-- https://mitchellt.com/2022/05/15/WSL-Neovim-Lua-and-the-Windows-Clipboard.html -- https://mitchellt.com/2022/05/15/WSL-Neovim-Lua-and-the-Windows-Clipboard.html
if in_wsl then if in_wsl then
vim.g.clipboard = { vim.g.clipboard = {
name = 'wsl clipboard', name = 'wsl clipboard',
copy = { copy = {
["+"] = { "clip.exe" }, ["+"] = { "clip.exe" },
["*"] = { "clip.exe" } ["*"] = { "clip.exe" }
}, },
paste = { paste = {
["+"] = { 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))' }, ["+"] = { 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))' },
["*"] = { 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))' } }, ["*"] = { 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))' } },
cache_enabled = true cache_enabled = true
} }
end end
local options = { -- if in_wsl then
autoindent = true, -- vim.g.clipboard = {
smartindent = true, -- name = 'WslClipboard',
tabstop = 2, -- copy = {
shiftwidth = 2, -- ['+'] = 'clip.exe',
expandtab = true, -- ['*'] = 'clip.exe',
-- },
number = true, -- paste = {
relativenumber = true, -- ['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
numberwidth = 4, -- ['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
-- },
swapfile = false, -- cache_enabled = false,
backup = false, -- }
undodir = os.getenv("HOME") .. "/.vim/undodir", -- end
undofile = true,
hlsearch = false, local options = {
incsearch = true, autoindent = true,
smartindent = true,
showtabline = 0, tabstop = 2,
shiftwidth = 2,
termguicolors = true, expandtab = true,
signcolumn = "yes", number = true,
wrap = false, relativenumber = true,
fileencoding = "utf-8", numberwidth = 4,
scrolloff = 8, swapfile = false,
mouse = "a", backup = false,
undodir = os.getenv("HOME") .. "/.vim/undodir",
updatetime = 50, undofile = true,
-- guicursor = "a:block" hlsearch = false,
} incsearch = true,
for option, value in pairs(options) do showtabline = 0,
vim.opt[option] = value
end termguicolors = true,
signcolumn = "yes",
wrap = false,
fileencoding = "utf-8",
scrolloff = 8,
mouse = "a",
updatetime = 50,
-- guicursor = "a:block"
}
for option, value in pairs(options) do
vim.opt[option] = value
end