diff --git a/lua/plex/config/autocmds.lua b/lua/plex/config/autocmds.lua index 25ee149..a839982 100644 --- a/lua/plex/config/autocmds.lua +++ b/lua/plex/config/autocmds.lua @@ -14,6 +14,15 @@ vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, { command = 'checktime', }) +-- Caution: Causes Errors? +-- -- Open Neotree in new tabs +-- vim.api.nvim_create_autocmd({'TabNewEntered' }, { +-- group = augroup('automatic_neotree'), +-- callback = function() +-- vim.cmd('Neotree') +-- end, +-- }) + -- Go to last loc when opening a buffer, see ':h last-position-jump' vim.api.nvim_create_autocmd('BufReadPost', { group = augroup('last_loc'), @@ -79,7 +88,7 @@ vim.api.nvim_create_autocmd('BufWritePre', { -- Disable conceallevel for specific file-types. vim.api.nvim_create_autocmd('FileType', { group = augroup('fix_conceallevel'), - pattern = { 'markdown' }, + pattern = { 'latex', 'tex' }, callback = function() vim.opt_local.conceallevel = 0 end, diff --git a/lua/plex/config/init.lua b/lua/plex/config/init.lua index 843880a..b0b1f87 100644 --- a/lua/plex/config/init.lua +++ b/lua/plex/config/init.lua @@ -25,7 +25,7 @@ local defaults = { -- String like `habamax` or a function that will load the colorscheme. -- Disabled by default to allow theme-loader.nvim to manage the colorscheme. ---@type string|fun() - colorscheme = '', + colorscheme = 'kanagawa', features = { elite_mode = true, diff --git a/lua/plex/config/keymaps.lua b/lua/plex/config/keymaps.lua index 42ec1d0..1d86c31 100644 --- a/lua/plex/config/keymaps.lua +++ b/lua/plex/config/keymaps.lua @@ -36,8 +36,8 @@ map('n', 'l', 'Lazy', { desc = 'Open Lazy UI' }) --map({ 'n', 'x' }, 'J', "") -- Easier line-wise movement -map({'n', 'v'}, 'H', 'g^') -map({'n', 'v'}, 'L', 'g$') +map({'n', 'v'}, 'H', '') +map({'n', 'v'}, 'L', '') -- Toggle fold or select option from popup menu ---@return string @@ -84,6 +84,10 @@ map('n', 'zh', 'z4h') map('n', 'zn', ']s') map('n', 'zN', '[s') +-- move screen and line up +map('n', '', 'k') +map('n', '', 'j') + -- Clipboard -- === @@ -344,8 +348,8 @@ map('n', '"', 'vsplit', { desc = 'Split window vertically' }) map('n', 'wb', 'buffer#', { desc = 'Alternate buffer' }) map('n', 'wc', 'close', { desc = 'Close window' }) map('n', 'wd', 'bdelete', { desc = 'Buffer delete' }) -map('n', 'wv', 'split', { desc = 'Split window horizontally' }) -map('n', 'wg', 'vsplit', { desc = 'Split window vertically' }) +map('n', 'w%', 'split', { desc = 'Split window horizontally' }) +map('n', 'w"', 'vsplit', { desc = 'Split window vertically' }) map('n', 'wt', 'tabnew', { desc = 'New tab' }) map('n', 'wtp', 'tabprevious', { desc = 'Previous tab' }) map('n', 'wtn', 'tabnext', { desc = 'Next tab' }) diff --git a/lua/plex/plugins/coding.lua b/lua/plex/plugins/coding.lua index b534fa6..164823c 100644 --- a/lua/plex/plugins/coding.lua +++ b/lua/plex/plugins/coding.lua @@ -44,11 +44,11 @@ return { }, sources = cmp.config.sources({ { name = 'nvim_lsp', priority = 50 }, - { name = 'path', priority = 40 }, - { name = 'luasnip', priority = 30 }, + { name = 'path', priority = 40 }, + { name = 'luasnip', priority = 30 }, }, { { name = 'buffer', priority = 50, keyword_length = 3 }, - { name = 'emoji', insert = true, priority = 20 }, + { name = 'emoji', insert = true, priority = 20 }, { name = 'tmux', priority = 10, @@ -135,7 +135,7 @@ return { dependencies = { 'rafamadriz/friendly-snippets' }, build = (not jit.os:find('Windows')) and "echo 'jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" - or nil, + or nil, -- stylua: ignore keys = { { @@ -205,12 +205,12 @@ return { local plugin = require('lazy.core.config').spec.plugins['mini.surround'] local opts = require('lazy.core.plugin').values(plugin, 'opts', false) local mappings = { - { opts.mappings.add, desc = 'Add surrounding', mode = { 'n', 'x', 'v' } }, - { opts.mappings.delete, desc = 'Delete surrounding', mode = { 'n', 'x', 'v' } }, - { opts.mappings.find, desc = 'Find right surrounding', mode = { 'n', 'x', 'v' } }, - { opts.mappings.find_left, desc = 'Find left surrounding', mode = { 'n', 'x', 'v' } }, - { opts.mappings.highlight, desc = 'Highlight surrounding', mode = { 'n', 'x', 'v' } }, - { opts.mappings.replace, desc = 'Replace surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.add, desc = 'Add surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.delete, desc = 'Delete surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.find, desc = 'Find right surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.find_left, desc = 'Find left surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.highlight, desc = 'Highlight surrounding', mode = { 'n', 'x', 'v' } }, + { opts.mappings.replace, desc = 'Replace surrounding', mode = { 'n', 'x', 'v' } }, { opts.mappings.update_n_lines, desc = 'Update `MiniSurround.config.n_lines`', mode = { 'n', 'x', 'v' } }, } mappings = vim.tbl_filter(function(m) @@ -220,12 +220,12 @@ return { end, opts = { mappings = { - add = 'sa', -- Add surrounding in Normal and Visual modes - delete = 'sd', -- Delete surrounding - find = 'sf', -- Find surrounding (to the right) - find_left = 'sF', -- Find surrounding (to the left) - highlight = 'sh', -- Highlight surrounding - replace = 'cs', -- Replace surrounding + add = 'sa', -- Add surrounding in Normal and Visual modes + delete = 'sd', -- Delete surrounding + find = 'sf', -- Find surrounding (to the right) + find_left = 'sF', -- Find surrounding (to the left) + highlight = 'sh', -- Highlight surrounding + replace = 'cs', -- Replace surrounding update_n_lines = 'su', -- Update `n_lines` }, }, @@ -238,13 +238,13 @@ return { dependencies = { 'JoosepAlviste/nvim-ts-context-commentstring' }, keys = { { 'v', 'gcc', remap = true, silent = true, mode = 'n' }, - { 'v', 'gc', remap = true, silent = true, mode = 'x' }, + { 'v', 'gc', remap = true, silent = true, mode = 'x' }, }, opts = { options = { custom_commentstring = function() return require('ts_context_commentstring.internal').calculate_commentstring() - or vim.bo.commentstring + or vim.bo.commentstring end, }, }, @@ -304,9 +304,9 @@ return { 'AndrewRadev/linediff.vim', cmd = { 'Linediff', 'LinediffAdd' }, keys = { - { 'mdf', ':Linediff', mode = 'x', desc = 'Line diff' }, - { 'mda', ':LinediffAdd', mode = 'x', desc = 'Line diff add' }, - { 'mds', 'LinediffShow', desc = 'Line diff show' }, + { 'mdf', ':Linediff', mode = 'x', desc = 'Line diff' }, + { 'mda', ':LinediffAdd', mode = 'x', desc = 'Line diff add' }, + { 'mds', 'LinediffShow', desc = 'Line diff show' }, { 'mdr', 'LinediffReset', desc = 'Line diff reset' }, }, }, @@ -323,4 +323,63 @@ return { vim.g.dsf_no_mappings = 1 end, }, + + ----------------------------------------------------------------------------- + { + -- TODO: + -- make debugging for C. Cpp, Rust, Python work + 'mfussenegger/nvim-dap', + keys = { + { + 'db', + 'lua require\'dap\'.toggle_breakpoint()', + mode = { 'n', 'x' }, + desc = 'Debugging: Toggle breakpoint', + }, + { + 'dc', + 'lua require\'dap\'.continue()', + mode = { 'n', 'x' }, + desc = 'Debugging: Start or continue debug session', + }, + { + 'dsi', + 'lua require\'dap\'.step_into()', + mode = { 'n', 'x' }, + desc = 'Debugging: Step into code', + }, + { + 'dso', + 'lua require\'dap\'.step_over()', + mode = { 'n', 'x' }, + desc = 'Debugging: Step over code', + }, + { + 'dr', + 'lua require\'dap\'.repl.open()', + mode = { 'n', 'x' }, + desc = 'Debugging: repl Menu', + }, + { + 'dms', + function() + local widgets = require('dap.ui.widgets') + local my_sidebar = widgets.sidebar(widgets.scopes) + my_sidebar.open() + end, + mode = { 'n', 'x' }, + desc = 'Debugging: Menu scopes', + }, + { + 'dmf', + function() + local widgets = require('dap.ui.widgets') + local my_sidebar = widgets.sidebar(widgets.frames) + my_sidebar.open() + end, + mode = { 'n', 'x' }, + desc = 'Debugging: Menu frames', + }, + }, + }, } diff --git a/lua/plex/plugins/colorscheme.lua b/lua/plex/plugins/colorscheme.lua index 5ae495f..defed97 100644 --- a/lua/plex/plugins/colorscheme.lua +++ b/lua/plex/plugins/colorscheme.lua @@ -1,15 +1,4 @@ --- Plugins: Colorschemes --- https://github.com/rafi/vim-config - return { - - { - 'rafi/theme-loader.nvim', - lazy = false, - priority = 99, - opts = { initial_colorscheme = 'kanagawa' }, - }, - { 'rafi/neo-hybrid.vim', priority = 100, lazy = false }, { 'rafi/awesome-vim-colorschemes', lazy = false }, { 'AlexvZyl/nordic.nvim' }, @@ -24,7 +13,7 @@ return { lazy = true, name = 'catppuccin', opts = { - flavour = 'mocha', -- latte, frappe, macchiato, mocha + flavour = 'latte', -- latte, frappe, macchiato, mocha dim_inactive = { enabled = false }, integrations = { alpha = true, @@ -72,15 +61,15 @@ return { }, { 'rebelot/kanagawa.nvim', - lazy = true, + lazy = false, name = 'kanagawa', config = function() require('kanagawa').setup({ - compile = false, -- enable compiling the colorscheme + compile = true, -- enable compiling the colorscheme undercurl = true, -- enable undercurls - commentStyle = { italic = true }, + commentStyle = { italic = false }, functionStyle = {}, - keywordStyle = { italic = true}, + keywordStyle = { bold = true }, statementStyle = { bold = true }, typeStyle = {}, transparent = false, -- do not set background color @@ -93,13 +82,12 @@ return { overrides = function(colors) -- add/modify highlights return {} end, - theme = "wave", -- Load "wave" theme when 'background' option is not set + theme = "dragon", -- Load "wave" theme when 'background' option is not set background = { -- map the value of 'background' option to a theme - dark = "wave", -- try "dragon" ! + dark = "wave", -- try "dragon" ! light = "lotus" }, }) - end }, } diff --git a/lua/plex/plugins/extras/lang/cpp.lua b/lua/plex/plugins/extras/lang/cpp.lua new file mode 100644 index 0000000..c77cc1d --- /dev/null +++ b/lua/plex/plugins/extras/lang/cpp.lua @@ -0,0 +1,64 @@ +return { + { + 'mfussenegger/nvim-dap', + -- optional = true, + dependencies = { + 'mfussenegger/nvim-dap-python', + }, + -- stylua: ignore + -- keys = { + -- { 'dPt', function() require('dap-python').test_method() end, desc = 'Debug Method' }, + -- { 'dPc', function() require('dap-python').test_class() end, desc = 'Debug Class' }, + -- }, + opts = function() + local dap = require('dap') + dap.adapters.cppdbg = { + id = 'cppdbg', + type = 'executable', + command = '/home/cscherr/.local/share/nvim/nvim-dap/debuggers/cpptools/extension/debugAdapters/bin/OpenDebugAD7', + } + dap.configurations.cpp = { + { + name = "Launch file", + type = "cppdbg", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopAtEntry = true, + setupCommands = { + { + text = '-enable-pretty-printing', + description = 'enable pretty printing', + ignoreFailures = false + }, + }, + + }, + { + name = 'Attach to gdbserver :1234', + type = 'cppdbg', + request = 'launch', + MIMode = 'gdb', + miDebuggerServerAddress = 'localhost:1234', + miDebuggerPath = '/usr/bin/gdb', + cwd = '${workspaceFolder}', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + setupCommands = { + { + text = '-enable-pretty-printing', + description = 'enable pretty printing', + ignoreFailures = false + }, + }, + + }, + } + dap.configurations.c = dap.configurations.cpp + dap.configurations.rust = dap.configurations.cpp + end, + }, +} diff --git a/lua/plex/plugins/extras/lang/rust.lua b/lua/plex/plugins/extras/lang/rust.lua new file mode 100644 index 0000000..d3cb0f9 --- /dev/null +++ b/lua/plex/plugins/extras/lang/rust.lua @@ -0,0 +1,42 @@ +return { + { + 'mfussenegger/nvim-dap', + optional = true, + dependencies = { + 'mfussenegger/nvim-dap-python', + }, + -- stylua: ignore + -- keys = { + -- { 'dPt', function() require('dap-python').test_method() end, desc = 'Debug Method' }, + -- { 'dPc', function() require('dap-python').test_class() end, desc = 'Debug Class' }, + -- }, + config = function() + local dap = require('dap') + dap.configurations.rust = { + { + -- ... the previous config goes here ..., + initCommands = function() + -- Find out where to look for the pretty printer Python module + local rustc_sysroot = vim.fn.trim(vim.fn.system('rustc --print sysroot')) + + local script_import = 'command script import "' .. rustc_sysroot .. '/lib/rustlib/etc/lldb_lookup.py"' + local commands_file = rustc_sysroot .. '/lib/rustlib/etc/lldb_commands' + + local commands = {} + local file = io.open(commands_file, 'r') + if file then + for line in file:lines() do + table.insert(commands, line) + end + file:close() + end + table.insert(commands, 1, script_import) + + return commands + end, + -- ..., + } + } + end, + }, +} diff --git a/lua/plex/plugins/extras/lang/typescript.lua b/lua/plex/plugins/extras/lang/typescript.lua index 8cdd7aa..6415499 100644 --- a/lua/plex/plugins/extras/lang/typescript.lua +++ b/lua/plex/plugins/extras/lang/typescript.lua @@ -25,7 +25,7 @@ return { -- stylua: ignore keys = { { 'co', 'TypescriptOrganizeImports', desc = 'Organize Imports' }, - { 'cR', 'TypescriptRenameFile', desc = 'Rename File' }, + { 'cR', 'TypescriptRenameFile', desc = 'Rename File' }, }, settings = { ---@diagnostic disable: missing-fields @@ -93,8 +93,8 @@ return { -- 💀 Make sure to update this path to point to your installation args = { require('mason-registry') - .get_package('js-debug-adapter') - :get_install_path() .. '/js-debug/src/dapDebugServer.js', + .get_package('js-debug-adapter') + :get_install_path() .. '/js-debug/src/dapDebugServer.js', '${port}', }, }, diff --git a/lua/plex/plugins/extras/ui/bufferline.lua b/lua/plex/plugins/extras/ui/bufferline.lua index 9fdeb9c..990c0fd 100644 --- a/lua/plex/plugins/extras/ui/bufferline.lua +++ b/lua/plex/plugins/extras/ui/bufferline.lua @@ -4,11 +4,19 @@ return { event = 'VeryLazy', opts = { options = { + -- :h bufferline-configuration mode = 'tabs', - separator_style = 'slant', + separator_style = {"╱", "╱"}, + themable = true, + numbers = "ordinal", show_close_icon = false, show_buffer_close_icons = false, - diagnostics = false, + diagnostics = true, + indicator = { + -- icon = ' ', -- this should be omitted if indicator style is not 'icon' + -- windows terminal sucks + style = 'none', + }, always_show_bufferline = true, diagnostics_indicator = function(_, _, diag) local icons = require('plex.config').icons.diagnostics @@ -39,6 +47,7 @@ return { text_align = 'center', }, }, + }, }, }, diff --git a/lua/plex/plugins/telescope.lua b/lua/plex/plugins/telescope.lua index ca66875..ecf1545 100644 --- a/lua/plex/plugins/telescope.lua +++ b/lua/plex/plugins/telescope.lua @@ -243,8 +243,8 @@ return { -- Plugins { 'n', plugin_directories, desc = 'Plugins' }, - { 'k', 'Telescope thesaurus lookup', desc = 'Thesaurus' }, - { 'w', 'ZkNotes', desc = 'Zk notes' }, + -- { 'k', 'Telescope thesaurus lookup', desc = 'Thesaurus' }, + -- { 'w', 'ZkNotes', desc = 'Zk notes' }, { 'z', diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 88efa18..3b52257 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -108,3 +108,89 @@ Theoriephase weise/! Weise merksam +Syscall +Enum +deu +JS +JS +getElementById +MDN +WebDocs +src +txt +ERRNO +vvvv +Rustonomicon +Rustdoc +paragraph +rustc +Klabnik +io +rustbook +Deserialize +deserialisierbaren +SIGTERM +Beendigungsabfrage +SIGKILL +stdout +stderr +Leveln +gedroppt +#ekonstruktor +Dekonstruktor/! +dealloziiert +Dealloziierung +Dealloziieren +vvvv +TODO +vvvv +Structs +nomicon +Wrapperklasse +tx +rx +struct +enum +priorisierbar +仕方がない +Gleichzeitigkeitsmechanismen +ServiceWrapper +Repräsentierung +Docstrings +Backends +dirs +MessageFrame +Addressor +init +Spektralgestalt +CTS +Addressor +Timestamp +str +BASEDIRECTORY +configs +fifo +PKI +secp384r1 +Addressors +Keystore +Fifos +SBC +NTSecureCloudSolutions +newtec +loesungen +subfigure +Shield96 +ATSAMA5D27 +TrustZone +A5 +ARMv7 +eMMC +MT25QU0512BBB +ATECC608 +Rückwärtskompatibilität +tls +opcua +texttt +rfcp +ssl