Browse Source

fix: update things

master
Tovi Jaeschke-Rogers 2 days ago
parent
commit
6260024dbc
12 changed files with 197 additions and 90 deletions
  1. +2
    -16
      .config/hypr/hyprland.conf
  2. +27
    -15
      .config/nvim/lua/core/remaps.lua
  3. +1
    -0
      .config/nvim/lua/plugins/alpha.lua
  4. +55
    -0
      .config/nvim/lua/plugins/avante.lua
  5. +0
    -16
      .config/nvim/lua/plugins/cloak.lua
  6. +47
    -34
      .config/nvim/lua/plugins/conform.lua
  7. +17
    -0
      .config/nvim/lua/plugins/dadbod.lua
  8. +22
    -0
      .config/nvim/lua/plugins/gitlab.lua
  9. +1
    -5
      .config/nvim/lua/plugins/laravel.lua
  10. +4
    -4
      .config/nvim/lua/plugins/lspconfig.lua
  11. +20
    -0
      .config/php-cs-fixer.php
  12. +1
    -0
      .config/zsh/.zshrc

+ 2
- 16
.config/hypr/hyprland.conf View File

@ -22,16 +22,8 @@ $menu = wofi --show drun
#################
exec-once = waybar
exec-once = hypridle
# exec-once = hypridle
exec-once = hyprpaper
# We want this to run every time the config is refreshed
exec-once = hyprctl plugin load /home/tovi/.config/hypr/hyprWorkspaceLayouts/workspaceLayoutPlugin.so
plugin {
wslayout {
default_layout=master
}
}
#############################
### ENVIRONMENT VARIABLES ###
@ -83,7 +75,7 @@ general {
# Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
allow_tearing = false
layout=workspacelayout
layout=master
}
# Master layout specific settings
@ -126,12 +118,6 @@ animations {
enabled = false
}
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # You probably want this
}
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
new_status = master


+ 27
- 15
.config/nvim/lua/core/remaps.lua View File

@ -35,10 +35,22 @@ vim.keymap.set("v", "<leader>d", '"_d', { desc = "Delete into black hole registe
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Scroll down half page" })
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Scroll up half page" })
-- Keep cursor centered
vim.keymap.set("n", "n", "nzzzv", { desc = "Next search result" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous search result" })
-- -- Keep cursor centered
-- vim.keymap.set("n", "n", function()
-- if vim.bo.filetype == "fugitive" then
-- return "n"
-- else
-- return "nzzzv"
-- end
-- end, { desc = "Next search result" })
-- vim.keymap.set("n", "N", function()
-- if vim.bo.filetype == "fugitive" then
-- return "N"
-- else
-- return "Nzzzv"
-- end
-- end, { desc = "Previous search result" })
--
-- Keep cursor centered when jumping through quickfix list
vim.keymap.set("n", "<leader>N", "<cmd>cprev<CR>zz", { desc = "Previous item in quickfix list" })
vim.keymap.set("n", "<leader>n", "<cmd>cnext<CR>zz", { desc = "Next item in quickfix list" })
@ -65,20 +77,20 @@ vim.keymap.set("n", "<leader>.f", function() vim.cmd("edit app/frontend/.env.dev
-- Delete a buffer, without closing the window, see https://stackoverflow.com/q/4465095/6064933
vim.keymap.set("n", [[\d]], "<cmd>bprevious <bar> bdelete #<cr>", {
silent = true,
desc = "delete current buffer",
silent = true,
desc = "delete current buffer",
})
vim.keymap.set("n", [[\D]], function()
local buf_ids = vim.api.nvim_list_bufs()
local cur_buf = vim.api.nvim_win_get_buf(0)
for _, buf_id in pairs(buf_ids) do
-- do not Delete unlisted buffers, which may lead to unexpected errors
if vim.api.nvim_get_option_value("buflisted", { buf = buf_id }) and buf_id ~= cur_buf then
vim.api.nvim_buf_delete(buf_id, { force = true })
local buf_ids = vim.api.nvim_list_bufs()
local cur_buf = vim.api.nvim_win_get_buf(0)
for _, buf_id in pairs(buf_ids) do
-- do not Delete unlisted buffers, which may lead to unexpected errors
if vim.api.nvim_get_option_value("buflisted", { buf = buf_id }) and buf_id ~= cur_buf then
vim.api.nvim_buf_delete(buf_id, { force = true })
end
end
end
end, {
desc = "delete other buffers",
desc = "delete other buffers",
})

+ 1
- 0
.config/nvim/lua/plugins/alpha.lua View File

@ -4,6 +4,7 @@ return {
'echasnovski/mini.icons',
'MaximilianLloyd/ascii.nvim',
},
enabled = false,
config = function ()
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")


+ 55
- 0
.config/nvim/lua/plugins/avante.lua View File

@ -0,0 +1,55 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
version = false,
keys = {
"<leader>A",
"<cmd>AvanteToggle<cr>"
},
opts = {
behaviour = {
auto_suggestions = false, -- Experimental stage
auto_set_highlight_group = true,
auto_set_keymaps = false,
auto_apply_diff_after_generation = false,
support_paste_from_clipboard = false,
minimize_diff = true, -- Whether to remove unchanged lines when applying a code block
enable_token_counting = true, -- Whether to enable token counting. Default to true.
},
},
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"echasnovski/mini.pick",
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}

+ 0
- 16
.config/nvim/lua/plugins/cloak.lua View File

@ -1,16 +0,0 @@
return {
"laytan/cloak.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("cloak").setup({
enabled = true,
patterns = {
{
file_pattern = ".env*",
cloak_pattern = "=.+",
replace = "*",
},
},
})
end,
}

+ 47
- 34
.config/nvim/lua/plugins/conform.lua View File

@ -1,40 +1,53 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
go = { "goimports", "gofmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
vue = { "prettierd" },
css = { "prettierd" },
html = { "prettierd" },
markdown = { "prettierd" },
json = { "fixjson" },
rust = { "rustfmt" },
shell = { "shfmt", "shellcheck" },
python = { "isort", "black" },
php = { "phpcbf" },
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
go = { "goimports", "gofmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
vue = { "prettierd" },
css = { "prettierd" },
html = { "prettierd" },
markdown = { "prettierd" },
json = { "fixjson" },
rust = { "rustfmt" },
shell = { "shfmt", "shellcheck" },
python = { "isort", "black" },
php = { "phpcbf", "php_cs_fixer" },
blade = { "blade-formatter" }
},
log_level = vim.log.levels.WARN,
notify_on_error = false,
})
},
log_level = vim.log.levels.WARN,
notify_on_error = false,
})
vim.keymap.set({ "n", "v" }, "<leader>F", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end)
vim.keymap.set({ "n", "v" }, "<leader>F", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end)
conform.formatters.phpcbf = {
prepend_args = { "--standard=~/.config/phpcs.xml" },
}
end,
vim.fn.mkdir(vim.fn.expand("~/.cache/php-cs-fixer"), "p")
conform.formatters.php_cs_fixer = {
prepend_args = {
"--config=" .. vim.fn.expand("~/.config/php-cs-fixer.php"),
"--cache-file=" .. vim.fn.expand("~/.cache/php-cs-fixer/cache"),
},
env = {
PHP_CS_FIXER_IGNORE_ENV = "1",
},
}
conform.formatters.phpcbf = {
prepend_args = { "--standard=~/.config/phpcs.xml" },
}
end,
}

