fix neovim LSP issues

This commit is contained in:
Johannes Knopp
2026-03-16 23:44:52 +01:00
parent 545f8ab328
commit 9fbffb7558
7 changed files with 132 additions and 78 deletions

View File

@ -30,10 +30,13 @@ exec-once = dunst
exec-once = firefox
exec-once = hyprpaper
exec-once = [workspace 9 silent] deezer-desktop
exec-once = scripts/close-monokai-popup.sh
exec-once = ./scripts/close-monokai-popup.sh
# gnome keyring secret service
exec-once = dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE
# exec-once = systemctl --user stop xdg-desktop-portal-hyprland xdg-desktop-portal-gtk xdg-desktop-portal
# exec-once = systemctl --user start xdg-desktop-portal-hyprland
debug:disable_logs = false
#############################
### ENVIRONMENT VARIABLES ###
@ -59,6 +62,10 @@ env = GDK_BACKEND,wayland,x11
env = _JAVA_AWT_WM_NONREPARENTING, 1
# env = AWT_TOOLKIT, MToolkit
# Force Hyprland to use the RX 9070 XT
# env = AQ_DRM_DEVICES,$HOME/.config/hypr/dgpu
# env = WLR_DRM_DEVICES,$HOME/.config/hypr/dgpu
###################
### PERMISSIONS ###
###################
@ -137,6 +144,10 @@ decoration {
}
}
cursor {
no_hardware_cursors = true
}
# wofi
# layerrule = blur, wofi # apply compositor blur
# layerrule = ignorezero, wofi # keep blur even on near-opaque colors
@ -245,12 +256,13 @@ bind = $mainMod, Q, killactive,
bind = $mainMod, N, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, Space, exec, $menu
bind = $mainMod, G, togglesplit, # dwindle
bind = $mainMod, G, layoutmsg, togglesplit # dwindle
bind = $mainMod, F, fullscreen, 1
bind = $mainMod SHIFT, F, fullscreen, 0
bind = $mainMod, B, exec, firefox
bind = $mainMod, M, exec, thunderbird
bind = $mainMod, L, exec, hyprlock
bind = $mainMod, P, pseudo
# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
@ -262,6 +274,8 @@ bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d
bind = $mainMod SHIFT, comma, movewindow, mon:+1
bind = $mainMod SHIFT, period, movewindow, mon:-1
# Resize
binde = $mainMod ALT, left, resizeactive, -20 0
@ -356,3 +370,11 @@ windowrule {
float = 1
center = 1
}
windowrule {
name = jetbrains-commit-preview
match:class = ^(jetbrains-.*|android-studio)$
match:title = ^Commit.*$
float = 0
}

View File

