Compare commits
6 commits
ea29d6f7ac
...
5caa0dec76
Author | SHA1 | Date | |
---|---|---|---|
5caa0dec76 | |||
f72c504afd | |||
80cd03dd36 | |||
cc64429d00 | |||
b2233c485a | |||
a1de7af016 |
9 changed files with 136 additions and 81 deletions
symlinks
bin
config
aerc
nvim
after/ftplugin
lua/esensar
plugin
sway/conf.d
|
@ -75,7 +75,7 @@ mouse_waybar () {
|
|||
CURR_DATE=$( date +%s )
|
||||
DIFF=$(( CURR_DATE - UPG_DATE ))
|
||||
if (( DIFF > 32 )); then
|
||||
BATTERY_LEVEL=$(rivalcfg --battery-level)
|
||||
BATTERY_LEVEL=$(rivalcfg --battery-level 2> /dev/null)
|
||||
echo $CURR_DATE > $LAST_UPDATE_FILE
|
||||
echo $BATTERY_LEVEL > $LAST_STATUS_FILE
|
||||
else
|
||||
|
|
|
@ -81,7 +81,7 @@ H = :toggle-headers<Enter>
|
|||
J = :next<Enter>
|
||||
K = :prev<Enter>
|
||||
|
||||
C = :pipe -m khard add-email<Enter>
|
||||
C = :pipe -m khard add-email -H all<Enter>
|
||||
|
||||
[view::passthrough]
|
||||
$noinherit = true
|
||||
|
|
1
symlinks/config/nvim/after/ftplugin/wgsl.vim
Normal file
1
symlinks/config/nvim/after/ftplugin/wgsl.vim
Normal file
|
@ -0,0 +1 @@
|
|||
setlocal commentstring=//\ %s
|
|
@ -204,6 +204,7 @@ return require("lazy").setup({
|
|||
"hrsh7th/cmp-nvim-lua", -- Nvim-Lua source for nvim-cmp
|
||||
"hrsh7th/cmp-omni", -- omnifunc source for nvim-cmp
|
||||
"hrsh7th/nvim-cmp", -- completion integration
|
||||
"rcarriga/cmp-dap", -- DAP nvim-cmp
|
||||
"mhartington/formatter.nvim", -- formatting support
|
||||
"mfussenegger/nvim-lint", -- linting support
|
||||
{
|
||||
|
|
|
@ -8,6 +8,9 @@ local cmp = require("cmp")
|
|||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
enabled = function()
|
||||
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt" or require("cmp_dap").is_dap_buffer()
|
||||
end,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
|
@ -79,5 +82,11 @@ cmp.setup.filetype("ledger", {
|
|||
},
|
||||
})
|
||||
|
||||
cmp.setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
|
||||
sources = {
|
||||
{ name = "dap" },
|
||||
},
|
||||
})
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
|
|
|
@ -2,55 +2,57 @@
|
|||
-- - LSP diagnostics config -
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
python = {
|
||||
require("formatter.filetypes.python").isort,
|
||||
require("formatter.filetypes.python").autopep8,
|
||||
if not vim.g.disable_formatting then
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
python = {
|
||||
require("formatter.filetypes.python").isort,
|
||||
require("formatter.filetypes.python").autopep8,
|
||||
},
|
||||
kotlin = {
|
||||
require("formatter.filetypes.kotlin").ktlint,
|
||||
require("formatter.filetypes.kotlin").detekt,
|
||||
},
|
||||
cpp = {
|
||||
require("formatter.filetypes.cpp").clangformat,
|
||||
},
|
||||
c = {
|
||||
require("formatter.filetypes.c").clangformat,
|
||||
},
|
||||
cmake = {
|
||||
require("formatter.filetypes.cmake").cmakeformat,
|
||||
},
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
},
|
||||
dart = {
|
||||
require("formatter.filetypes.dart").dartformat,
|
||||
},
|
||||
go = {
|
||||
require("formatter.filetypes.go").gofmt,
|
||||
},
|
||||
rust = {
|
||||
require("formatter.filetypes.rust").rustfmt,
|
||||
},
|
||||
zig = {
|
||||
require("formatter.filetypes.zig").zigfmt,
|
||||
},
|
||||
java = {
|
||||
require("esensar.lsp.formatters.clang-format-java"),
|
||||
},
|
||||
godot = {
|
||||
require("esensar.lsp.formatters.gdformat"),
|
||||
},
|
||||
xml = {
|
||||
require("formatter.filetypes.xml").xmlformat,
|
||||
require("formatter.filetypes.xml").xmllint,
|
||||
},
|
||||
["*"] = {
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
},
|
||||
kotlin = {
|
||||
require("formatter.filetypes.kotlin").ktlint,
|
||||
require("formatter.filetypes.kotlin").detekt,
|
||||
},
|
||||
cpp = {
|
||||
require("formatter.filetypes.cpp").clangformat,
|
||||
},
|
||||
c = {
|
||||
require("formatter.filetypes.c").clangformat,
|
||||
},
|
||||
cmake = {
|
||||
require("formatter.filetypes.cmake").cmakeformat,
|
||||
},
|
||||
lua = {
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
},
|
||||
dart = {
|
||||
require("formatter.filetypes.dart").dartformat,
|
||||
},
|
||||
go = {
|
||||
require("formatter.filetypes.go").gofmt,
|
||||
},
|
||||
rust = {
|
||||
require("formatter.filetypes.rust").rustfmt,
|
||||
},
|
||||
zig = {
|
||||
require("formatter.filetypes.zig").zigfmt,
|
||||
},
|
||||
java = {
|
||||
require("esensar.lsp.formatters.clang-format-java"),
|
||||
},
|
||||
godot = {
|
||||
require("esensar.lsp.formatters.gdformat"),
|
||||
},
|
||||
xml = {
|
||||
require("formatter.filetypes.xml").xmlformat,
|
||||
require("formatter.filetypes.xml").xmllint,
|
||||
},
|
||||
["*"] = {
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
end
|
||||
|
||||
require("lint").linters_by_ft = {
|
||||
python = { "flake8" },
|
||||
|
@ -103,7 +105,9 @@ vim.api.nvim_create_user_command("Format", vim.lsp.buf.format, { desc = "Format
|
|||
-- Auto linting
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
vim.cmd("FormatWrite")
|
||||
if not vim.g.disable_formatting then
|
||||
vim.cmd("FormatWrite")
|
||||
end
|
||||
require("lint").try_lint()
|
||||
require("lint").try_lint({ "codespell" })
|
||||
require("lint").try_lint({ "misspell" })
|
||||
|
|
|
@ -94,6 +94,9 @@ require("flutter-tools").setup({
|
|||
|
||||
-- Rust tools
|
||||
vim.g.rustaceanvim = vim.tbl_deep_extend("force", vim.g.rustaceanvim or {}, {
|
||||
dap = {
|
||||
configuration = false,
|
||||
},
|
||||
server = vim.tbl_extend("force", common_config, {
|
||||
on_attach = function(client, bufnr)
|
||||
common_config.on_attach(client, bufnr)
|
||||
|
|
|
@ -76,13 +76,43 @@ local function args_input()
|
|||
return vim.split(vim.fn.input("Args: "), " ")
|
||||
end
|
||||
|
||||
local function server_input()
|
||||
return vim.fn.input("Server to connect to: ")
|
||||
end
|
||||
|
||||
-- Additional servers
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = "codelldb",
|
||||
command = "lldb",
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.adapters.rustlldb = {
|
||||
type = "executable",
|
||||
command = "rust-lldb",
|
||||
name = "rustlldb",
|
||||
}
|
||||
|
||||
dap.adapters.gdb = {
|
||||
name = "gdb",
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--quiet", "--interpreter=dap", "--eval-command", "set print pretty on" },
|
||||
}
|
||||
|
||||
dap.adapters.rustgdb = {
|
||||
name = "rustgdb",
|
||||
type = "executable",
|
||||
command = "rust-gdb",
|
||||
args = { "--quiet", "--interpreter=dap", "--eval-command", "set print pretty on" },
|
||||
}
|
||||
|
||||
dap.adapters.codelldb = {
|
||||
type = "executable",
|
||||
command = "codelldb",
|
||||
name = "codelldb",
|
||||
}
|
||||
|
||||
dap.adapters.nlua = function(callback, config)
|
||||
callback({ type = "server", host = config.host, port = config.port })
|
||||
end
|
||||
|
@ -90,65 +120,62 @@ end
|
|||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = executable_input,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
|
||||
runInTerminal = false,
|
||||
-- 💀
|
||||
-- If you use `runInTerminal = true` and resize the terminal window,
|
||||
-- lldb-vscode will receive a `SIGWINCH` signal which can cause problems
|
||||
-- To avoid that uncomment the following option
|
||||
-- See https://github.com/mfussenegger/nvim-dap/issues/236#issuecomment-1066306073
|
||||
postRunCommands = { "process handle -p true -s false -n false SIGWINCH" },
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Launch with args",
|
||||
type = "lldb",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = executable_input,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = args_input,
|
||||
runInTerminal = false,
|
||||
postRunCommands = { "process handle -p true -s false -n false SIGWINCH" },
|
||||
},
|
||||
{
|
||||
name = "Attach to process",
|
||||
type = "lldb",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = executable_input,
|
||||
pid = require("dap.utils").pick_process,
|
||||
args = {},
|
||||
},
|
||||
{
|
||||
name = "Attach to PID",
|
||||
type = "lldb",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = executable_input,
|
||||
pid = function()
|
||||
return tonumber(vim.fn.input("PID: "))
|
||||
end,
|
||||
args = {},
|
||||
},
|
||||
{
|
||||
name = "Attach to gdbserver",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
target = server_input,
|
||||
program = executable_input,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
dap.configurations.zig = dap.configurations.cpp
|
||||
|
||||
local rust_config = {}
|
||||
for _, item in ipairs(dap.configurations.cpp) do
|
||||
table.insert(
|
||||
rust_config,
|
||||
vim.tbl_extend("force", item, {
|
||||
type = "rustgdb",
|
||||
})
|
||||
)
|
||||
end
|
||||
dap.configurations.rust = rust_config
|
||||
|
||||
dap.configurations.lua = {
|
||||
{
|
||||
type = "nlua",
|
||||
|
|
|
@ -59,3 +59,13 @@ bindsym $mod+Shift+minus move scratchpad
|
|||
bindsym $mod+minus scratchpad show
|
||||
|
||||
bindsym $mod+t layout toggle tabbed split
|
||||
|
||||
# Swipe to swap workspaces
|
||||
bindgesture swipe:right workspace prev
|
||||
bindgesture swipe:left workspace next
|
||||
|
||||
# Allow container movements by pinching them
|
||||
bindgesture pinch:inward+up move up
|
||||
bindgesture pinch:inward+down move down
|
||||
bindgesture pinch:inward+left move left
|
||||
bindgesture pinch:inward+right move right
|
||||
|
|
Loading…
Add table
Reference in a new issue