+ 17
- 0
.config/nvim/lua/plugins/dadbod.lua View File

@ -18,5 +18,22 @@ return {
vim.g.dbs = {
dev = 'mariadb://jack:secret@localhost:33061/jack?ssl=false',
}
vim.api.nvim_create_user_command('DBUITab', function()
vim.cmd('tabnew')
vim.cmd('DBUI')
end, { desc = 'Open DBUI in a new tab' })
vim.keymap.set('n', '<leader>db', function ()
vim.cmd('tabnew')
vim.cmd('DBUI')
end, { desc = 'Open DBUI in a new tab' })
vim.api.nvim_create_autocmd("FileType", {
pattern = {"dbout", "dbui"},
callback = function()
vim.opt_local.foldenable = false
end,
})
end,
}

+ 22
- 0
.config/nvim/lua/plugins/gitlab.lua View File

@ -0,0 +1,22 @@
return {
"harrisoncramer/gitlab.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
},
build = function() require("gitlab.server").build(true) end, -- Builds the Go binary
config = function()
require("gitlab").setup()
vim.api.nvim_create_user_command("GChoose", function()
require("gitlab").choose_merge_request()
end, { desc = "Choose a GitLab merge request" })
vim.api.nvim_create_user_command("GReview", function()
require("gitlab").review()
end, { desc = "Start GitLab review" })
end,
}

+ 1
- 5
.config/nvim/lua/plugins/laravel.lua View File

@ -7,11 +7,7 @@ return {
"kevinhwang91/promise-async",
},
cmd = { "Laravel" },
keys = {
{ "<leader>la", ":Laravel artisan<cr>" },
{ "<leader>lr", ":Laravel routes<cr>" },
{ "<leader>lm", ":Laravel related<cr>" },
},
keys = {},
event = { "VeryLazy" },
opts = {
lsp_server = "intelephense",


+ 4
- 4
.config/nvim/lua/plugins/lspconfig.lua View File

@ -176,7 +176,7 @@ return {
intelephense = {
format = {
enable = true,
sortUseStatements = false,
sortUseStatements = true,
},
},
},
@ -215,9 +215,9 @@ return {
},
},
dartls = {
cmd = { "/opt/flutter/bin/dart", "language-server", "--protocol=lsp" },
},
-- dartls = {
-- cmd = { "/opt/flutter/bin/dart", "language-server", "--protocol=lsp" },
-- },
rust_analyzer = {
diagnostics = {


+ 20
- 0
.config/php-cs-fixer.php View File

@ -0,0 +1,20 @@
<?php
return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'function', 'const'],
],
'no_unused_imports' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
);

+ 1
- 0
.config/zsh/.zshrc View File

@ -91,6 +91,7 @@ function cdf () {
# Android dev config
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_SDK_ROOT=/home/tovi/Android/Sdk
if [[ $(uname) == 'Darwin' ]]; then
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"


Loading…
Cancel
Save