diff --git a/.config/nvim/ftplugin/sudoku.lua b/.config/nvim/ftplugin/sudoku.lua new file mode 100644 index 0000000..381289e --- /dev/null +++ b/.config/nvim/ftplugin/sudoku.lua @@ -0,0 +1,4 @@ +vim.keymap.set("n", "", "8l") +vim.keymap.set("n", "", "8h") +vim.keymap.set("n", "", "4k") +vim.keymap.set("n", "", "4j") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..c80a04b --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,71 @@ +{ + "LuaSnip": { "branch": "master", "commit": "57c9f5c31b3d712376c704673eac8e948c82e9c1" }, + "alpha-nvim": { "branch": "main", "commit": "29074eeb869a6cbac9ce1fbbd04f5f5940311b32" }, + "arduino-helper.nvim": { "branch": "master", "commit": "5ec57de680a94f8e948e2e0c6328939b9b63a598" }, + "autolist.nvim": { "branch": "main", "commit": "5f70a5f99e96c8fe3069de042abd2a8ed2deb855" }, + "boole.nvim": { "branch": "main", "commit": "7b4a3dae28e3b2497747aa840439e9493cabdc49" }, + "bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" }, + "catppuccin": { "branch": "main", "commit": "079500a625f3ae5aa6efb758f1a17fe4c7a57e52" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "dcaaed5b58e6c2d395bca18d25d34e6384856722" }, + "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "flit.nvim": { "branch": "main", "commit": "f4e9af572a62c808c8de214da672f2a115a98c35" }, + "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, + "git-conflict.nvim": { "branch": "main", "commit": "4e0191c9a0ae05d7fbdcdc7f15cd358f56d23bfb" }, + "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "leap.nvim": { "branch": "main", "commit": "bad02b384173c8a1bb9e66dea9f50c852deef8d6" }, + "lsp-format.nvim": { "branch": "master", "commit": "31fc250a412ab24555b389f61fac0330f6bb7660" }, + "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "lspsaga.nvim": { "branch": "main", "commit": "335805d4f591f5bb71cabb6aa4dc58ccef8e8617" }, + "ltex_extra.nvim": { "branch": "master", "commit": "9bed99b2b8488cc2daf66c76d2e0cf051ee80d13" }, + "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, + "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, + "mini.nvim": { "branch": "main", "commit": "ea1af8c7d5e72148cae8a04e9887322a53fe66cf" }, + "neo-tree.nvim": { "branch": "main", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" }, + "neoai.nvim": { "branch": "main", "commit": "248c2001d0b24e58049eeb6884a79860923cfe13" }, + "neotest": { "branch": "master", "commit": "b8e29c0fba9a58bf6a5c37df77c7a6a31079c8d6" }, + "neotest-jest": { "branch": "main", "commit": "a394106cf053eef86d65ae04c4b93a1a7bd60aef" }, + "neotest-vitest": { "branch": "main", "commit": "d6577b191e16c174bffbec1eadfcd65c22fdcc0d" }, + "noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, + "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, + "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, + "nvim-dap": { "branch": "master", "commit": "e64ebf3309154b578a03c76229ebf51c37898118" }, + "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, + "nvim-lspconfig": { "branch": "master", "commit": "eb81c7ea08d6f01d5fa4cf09e58c708efadf9b2f" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, + "nvim-recorder": { "branch": "main", "commit": "daaae505862e816a7efe578e22d6f3d10cd7a2e6" }, + "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, + "nvim-toggleterm.lua": { "branch": "main", "commit": "91be5f327e42aa016da13b277540de8dba0b14e3" }, + "nvim-treesitter": { "branch": "master", "commit": "24be1534dbd062907842601ae1e2e953ba02472e" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" }, + "nvim-web-devicons": { "branch": "master", "commit": "a1425903ab52a0a0460622519e827f224e5b4fee" }, + "oil.nvim": { "branch": "master", "commit": "24027ed8d7f3ee5c38cfd713915e2e16d89e79b3" }, + "persisted.nvim": { "branch": "main", "commit": "fc9f398393cc3bb0e4e81cb9f7c133cd2b21467f" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "rest.nvim": { "branch": "main", "commit": "84e81a19ab24ccf05c9233d34d4dfce61c233abe" }, + "sniprun": { "branch": "master", "commit": "639877399a23e375a8c07b75c14d017735eab7cb" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "master", "commit": "6213322ab56eb27356fdc09a5078e41e3ea7f3bc" }, + "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, + "translate.nvim": { "branch": "main", "commit": "30cc9e9f339b61e7bd40bc1ba7af73ea193bf589" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, + "typescript-tools.nvim": { "branch": "master", "commit": "cbc454075741cd942a5ba92d64613533782f37c7" }, + "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "vim-dadbod": { "branch": "master", "commit": "738cfc2ea6a1510fe23cba9006fef9291be70f7b" }, + "vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" }, + "vim-dadbod-ui": { "branch": "master", "commit": "9ddb0623e69d696b7a8355b93e3950a8dc6e00a0" } +} \ No newline at end of file diff --git a/.config/nvim/lua/max/core/autocommands.lua b/.config/nvim/lua/max/core/autocommands.lua index 4a54741..396e722 100644 --- a/.config/nvim/lua/max/core/autocommands.lua +++ b/.config/nvim/lua/max/core/autocommands.lua @@ -17,35 +17,35 @@ autocmd({ "BufReadPost" }, { end, }) -autocmd('FileType', { - callback = function(tbl) - local set_offset = require('bufferline.api').set_offset - - local bufwinid - local last_width - local _autocmd = vim.api.nvim_create_autocmd('WinScrolled', { - callback = function() - bufwinid = bufwinid or vim.fn.bufwinid(tbl.buf) - - local width = vim.api.nvim_win_get_width(bufwinid) - if width ~= last_width then - set_offset(width, '') - last_width = width - end - end, - }) - - vim.api.nvim_create_autocmd('BufWipeout', { - buffer = tbl.buf, - callback = function() - vim.api.nvim_del_autocmd(_autocmd) - set_offset(0) - end, - once = true, - }) - end, - pattern = 'neo-tree', -- or any other filetree's `ft` -}) +-- autocmd('FileType', { +-- callback = function(tbl) +-- local set_offset = require('bufferline.api').set_offset +-- +-- local bufwinid +-- local last_width +-- local _autocmd = vim.api.nvim_create_autocmd('WinScrolled', { +-- callback = function() +-- bufwinid = bufwinid or vim.fn.bufwinid(tbl.buf) +-- +-- local width = vim.api.nvim_win_get_width(bufwinid) +-- if width ~= last_width then +-- set_offset(width, '') +-- last_width = width +-- end +-- end, +-- }) +-- +-- vim.api.nvim_create_autocmd('BufWipeout', { +-- buffer = tbl.buf, +-- callback = function() +-- vim.api.nvim_del_autocmd(_autocmd) +-- set_offset(0) +-- end, +-- once = true, +-- }) +-- end, +-- pattern = 'neo-tree', -- or any other filetree's `ft` +-- }) local save_fold = augroup("Persistent Folds", { clear = true }) autocmd({ "BufWinLeave" }, { diff --git a/.config/nvim/lua/max/core/keymappings.lua b/.config/nvim/lua/max/core/keymappings.lua index ddbc14a..255d8d4 100644 --- a/.config/nvim/lua/max/core/keymappings.lua +++ b/.config/nvim/lua/max/core/keymappings.lua @@ -9,6 +9,10 @@ map("n", "", ":Telescope find_files preview={timeout=1000}", opts) map("n", "", ":Telescope live_grep", opts) map("n", "o", ":Telescope buffers", opts) + +map('n', '', ':term:setlocal nonumber norelativenumberi', { noremap = false, silent = true }) +map('t', '', "h", { silent = true }) + map("n", "", "za", opts) local function zenMode() @@ -38,19 +42,15 @@ map("n", "li", ":LspInfo", opts) map("n", "lr", ":LspRestart", opts) -- barbar.nvim -map('n', '', 'BufferPrevious', opts) -map('n', '', 'BufferNext', opts) -map('n', '', 'BufferGoto 1', opts) -map('n', '', 'BufferGoto 2', opts) -map('n', '', 'BufferGoto 3', opts) -map('n', '', 'BufferGoto 4', opts) -map('n', '', 'BufferGoto 5', opts) -map('n', '', 'BufferGoto 6', opts) -map('n', '', 'BufferGoto 7', opts) -map('n', '', 'BufferGoto 8', opts) -map('n', '', 'BufferGoto 9', opts) -map('n', '', 'BufferLast', opts) -map('n', '', 'BufferClose', opts) +map('n', '', 'BufferLineCyclePrev', opts) +map('n', '', 'BufferLineCycleNext', opts) + +local bufferline = require("bufferline"); +for i = 1, 81 do + map('n', '', function() bufferline.go_to(i, true) end, opts) +end + +map('n', '', 'bdelete', opts) -- This is my [i]nspect section, map("n", "is", ":SymbolsOutline", opts) -- [i]nspect [s]ymbols diff --git a/.config/nvim/lua/max/core/options.lua b/.config/nvim/lua/max/core/options.lua index 2bcce40..2ab7c31 100644 --- a/.config/nvim/lua/max/core/options.lua +++ b/.config/nvim/lua/max/core/options.lua @@ -25,25 +25,34 @@ opt.inccommand = "nosplit" -- preview incremental substitute opt.laststatus = 3 -- laststatus=3 enables global statusline opt.list = false -- Show some invisible characters (tabs... opt.mouse = "a" -- Enable mouse mode -opt.number = true -- Print line number opt.pumblend = 10 -- Popup blend opt.pumheight = 10 -- Maximum number of entries in a popup +vim.cmd [[ set nonu ]] -- Right align active number +opt.number = true -- Print line number opt.relativenumber = true -- Relative line numbers -opt.scrolloff = 4 -- Lines of context + +-- vim.api.nvim_set_option('number', true) +-- vim.api.nvim_set_option('relativenumber', true) + +-- Set the current line number to be the actual one +vim.cmd [[autocmd InsertEnter * set relativenumber]] +vim.cmd [[autocmd InsertLeave * set norelativenumber]] + +opt.scrolloff = 4 -- Lines of context opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } -opt.shiftround = true -- Round indent -opt.shiftwidth = 2 -- Size of an indent +opt.shiftround = true -- Round indent +opt.shiftwidth = 2 -- Size of an indent opt.shortmess:append { W = true, I = true, c = true } -opt.showmode = false -- Dont show mode since we have a statusline -opt.sidescrolloff = 8 -- Columns of context -opt.signcolumn = "no" -- Always show the signcolumn, otherwise it would shift the text each time -opt.smartcase = true -- Don't ignore case with capitals -opt.smartindent = true -- Insert indents automatically +opt.showmode = false -- Dont show mode since we have a statusline +opt.sidescrolloff = 8 -- Columns of context +opt.signcolumn = "no" -- Always show the signcolumn, otherwise it would shift the text each time +opt.smartcase = true -- Don't ignore case with capitals +opt.smartindent = true -- Insert indents automatically opt.spelllang = { "en" } -opt.splitbelow = true -- Put new windows below current -opt.splitright = true -- Put new windows right of current -opt.tabstop = 2 -- Number of spaces tabs count for -opt.termguicolors = true -- True color support +opt.splitbelow = true -- Put new windows below current +opt.splitright = true -- Put new windows right of current +opt.tabstop = 2 -- Number of spaces tabs count for +opt.termguicolors = true -- True color support opt.timeoutlen = 300 opt.undofile = true opt.undolevels = 10000 diff --git a/.config/nvim/lua/max/plugins/bufferline.lua b/.config/nvim/lua/max/plugins/bufferline.lua new file mode 100644 index 0000000..39fd034 --- /dev/null +++ b/.config/nvim/lua/max/plugins/bufferline.lua @@ -0,0 +1,81 @@ +local function get_highlight_foreground(group) + local synID = vim.fn.hlID(group) + return vim.fn.synIDattr(synID, 'fg', 'gui') +end + +return { + 'akinsho/bufferline.nvim', + version = "*", + dependencies = 'nvim-tree/nvim-web-devicons', + event = "BufWinEnter", + config = function() + local bufferline = require("bufferline"); + bufferline.setup({ + highlights = { + background = { + bg = "none", + }, + separator = { + bg = "none", + }, + fill = { + bg = "none" + }, + offset_separator = { + bg = "none", + fg = "#454545", + bold = false, + }, + buffer_selected = { + bg = "#2a2b3c", + bold = true, + italic = false, + }, + indicator_selected = { + bg = "none", + }, + }, + options = { + close_command = 'Bdelete! %d', + right_mouse_command = 'Bdelete! %d', + left_mouse_command = 'buffer %d', + middle_mouse_command = nil, + themable = true, + indicator = { + style = 'icon', + icon = ' ', --'▎', + buffer_close_icon = ' ', + modified_icon = '●', + close_icon = ' ', + left_trunc_marker = '<-', --'', + right_trunc_marker = '->', --'', + }, + offsets = { { filetype = "neo-tree", text = "", text_align = "left", separator = true, highlight = "Directory" } }, + + get_element_icon = function(element) + -- element consists of {filetype: string, path: string, extension: string, directory: string} + -- This can be used to change how bufferline fetches the icon + -- for an element e.g. a buffer or a tab. + -- e.g. + local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false }) + if hl then + local fg = get_highlight_foreground(hl) or "#ffffff" + -- vim.cmd("hi BufferLine" .. hl .. " guifg=" .. fg .. " guibg=#1c1d23"); + vim.cmd("hi BufferLine" .. hl .. "Selected guifg=" .. fg .. " guibg=#2a2b3c"); + end + return icon, hl + end, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = false, + show_close_icon = false, + show_tab_indicators = false, + persist_buffer_sort = true, + separator_style = "thin", + enforce_regular_tabs = true, + always_show_bufferline = true, + sort_by = 'id', + } + }) + end +} diff --git a/.config/nvim/lua/max/plugins/diffview.lua b/.config/nvim/lua/max/plugins/diffview.lua new file mode 100644 index 0000000..aab3fd3 --- /dev/null +++ b/.config/nvim/lua/max/plugins/diffview.lua @@ -0,0 +1,3 @@ +return { + "sindrets/diffview.nvim" +} diff --git a/.config/nvim/lua/max/plugins/lsp.lua b/.config/nvim/lua/max/plugins/lsp.lua index c8f4e46..7ffca6c 100644 --- a/.config/nvim/lua/max/plugins/lsp.lua +++ b/.config/nvim/lua/max/plugins/lsp.lua @@ -7,7 +7,7 @@ return { "williamboman/mason-lspconfig.nvim", "onsails/lspkind.nvim", "lukas-reineke/lsp-format.nvim", - + "barreiroleo/ltex_extra.nvim", "pmizio/typescript-tools.nvim", }, event = "BufReadPost", @@ -58,6 +58,10 @@ return { client.stop() end end + elseif client.name == "ltex" then + require("ltex_extra").setup { + load_langs = { "en-US", "de" } + } end require("lsp-format").on_attach(client) end @@ -200,10 +204,13 @@ return { settings = { yaml = { schemas = { - ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*", + ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = + "conf/**/*catalog*", ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", - ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml", - ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml", + ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = + "rules.yml", + ["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = + "traefik.yml", }, }, }, @@ -214,6 +221,8 @@ return { }) custom_lsp.ltex = { + capabilities = capabilities, + on_attach = on_attach, settings = { ltex = { language = "de", @@ -226,8 +235,8 @@ return { "Neovim", "waybar", }, - }, - }, + } + } } mason_lsp.setup_handlers({ diff --git a/.config/nvim/lua/max/plugins/neotree.lua b/.config/nvim/lua/max/plugins/neotree.lua index 971c7c1..e24fe5b 100644 --- a/.config/nvim/lua/max/plugins/neotree.lua +++ b/.config/nvim/lua/max/plugins/neotree.lua @@ -10,6 +10,11 @@ return { vim.g.neo_tree_remove_legacy_commands = 1 require("neo-tree").setup({ hide_root_node = true, + window = { + mappings = { + ["g"] = "git_add_file", + } + } }) end, } diff --git a/.config/nvim/lua/max/plugins/sudoku.lua b/.config/nvim/lua/max/plugins/sudoku.lua index 4c1cf9d..a8b9ab3 100644 --- a/.config/nvim/lua/max/plugins/sudoku.lua +++ b/.config/nvim/lua/max/plugins/sudoku.lua @@ -1,9 +1,4 @@ return { dir = "~/Projects/sudoku.nvim", cmd = "Sudoku", - opts = { - custom_highlights = { - square = { fg = "red" } - } - } } diff --git a/.config/nvim/lua/max/plugins/tabs.lua b/.config/nvim/lua/max/plugins/tabs.lua deleted file mode 100644 index 8a4107b..0000000 --- a/.config/nvim/lua/max/plugins/tabs.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "romgrk/barbar.nvim", - dependencies = 'nvim-tree/nvim-web-devicons', - event = "VeryLazy", - config = function() - require("bufferline").setup({ - auto_hide = true, - icons = { - seperator = { left = "│", right = "" } - } - }) - end, -} diff --git a/.config/nvim/lua/max/plugins/theme/catpuccin.lua b/.config/nvim/lua/max/plugins/theme/catpuccin.lua index 08378e1..a40790a 100644 --- a/.config/nvim/lua/max/plugins/theme/catpuccin.lua +++ b/.config/nvim/lua/max/plugins/theme/catpuccin.lua @@ -12,7 +12,7 @@ return { }, styles = { comments = { "italic" }, - strings = { "italic" }, + -- strings = { "italic" }, }, custom_highlights = function() return { @@ -22,12 +22,12 @@ return { integrations = { gitsigns = true, telescope = true, - -- treesitter = true, + bufferline = true, + treesitter = true, cmp = true, - lsp_saga = true, notify = true, neotree = { - enabled = false, + enabled = true, show_root = false, }, dap = { diff --git a/.gitconfig b/.gitconfig index 2d9f6e2..4f0b72d 100644 --- a/.gitconfig +++ b/.gitconfig @@ -15,3 +15,7 @@ required = true [url "git@github.com:"] insteadOf = https://github.com/ +[alias] + latexdiff = difftool -t latexdiff +[difftool "latexdiff"] + cmd = git-latexdiff-helper \"$LOCAL\" \"$REMOTE\" diff --git a/.zprofile b/.zprofile index 1d2569a..44e0be0 100644 --- a/.zprofile +++ b/.zprofile @@ -109,4 +109,9 @@ if type bat &> /dev/null; then alias cat="bat" fi +# set PATH so it includes user's private bin if it exists +if [ -d "/usr/local/texlive/2023" ] ; then + PATH="/usr/local/texlive/2023/bin/x86_64-linux:$PATH" +fi + alias gcm="git commit -m "