Minor fixes

This commit is contained in:
Kristofers Solo 2022-11-27 23:22:11 +02:00
parent e0f8c76dd4
commit fb9f1ab0c3
5 changed files with 81 additions and 58 deletions

View File

@ -4,7 +4,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" },
callback = function() callback = function()
vim.cmd([[ vim.cmd([[
nnoremap <silent> <buffer> q :close<CR> nnoremap <silent> <buffer> q :close<cr>
set nobuflisted set nobuflisted
]]) ]])
end, end,
@ -26,7 +26,7 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "gitcommit", "markdown", "vimwiki" }, pattern = { "gitcommit", "markdown", "vimwiki" },
callback = function() callback = function()
vim.opt_local.wrap = true vim.opt_local.wrap = true
vim.opt_local.spell = true -- vim.opt_local.spell = true
end, end,
}) })
@ -74,10 +74,19 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
vim.cmd([[ vim.cmd([[
highlight CursorLine ctermbg=White cterm=bold guibg=#222222 highlight CursorLine ctermbg=White cterm=bold guibg=#222222
highlight CursorColumn ctermbg=White cterm=bold guibg=#222222 highlight CursorColumn ctermbg=White cterm=bold guibg=#222222
autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "!python3" shellescape(@%, 1)<CR> autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!python3" shellescape(@%, 1)<cr>
autocmd FileType python map <buffer> <C-b> <cmd>w<CR><cmd>exec "!python3" shellescape(@%, 1)<CR> autocmd FileType python map <buffer> <C-b> <cmd>w<cr><cmd>exec "!python3" shellescape(@%, 1)<cr>
autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "!cargo run"<CR> autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType rust map <buffer> <C-b> <cmd>w<CR><cmd>exec "!cargo run"<CR> autocmd FileType rust map <buffer> <C-b> <cmd>w<cr><cmd>exec "!cargo run"<cr>
autocmd FileType tex imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "silent !lualatex %"<CR> autocmd FileType tex imap <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
autocmd FileType tex map <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "silent !lualatex %"<CR> autocmd FileType tex map <buffer> <C-b> <esc><cmd>w<cr><cmd>exec "silent !lualatex %"<cr>
]])
-- 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 <afile>
autocmd BufWritePost ~/Nextcloud/solorice/.config/waybar/style.css silent !pkill waybar && waybar & disown <afile>
augroup end
]]) ]])

View File

@ -8,10 +8,10 @@ if not dap_status_ok then
return return
end end
-- local dap_ui_status_ok, dapui = pcall(require, "dapui") local dap_ui_status_ok, dapui = pcall(require, "dapui")
-- if not dap_ui_status_ok then if not dap_ui_status_ok then
-- return return
-- end end
local dap_install_status_ok, dap_install = pcall(require, "dap-install") local dap_install_status_ok, dap_install = pcall(require, "dap-install")
if not dap_install_status_ok then if not dap_install_status_ok then
@ -27,43 +27,43 @@ dap_install.setup({})
dap_install.config("python", {}) dap_install.config("python", {})
-- add other configs here -- add other configs here
-- dapui.setup({ dapui.setup({
-- layouts = { layouts = {
-- { {
-- elements = { elements = {
-- "scopes", "scopes",
-- "breakpoints", "breakpoints",
-- "stacs", "stacs",
-- "watches", "watches",
-- }, },
-- size = 40, size = 40,
-- position = "left", position = "left",
-- }, },
-- { {
-- elements = { elements = {
-- "repl", "repl",
-- "console", "console",
-- }, },
-- size = 10, size = 10,
-- position = "bottom", position = "bottom",
-- }, },
-- }, },
--
-- -- sidebar = { -- sidebar = {
-- -- elements = { -- elements = {
-- -- { -- {
-- -- id = "scopes", -- id = "scopes",
-- -- size = 0.25, -- Can be float or integer > 1 -- size = 0.25, -- Can be float or integer > 1
-- -- }, -- },
-- -- { id = "breakpoints", size = 0.25 }, -- { id = "breakpoints", size = 0.25 },
-- -- }, -- },
-- -- size = 40, -- size = 40,
-- -- position = "right", -- Can be "left", "right", "top", "bottom" -- position = "right", -- Can be "left", "right", "top", "bottom"
-- -- }, -- },
-- -- tray = { -- tray = {
-- -- elements = {}, -- elements = {},
-- -- }, -- },
-- }) })
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })

View File

@ -145,9 +145,14 @@ for _, server in pairs(servers) do
goto continue goto continue
end end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.offsetEncoding = { "utf-16" }
if server == "clangd" then if server == "clangd" then
require("clangd_extensions").setup({ require("clangd_extensions").setup({
server = { server = {
capabilities = capabilities,
-- options to pass to nvim-lspconfig -- options to pass to nvim-lspconfig
-- i.e. the arguments to require("lspconfig").clangd.setup({}) -- i.e. the arguments to require("lspconfig").clangd.setup({})
}, },

View File

@ -19,7 +19,7 @@ null_ls.setup({
sources = { sources = {
formatting.prettier.with({ formatting.prettier.with({
extra_filetypes = { "toml" }, 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.autopep8,
formatting.stylua, formatting.stylua,
@ -29,7 +29,7 @@ null_ls.setup({
diagnostics.cpplint, diagnostics.cpplint,
diagnostics.luacheck, diagnostics.luacheck,
diagnostics.pylint, diagnostics.pylint,
-- diagnostics.mypy, diagnostics.mypy,
diagnostics.zsh, diagnostics.zsh,
}, },
}) })

View File

@ -238,13 +238,22 @@ local mappings = {
}, },
L = { L = {
name = "Language settings", name = "Language settings",
c = { "<cmd>setlocal formatoptions-=cro<CR>", "Disable autocomment" }, c = { "<cmd>setlocal formatoptions-=cro<cr>", "Disable autocomment" },
C = { "<cmd>setlocal formatoptions=cro<CR>", "Enable autocomment" }, C = { "<cmd>setlocal formatoptions=cro<cr>", "Enable autocomment" },
s = { "<cmd>setlocal spell!<CR>", "Toggle spellchecker" }, s = { "<cmd>setlocal spell!<cr>", "Toggle spellchecker" },
e = { "<cmd>setlocal spell spelllang=en_us<CR>", "Enable English spellchecker" }, e = { "<cmd>setlocal spell spelllang=en_us<cr>", "Enable English spellchecker" },
l = { "<cmd>setlocal spell spelllang=lv_LV<CR>", "Enable Lavian spellchecker" }, l = { "<cmd>setlocal spell spelllang=lv_LV<cr>", "Enable Lavian spellchecker" },
I = { "<cmd>setlocal autoindent<CR>", "Enable autoindent" }, I = { "<cmd>setlocal autoindent<cr>", "Enable autoindent" },
i = { "<cmd>setlocal noautoindent<CR>", "Disable autoindent" }, i = { "<cmd>setlocal noautoindent<cr>", "Disable autoindent" },
},
d = {
name = "DAP",
d = { "<cmd>lua require('dap').toggle_breakpoint()<cr>", "Set breakpoint" },
t = { "<cmd>lua require('dapui').toggle()<cr>", "Toggle DAP-UI" },
c = { "<cmd>lua require('dap').continue()<cr>", "Launch debug sessions and resume execution" },
o = { "<cmd>lua require('dap').step_over()<cr>", "Step over code" },
i = { "<cmd>lua require('dap').step_into()<cr>", "Step into code" },
r = { "<cmd>lua require('dap).repl.open()<cr>", "Inspect state" },
}, },
} }