This commit is contained in:
Nico
2025-04-07 23:06:16 +02:00
parent 0b2e29fa76
commit a764ae7695
14 changed files with 340 additions and 126 deletions

View File

@@ -10,7 +10,6 @@
./emacs
./kitty
./rofi
./tmux
./hyprland
# ./vscode
];

View File

@@ -62,6 +62,11 @@ bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Mediakeys
bind = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +1%
bind = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -1%
bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle
# will switch to a submap called resize
bind = $mainMod, R, submap, resize

View File

@@ -6,6 +6,7 @@
nil
ripgrep
lldb
lazygit
gcc
];
@@ -17,7 +18,6 @@ programs.neovim = {
programs.neovim.plugins = [
pkgs.vimPlugins.lazy-nvim
pkgs.vimPlugins.nvim-lspconfig
];
home.file =
@@ -25,8 +25,11 @@ programs.neovim.plugins = [
{
".config/nvim/init.lua".source = ./init.lua;
".config/nvim/lua/config/lazy.lua".source = ./lua/config/lazy.lua;
# ".config/nvim/lua/plugins/flutter.lua".source = ./lua/plugins/flutter.lua;
".config/nvim/lua/plugins/coq.lua".source = ./lua/plugins/coq.lua;
".config/nvim/lua/plugins/flutter.lua".source = ./lua/plugins/flutter.lua;
# ".config/nvim/lua/plugins/coq.lua".source = ./lua/plugins/coq.lua;
".config/nvim/lua/plugins/blink-cmp.lua".source = ./lua/plugins/blink-cmp.lua;
".config/nvim/lua/plugins/lsp.lua".source = ./lua/plugins/lsp.lua;
# ".config/nvim/lua/plugins/mason.lua".source = ./lua/plugins/mason.lua;
".config/nvim/lua/plugins/treesitter.lua".source = ./lua/plugins/treesitter.lua;
".config/nvim/lua/plugins/catppuccin.lua".source = ./lua/plugins/catppuccin.lua;
".config/nvim/lua/plugins/telescope.lua".source = ./lua/plugins/telescope.lua;
@@ -39,6 +42,7 @@ programs.neovim.plugins = [
".config/nvim/lua/plugins/dap.lua".source = ./lua/plugins/dap.lua;
".config/nvim/lua/plugins/blankline.lua".source = ./lua/plugins/blankline.lua;
".config/nvim/lua/plugins/rustaceanvim.lua".source = ./lua/plugins/rustaceanvim.lua;
".config/nvim/lua/plugins/lazygit.lua".source = ./lua/plugins/lazygit.lua;
}
];
}

View File

@@ -31,11 +31,12 @@ vim.keymap.set('n', '<C-Down>', ':resize +2<CR>', opts)
vim.keymap.set('n', '<C-Left>', ':vertical resize -2<CR>', opts)
vim.keymap.set('n', '<C-Right>', ':vertical resize +2<CR>', opts)
vim.keymap.set('i', 'jk', '<Esc>', opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
-- Lazy
require("config.lazy")
-- require("flutter-tools").setup {} -- use defaults
require("catppuccin").setup({
integrations = {
@@ -51,7 +52,6 @@ require("catppuccin").setup({
}
})
-- css colors
vim.opt.termguicolors = true
require('nvim-highlight-colors').setup({})
@@ -59,69 +59,101 @@ require('nvim-highlight-colors').setup({})
vim.cmd.colorscheme "catppuccin"
-- lsp
local on_attach = function(_, bufnr)
local bufmap = function(keys, func)
vim.keymap.set('n', keys, func, { buffer = bufnr })
end
bufmap('<leader>r', vim.lsp.buf.rename)
bufmap('<leader>a', vim.lsp.buf.code_action)
bufmap('gd', vim.lsp.buf.definition)
bufmap('gD', vim.lsp.buf.declaration)
bufmap('gI', vim.lsp.buf.implementation)
bufmap('<leader>D', vim.lsp.buf.type_definition)
bufmap('gr', require('telescope.builtin').lsp_references)
bufmap('<leader>s', require('telescope.builtin').lsp_document_symbols)
bufmap('<leader>S', require('telescope.builtin').lsp_dynamic_workspace_symbols)
bufmap('K', vim.lsp.buf.hover)
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, {})
end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('coq').lsp_ensure_capabilities(capabilities)
require('lspconfig').lua_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = function()
return vim.loop.cwd()
end,
cmd = { "lua-language-server" },
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
}
}
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
}
--[[ require('lspconfig').rust_analyzer.setup {
on_attach = on_attach,
capabilities = capabilities,
} ]]
-- Plugin setups
require('lualine').setup()
require("dapui").setup()
require("ibl").setup()
require("telescope").load_extension("flutter")
-- -- Debugger
-- alternatively you can override the default configs
require("flutter-tools").setup {
ui = {
-- the border type to use for all floating windows, the same options/formats
-- used for ":h nvim_open_win" e.g. "single" | "shadow" | {<table-of-eight-chars>}
border = "rounded",
-- This determines whether notifications are show with `vim.notify` or with the plugin's custom UI
-- please note that this option is eventually going to be deprecated and users will need to
-- depend on plugins like `nvim-notify` instead.
notification_style = 'plugin'
},
decorations = {
statusline = {
-- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline
-- this will show the current version of the flutter app from the pubspec.yaml file
app_version = false,
-- set to true to be able use the 'flutter_tools_decorations.device' in your statusline
-- this will show the currently running device if an application was started with a specific
-- device
device = true,
-- set to true to be able use the 'flutter_tools_decorations.project_config' in your statusline
-- this will show the currently selected project configuration
project_config = false,
}
},
debugger = { -- integrate with nvim dap + install dart code debugger
enabled = true,
-- if empty dap will not stop on any exceptions, otherwise it will stop on those specified
-- see |:help dap.set_exception_breakpoints()| for more info
exception_breakpoints = { "uncaught" },
-- Whether to call toString() on objects in debug views like hovers and the
-- variables list.
-- Invoking toString() has a performance cost and may introduce side-effects,
-- although users may expected this functionality. null is treated like false.
evaluate_to_string_in_debug_views = true,
},
flutter_lookup_cmd = nil, -- example "dirname $(which flutter)" or "asdf where flutter"
root_patterns = { ".git", "pubspec.yaml" }, -- patterns to find the root of your flutter project
fvm = false, -- takes priority over path, uses <workspace>/.fvm/flutter_sdk if enabled
widget_guides = {
enabled = true,
},
closing_tags = {
highlight = "ErrorMsg", -- highlight for the closing tag
prefix = ">", -- character to use for close tag e.g. > Widget
priority = 10, -- priority of virtual text in current line
-- consider to configure this when there is a possibility of multiple virtual text items in one line
-- see `priority` option in |:help nvim_buf_set_extmark| for more info
enabled = true -- set to false to disable
},
dev_log = {
enabled = true,
filter = nil, -- optional callback to filter the log
-- takes a log_line as string argument; returns a boolean or nil;
-- the log_line is only added to the output if the function returns true
notify_errors = false, -- if there is an error whilst running then notify the user
open_cmd = "15split", -- command to use to open the log buffer
focus_on_open = true, -- focus on the newly opened log window
},
dev_tools = {
autostart = false, -- autostart devtools server if not detected
auto_open_browser = false, -- Automatically opens devtools in the browser
},
outline = {
open_cmd = "30vnew", -- command to use to open the outline buffer
auto_open = false -- if true this will open the outline automatically when it is first populated
},
lsp = {
color = { -- show the derived colours for dart variables
enabled = true, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10
background = true, -- highlight the background
background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},)
foreground = false, -- highlight the foreground
virtual_text = true, -- show the highlight using virtual text
virtual_text_str = "", -- the virtual text character to highlight
},
-- see the link below for details on each option:
-- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration
settings = {
showTodos = true,
completeFunctionCalls = true,
renameFilesWithClasses = "prompt", -- "always"
enableSnippets = true,
updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command.
}
}
}
------------- -- Debugger
local dap, dapui = require("dap"), require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
@@ -145,6 +177,16 @@ dap.adapters.lldb = {
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
--------------------------------------------
local builtin = require('telescope.builtin')
-- Telescope binds
@@ -152,7 +194,7 @@ vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find f
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', ":Telescope file_browser<CR>", { desc = 'Telescope file_browser' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
vim.keymap.set('n', '<leader>fl', ": Telescope flutter commands<CR>", { desc = "Open Telescope flutter" })
-- Dap binds
vim.keymap.set('n', '<leader>do', dapui.open, { desc = "Open debug overlay" })
vim.keymap.set('n', '<leader>dc', dapui.close, { desc = "Close debug overlay" })

View File

@@ -21,6 +21,7 @@ vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {

View File

@@ -0,0 +1,48 @@
return {
'saghen/blink.cmp',
-- optional: provides snippets for the snippet source
dependencies = { 'rafamadriz/friendly-snippets' },
-- use a release tag to download pre-built binaries
version = '1.*',
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- See :h blink-cmp-config-keymap for defining your own keymap
keymap = {
preset = 'enter',
-- map tap to cycle through
['<S-Tab>'] = { 'select_prev', 'fallback' },
['<Tab>'] = { 'select_next', 'fallback' },
},
appearance = {
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- Adjusts spacing to ensure icons are aligned
nerd_font_variant = 'mono'
},
-- (Default) Only show the documentation popup when manually triggered
completion = { documentation = { auto_show = false } },
-- Default list of enabled providers defined so that you can extend it
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
--
-- See the fuzzy documentation for more information
fuzzy = { implementation = "prefer_rust_with_warning" }
},
opts_extend = { "sources.default" }
}

View File

@@ -0,0 +1,21 @@
-- nvim v0.8.0
return {
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
}

View File

@@ -1,53 +1,30 @@
local on_attach = function(_, bufnr)
return {
'neovim/nvim-lspconfig',
dependencies = { 'saghen/blink.cmp' },
local bufmap = function(keys, func)
vim.keymap.set('n', keys, func, { buffer = bufnr })
-- example using `opts` for defining servers
opts = {
servers = {
lua_ls = {},
nil_ls = {},
rust_analyzer = {}
}
},
config = function(_, opts)
local lspconfig = require('lspconfig')
for server, config in pairs(opts.servers) do
-- passing config.capabilities to blink.cmp merges with the capabilities in your
-- `opts[server].capabilities, if you've defined it
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end
bufmap('<leader>r', vim.lsp.buf.rename)
bufmap('<leader>a', vim.lsp.buf.code_action)
bufmap('gd', vim.lsp.buf.definition)
bufmap('gD', vim.lsp.buf.declaration)
bufmap('gI', vim.lsp.buf.implementation)
bufmap('<leader>D', vim.lsp.buf.type_definition)
bufmap('gr', require('telescope.builtin').lsp_references)
bufmap('<leader>s', require('telescope.builtin').lsp_document_symbols)
bufmap('<leader>S', require('telescope.builtin').lsp_dynamic_workspace_symbols)
bufmap('K', vim.lsp.buf.hover)
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, {})
end
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('coq').lsp_capabilities(capabilities) -- COQ spezifische Fähigkeiten
require('neodev').setup()
require('lspconfig').lua_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
root_dir = function()
return vim.loop.cwd()
end,
cmd = { "lua-language-server" },
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
}
-- -- example calling setup directly for each LSP
-- config = function()
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
-- local lspconfig = require('lspconfig')
--
-- lspconfig['lua_ls'].setup({ capabilities = capabilities })
-- end
}
require('lspconfig').nil_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require('lspconfig').rust_analyzer.setup {
on_attach = on_attach,
capabilities = capabilities,
}

View File

@@ -0,0 +1,37 @@
return {
"williamboman/mason.nvim",
cmd = "Mason",
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
build = ":MasonUpdate",
opts_extend = { "ensure_installed" },
opts = {
ensure_installed = {
"stylua",
"shfmt",
},
},
---@param opts MasonSettings | {ensure_installed: string[]}
config = function(_, opts)
require("mason").setup(opts)
local mr = require("mason-registry")
mr:on("package:install:success", function()
vim.defer_fn(function()
-- trigger FileType event to possibly load this newly installed LSP server
require("lazy.core.handler.event").trigger({
event = "FileType",
buf = vim.api.nvim_get_current_buf(),
})
end, 100)
end)
mr.refresh(function()
for _, tool in ipairs(opts.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end)
end,
}

View File

@@ -38,7 +38,7 @@ window#waybar {
margin-left: 6px;
}
#workspaces button.focused{
#workspaces button.active{
background: @mauve;
color: @base;
opacity: 0.8;