diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index ee1f091..e4d415f 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -4,7 +4,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, callback = function() vim.cmd([[ - nnoremap q :close + nnoremap q :close set nobuflisted ]]) end, @@ -26,7 +26,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, { pattern = { "gitcommit", "markdown", "vimwiki" }, callback = function() vim.opt_local.wrap = true - vim.opt_local.spell = true + -- vim.opt_local.spell = true end, }) @@ -74,10 +74,19 @@ vim.api.nvim_create_autocmd({ "FileType" }, { vim.cmd([[ highlight CursorLine ctermbg=White cterm=bold guibg=#222222 highlight CursorColumn ctermbg=White cterm=bold guibg=#222222 - autocmd FileType python imap wexec "!python3" shellescape(@%, 1) - autocmd FileType python map wexec "!python3" shellescape(@%, 1) - autocmd FileType rust imap wexec "!cargo run" - autocmd FileType rust map wexec "!cargo run" - autocmd FileType tex imap wexec "silent !lualatex %" - autocmd FileType tex map wexec "silent !lualatex %" + autocmd FileType python imap wexec "!python3" shellescape(@%, 1) + autocmd FileType python map wexec "!python3" shellescape(@%, 1) + autocmd FileType rust imap wexec "!cargo run" + autocmd FileType rust map wexec "!cargo run" + autocmd FileType tex imap wexec "silent !lualatex %" + autocmd FileType tex map wexec "silent !lualatex %" +]]) + +-- Autocommand that reloads waybar whenever you save the ~/.config/waybar/config file +vim.cmd([[ + augroup waybar_user_config + autocmd! + autocmd BufWritePost ~/Nextcloud/solorice/.config/waybar/config silent !pkill waybar && waybar & disown + autocmd BufWritePost ~/Nextcloud/solorice/.config/waybar/style.css silent !pkill waybar && waybar & disown + augroup end ]]) diff --git a/lua/user/dap.lua b/lua/user/dap.lua index e587a1c..69886e8 100644 --- a/lua/user/dap.lua +++ b/lua/user/dap.lua @@ -8,10 +8,10 @@ if not dap_status_ok then return end --- local dap_ui_status_ok, dapui = pcall(require, "dapui") --- if not dap_ui_status_ok then --- return --- end +local dap_ui_status_ok, dapui = pcall(require, "dapui") +if not dap_ui_status_ok then + return +end local dap_install_status_ok, dap_install = pcall(require, "dap-install") if not dap_install_status_ok then @@ -27,43 +27,43 @@ dap_install.setup({}) dap_install.config("python", {}) -- add other configs here --- dapui.setup({ --- layouts = { --- { --- elements = { --- "scopes", --- "breakpoints", --- "stacs", --- "watches", --- }, --- size = 40, --- position = "left", --- }, --- { --- elements = { --- "repl", --- "console", --- }, --- size = 10, --- position = "bottom", --- }, --- }, --- --- -- sidebar = { --- -- elements = { --- -- { --- -- id = "scopes", --- -- size = 0.25, -- Can be float or integer > 1 --- -- }, --- -- { id = "breakpoints", size = 0.25 }, --- -- }, --- -- size = 40, --- -- position = "right", -- Can be "left", "right", "top", "bottom" --- -- }, --- -- tray = { --- -- elements = {}, --- -- }, --- }) +dapui.setup({ + layouts = { + { + elements = { + "scopes", + "breakpoints", + "stacs", + "watches", + }, + size = 40, + position = "left", + }, + { + elements = { + "repl", + "console", + }, + size = 10, + position = "bottom", + }, + }, + + -- sidebar = { + -- elements = { + -- { + -- id = "scopes", + -- size = 0.25, -- Can be float or integer > 1 + -- }, + -- { id = "breakpoints", size = 0.25 }, + -- }, + -- size = 40, + -- position = "right", -- Can be "left", "right", "top", "bottom" + -- }, + -- tray = { + -- elements = {}, + -- }, +}) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) diff --git a/lua/user/mason/mason-installer.lua b/lua/user/mason/mason-installer.lua index 8c8329a..63dc451 100644 --- a/lua/user/mason/mason-installer.lua +++ b/lua/user/mason/mason-installer.lua @@ -145,9 +145,14 @@ for _, server in pairs(servers) do goto continue end + + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.offsetEncoding = { "utf-16" } + if server == "clangd" then require("clangd_extensions").setup({ server = { + capabilities = capabilities, -- options to pass to nvim-lspconfig -- i.e. the arguments to require("lspconfig").clangd.setup({}) }, diff --git a/lua/user/mason/null-ls.lua b/lua/user/mason/null-ls.lua index 89be0dc..8fc96ed 100644 --- a/lua/user/mason/null-ls.lua +++ b/lua/user/mason/null-ls.lua @@ -19,7 +19,7 @@ null_ls.setup({ sources = { formatting.prettier.with({ extra_filetypes = { "toml" }, - extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" }, + extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote", "--no-bracket-spacing" }, }), formatting.autopep8, formatting.stylua, @@ -29,7 +29,7 @@ null_ls.setup({ diagnostics.cpplint, diagnostics.luacheck, diagnostics.pylint, - -- diagnostics.mypy, + diagnostics.mypy, diagnostics.zsh, }, }) diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index 33f372b..97d2b56 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -238,13 +238,22 @@ local mappings = { }, L = { name = "Language settings", - c = { "setlocal formatoptions-=cro", "Disable autocomment" }, - C = { "setlocal formatoptions=cro", "Enable autocomment" }, - s = { "setlocal spell!", "Toggle spellchecker" }, - e = { "setlocal spell spelllang=en_us", "Enable English spellchecker" }, - l = { "setlocal spell spelllang=lv_LV", "Enable Lavian spellchecker" }, - I = { "setlocal autoindent", "Enable autoindent" }, - i = { "setlocal noautoindent", "Disable autoindent" }, + c = { "setlocal formatoptions-=cro", "Disable autocomment" }, + C = { "setlocal formatoptions=cro", "Enable autocomment" }, + s = { "setlocal spell!", "Toggle spellchecker" }, + e = { "setlocal spell spelllang=en_us", "Enable English spellchecker" }, + l = { "setlocal spell spelllang=lv_LV", "Enable Lavian spellchecker" }, + I = { "setlocal autoindent", "Enable autoindent" }, + i = { "setlocal noautoindent", "Disable autoindent" }, + }, + d = { + name = "DAP", + d = { "lua require('dap').toggle_breakpoint()", "Set breakpoint" }, + t = { "lua require('dapui').toggle()", "Toggle DAP-UI" }, + c = { "lua require('dap').continue()", "Launch debug sessions and resume execution" }, + o = { "lua require('dap').step_over()", "Step over code" }, + i = { "lua require('dap').step_into()", "Step into code" }, + r = { "lua require('dap).repl.open()", "Inspect state" }, }, }