From 74d64eb80b81ef2fa8aeb1abbd36af2e6fc86819 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 16 Jan 2026 10:35:58 +0100 Subject: neovim: reformat code, keybindings für pytest, und spell=false MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/config/autocmds.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'nvim/lua/config/autocmds.lua') diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index e11b231..647875d 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -1,10 +1,10 @@ -- https://github.com/nvim-treesitter/nvim-treesitter/blob/main/doc/nvim-treesitter.txt -vim.api.nvim_create_autocmd('FileType', { +vim.api.nvim_create_autocmd("FileType", { pattern = { "c", "cpp", "lua", "typescript" }, callback = function() vim.treesitter.start() - vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' - vim.wo.foldmethod = 'expr' + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + vim.wo.foldmethod = "expr" vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end, }) @@ -18,13 +18,11 @@ vim.api.nvim_create_autocmd("VimEnter", { -- buffer is a [No Name] local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - if not real_file and not no_name then - return - end + if not real_file and not no_name then return end -- open the tree, find the file but don't focus it - require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) - end + require("nvim-tree.api").tree.toggle({ focus = false, find_file = true }) + end, }) -- https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close @@ -35,16 +33,16 @@ vim.api.nvim_create_autocmd("QuitPre", { for _, w in ipairs(wins) do local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) - if bufname:match("NvimTree_") ~= nil then - table.insert(invalid_win, w) - end + if bufname:match("NvimTree_") ~= nil then table.insert(invalid_win, w) end end if #invalid_win == #wins - 1 then -- Should quit, so we close all invalid windows. - for _, w in ipairs(invalid_win) do vim.api.nvim_win_close(w, true) end + for _, w in ipairs(invalid_win) do + vim.api.nvim_win_close(w, true) + end end - end + end, }) vim.api.nvim_create_autocmd("LspAttach", { -- cgit v1.3