Compare commits

..

2 Commits

Author SHA1 Message Date
3f61b7c994 Platform independent undodir 2025-12-16 13:50:00 +01:00
1c482ecdf7 add clang-tidy and changed tab width from 4 to 2 2025-12-15 07:47:03 +01:00
2 changed files with 21 additions and 20 deletions

View File

@@ -1,14 +1,14 @@
-- init.lua -- init.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release "--branch=stable", -- latest stable release
lazypath, lazypath,
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " " vim.g.mapleader = " "
@@ -16,7 +16,7 @@ require("lazy").setup("plugins")
require("commands") require("commands")
vim.opt.backup = false vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. '/.cache/nvim/undodir' vim.opt.undodir = vim.fn.stdpath('cache') .. '/undodir'
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.undofile = true vim.opt.undofile = true
vim.opt.smartcase = true vim.opt.smartcase = true
@@ -32,22 +32,22 @@ vim.opt.autochdir = false
vim.opt.clipboard = 'unnamed,unnamedplus' vim.opt.clipboard = 'unnamed,unnamedplus'
in_wsl = os.getenv('WSL_DISTRO_NAME') ~= nil in_wsl = os.getenv('WSL_DISTRO_NAME') ~= nil
if in_wsl then if in_wsl then
vim.g.clipboard = { vim.g.clipboard = {
name = 'wsl clipboard', name = 'wsl clipboard',
copy = { ["+"] = { "clip.exe" }, ["*"] = { "clip.exe" } }, copy = { ["+"] = { "clip.exe" }, ["*"] = { "clip.exe" } },
paste = { ["+"] = { "win32yank.exe" }, ["*"] = { "win32yank.exe" } }, paste = { ["+"] = { "win32yank.exe" }, ["*"] = { "win32yank.exe" } },
cache_enabled = true cache_enabled = true
} }
end end
vim.opt.number = true vim.opt.number = true
vim.opt.wrap = false vim.opt.wrap = false
vim.opt.signcolumn = 'yes:2' vim.opt.signcolumn = 'yes:2'
vim.opt.list = true vim.opt.list = true
vim.opt.listchars = 'tab:▸ ,trail:·' vim.opt.listchars = 'tab:▸ ,trail:·'
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 2
vim.opt.tabstop = 4 vim.opt.tabstop = 2
vim.opt.softtabstop = 4 vim.opt.softtabstop = 2
vim.opt.expandtab = false vim.opt.expandtab = true
vim.opt.autoindent = true vim.opt.autoindent = true
vim.opt.smartindent = true vim.opt.smartindent = true
vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.completeopt = { "menu", "menuone", "noselect" }

View File

@@ -175,7 +175,8 @@ return {
-- }) -- })
vim.lsp.config('clangd', { vim.lsp.config('clangd', {
capabilities = capabilities, capabilities = capabilities,
on_attach = lsp_attach on_attach = lsp_attach,
cmd = { "clangd", '--background-index', '--clang-tidy' }
}) })
vim.lsp.enable({ 'ts_ls', 'vue_ls', 'clangd' }) vim.lsp.enable({ 'ts_ls', 'vue_ls', 'clangd' })
end end