@ -1,4 +1,4 @@
# Generated by nwg-displays on 2026-02-09 at 00:39:06. Do not edit manually.
# Generated by nwg-displays on 2026-02-28 at 11:47:04. Do not edit manually.
monitor=DP-1,2560x1440@165.0,6626x876,1.0
monitor=DP-2,2560x1440@165.0,4066x876,1.0

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
SOCKET="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
SOCKET="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
handle_line() {
local line="$1"
@ -9,6 +9,8 @@ handle_line() {
local event="${line%%>>*}"
local data="${line#*>>}"
echo "$data" > "$HOME/close_popup.tmp.txt"
case "$event" in
openwindow)
# Data format:
@ -16,15 +18,17 @@ handle_line() {
local addr ws class title
IFS=, read -r addr ws class title <<< "$data"
# echo "$data" > $HOME/close_popup.tmp.txt
if [[ "$class" == "jetbrains-webstorm" && "$title" == "Monokai Pro Trial" ]]; then
# closewindow expects address with 0x prefix
hyprctl dispatch closewindow "address:0x$addr"
# echo "$data" > "$HOME/close_popup.tmp.txt"
fi
;;
esac
}
socat -U - "UNIX-CONNECT:$SOCKET" | while read -r line; do
handle_line "$line"
socat -U - UNIX-CONNECT:$SOCKET | while read -r line; do
handle_line "$line";
done

View File

@ -1,7 +1,7 @@
{
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
"auto-session": { "branch": "main", "commit": "292492ab7af4bd8b9e37e28508bc8ce995722fd5" },
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
"alpha-nvim": { "branch": "main", "commit": "a9d8fb72213c8b461e791409e7feabb74eb6ce73" },
"auto-session": { "branch": "main", "commit": "62437532b38495551410b3f377bcf4aaac574ebe" },
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
@ -10,30 +10,30 @@
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"flutter-tools.nvim": { "branch": "main", "commit": "293dfc78162ab185bca5f81bb32155dcf45114bf" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
"flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
"lspkind.nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" },
"lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "4da89f3ab04783da990f9bd40aaa36c22e59375b" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
"monokai-nightasty.nvim": { "branch": "main", "commit": "8be5e1c6e1d59873505e81b161e923264dfa5c1a" },
"none-ls-extras.nvim": { "branch": "main", "commit": "03955d165621300965a6d685c8f399ec7efd5785" },
"none-ls.nvim": { "branch": "main", "commit": "0b457958cb958c16850b5a1fb38bbcd982909181" },
"nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" },
"nvim-cmp": { "branch": "main", "commit": "85bbfad83f804f11688d1ab9486b459e699292d6" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "ac04ec3c2af08e9821b4eb64ede86072b9b213bf" },
"nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
"nvim-tree.lua": { "branch": "master", "commit": "b8b44b6a2494d086a9177251a119f9daec6cace8" },
"none-ls-extras.nvim": { "branch": "main", "commit": "c6fa39ac52814182c05552cb5d3750cae23ff0f0" },
"none-ls.nvim": { "branch": "main", "commit": "c9317c2a8629d4e39e7cf47be74cb67f3ab37cda" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
"nvim-lspconfig": { "branch": "master", "commit": "1d13d2b0df9a0a02904c76d7ad6810f71d404406" },
"nvim-surround": { "branch": "main", "commit": "61319d4bd1c5e336e197defa15bd104c51f0fb29" },
"nvim-tree.lua": { "branch": "master", "commit": "b3772adec8db61ba9098c5624a0823a77be3a23d" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"vim-floaterm": { "branch": "master", "commit": "a11b930f55324e9b05e2ef16511fe713f1b456a7" },
"vim-floaterm": { "branch": "master", "commit": "0ab5eb8135dc884bc543a819ac7033c15e72a76b" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View File

@ -2,7 +2,8 @@ return {
'neovim/nvim-lspconfig',
event = { 'BufReadPre', 'BufNewFile' },
dependencies = {
'williamboman/mason.nvim',
'mason-org/mason.nvim',
'mason-org/mason-lspconfig.nvim',
'hrsh7th/cmp-nvim-lsp',
{ 'antosha417/nvim-lsp-file-operations', config = true },
{
@ -27,13 +28,12 @@ return {
return { desc = desc, buffer = ev.buf, silent = true }
end
keymap.set('n', 'gr', vim.lsp.buf.rename, opts('Rename'))
keymap.set('n', 'K', vim.lsp.buf.hover, opts('Show documentation'))
keymap.set('n', 'gR', '<cmd>Telescope lsp_references<cr>', opts('Show LSP references'))
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts('Go to definition'))
keymap.set('n', 'gr', '<cmd>Telescope lsp_references<cr>', opts('Show LSP references'))
keymap.set('n', 'gD', vim.lsp.buf.declaration, opts('Go to declaration'))
keymap.set('n', 'gd', '<cmd>Telescope lsp_definitions<cr>', opts('Show LSP definitions'))
keymap.set('n', 'gi', '<cmd>Telescope lsp_implementations<cr>', opts('Show LSP implementations'))
keymap.set('n', 'gt', '<cmd>Telescope lsp_type_definitions<cr>', opts('Show LSP type definitions'))
keymap.set('n', 'K', vim.lsp.buf.hover, opts('Show documentation'))
keymap.set('n', 'gE', vim.diagnostic.open_float, opts('Show diagnostics'))
keymap.set({ 'n', 'v' }, 'ga', vim.lsp.buf.code_action, opts('Show available code actions'))
wk.add({
@ -61,14 +61,32 @@ return {
},
})
-- ts_ls: explicit host info
-- ts_ls: TypeScript/JavaScript/JSX/TSX
vim.lsp.config('ts_ls', {
cmd = { 'typescript-language-server', '--stdio' },
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
},
init_options = {
hostInfo = 'neovim',
},
})
-- eslint: linting for JS/TS/React projects
vim.lsp.config('eslint', {
settings = {
workingDirectories = { mode = 'auto' },
},
})
-- Explicitly enable all mason-managed servers.
-- This is belt-and-suspenders alongside mason-lspconfig's automatic_enable,
-- ensuring servers start regardless of mason-lspconfig version.
vim.lsp.enable({ 'lua_ls', 'html', 'cssls', 'bashls', 'ts_ls', 'eslint' })
-- hyprls: not managed by mason, enable manually
vim.lsp.config('hyprls', {
cmd = { 'hyprls' },

View File

@ -1,45 +1,50 @@
return {
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
config = function()
local mason = require('mason')
local mason_lspconfig = require('mason-lspconfig')
local mason_tool_installer = require('mason-tool-installer')
{
'mason-org/mason.nvim',
dependencies = {
'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
local mason = require('mason')
local mason_lspconfig = require('mason-lspconfig')
local mason_tool_installer = require('mason-tool-installer')
mason.setup({
ui = {
icons = {
package_installed = '',
package_pending = '',
package_uninstalled = '',
mason.setup({
ui = {
icons = {
package_installed = '',
package_pending = '',
package_uninstalled = '',
},
},
},
pip = {
upgrade_pip = true,
},
})
pip = {
upgrade_pip = true,
},
})
mason_lspconfig.setup({
ensure_installed = {
'lua_ls',
'html',
'cssls',
-- 'pyright',
-- 'emmet_ls',
'bashls',
'ts_ls',
},
})
mason_lspconfig.setup({
ensure_installed = {
'lua_ls',
'html',
'cssls',
-- 'pyright',
-- 'emmet_ls',
'bashls',
'ts_ls',
'eslint-lsp',
},
})
mason_tool_installer.setup({
ensure_installed = {
'prettier',
'isort',
-- 'black',
-- 'pylint',
-- 'eslint_d',
},
})
end,
mason_tool_installer.setup({
ensure_installed = {
'prettier',
'isort',
-- 'black',
-- 'pylint',
-- 'eslint_d',
},
})
end,
},
}

View File

@ -8,7 +8,17 @@ return {
local sources = {
null_ls.builtins.formatting.prettier.with({
filetypes = { 'javascript', 'typescript', 'typescriptreact', 'css', 'html', 'json', 'markdown', 'yaml' }
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
'css',
'html',
'json',
'markdown',
'yaml',
},
}),
-- null_ls.builtins.formatting.black,
-- null_ls.builtins.formatting.djlint,
@ -19,11 +29,6 @@ return {
null_ls.setup({
sources = sources,
-- on_attach = function(client, bufnr)
-- if client.server_capabilities.documentFormattingProvider then
-- vim.
-- end
-- end,
})
local keymap = vim.keymap