Browse Source

fix: update lsp config to support new api

master
Tovi Jaeschke-Rogers 3 weeks ago
parent
commit
52b58dbe20
7 changed files with 49 additions and 14 deletions
  1. +5
    -2
      .config/hypr/hyprland.conf
  2. +0
    -1
      .config/nvim/lua/plugins/blink.lua
  3. +1
    -0
      .config/nvim/lua/plugins/conform.lua
  4. +8
    -0
      .config/nvim/lua/plugins/demicolon.lua
  5. +1
    -0
      .config/nvim/lua/plugins/linting.lua
  6. +17
    -11
      .config/nvim/lua/plugins/lspconfig.lua
  7. +17
    -0
      .local/bin/toggle-swapescape-hyprland

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

@ -139,8 +139,8 @@ input {
kb_layout = us
kb_variant =
kb_model =
kb_options = kb_options = caps:swapescape
# kb_options = =
# kb_options = caps:swapescape
kb_options =
kb_rules =
follow_mouse = 1
@ -186,6 +186,9 @@ bind = $mainMod, M, exec, ~/.local/bin/hyprland-monitor-switcher.sh
bind = $mainMod SHIFT, L, exec, hyprlock
bind = $mainMod, S, exec, hyprshot -m region --clipboard-only
bind = $mainMod, T, exec, ~/.local/bin/toggle-swapescape-hyprland
bind = $mainMod SHIFT, T, exec, ~/.local/bin/toggle-swapescape-hyprland
bind = $mainMod, Return, layoutmsg, swapwithmaster
bind = $mainMod, j, layoutmsg, cyclenext
bind = $mainMod, k, layoutmsg, cycleprev


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

@ -20,7 +20,6 @@ return {
winblend = vim.o.pumblend,
scrollbar = true,
border = 'single',
max_items = 200,
draw = {
columns = {
{ "label", "label_description", gap = 1 },


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

@ -10,6 +10,7 @@ return {
go = { "goimports", "gofmt" },
javascript = { "prettierd" },
typescript = { "prettierd" },
typescriptreact = { "prettierd" },
vue = { "prettierd" },
css = { "prettierd" },
html = { "prettierd" },


+ 8
- 0
.config/nvim/lua/plugins/demicolon.lua View File

@ -0,0 +1,8 @@
return {
'mawkler/demicolon.nvim',
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-treesitter/nvim-treesitter-textobjects',
},
opts = {}
}

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

@ -54,6 +54,7 @@ return {
lint.linters_by_ft = {
javascript = { "eslint" },
typescript = { "eslint" },
typescriptreact = { "eslint" },
vue = { "eslint" },
json = { "jsonlint" },
markdown = { "markdownlint" },


+ 17
- 11
.config/nvim/lua/plugins/lspconfig.lua View File

@ -3,16 +3,16 @@ return {
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "saghen/blink.cmp" },
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim" },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "j-hui/fidget.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
{ 'dmmulroy/ts-error-translator.nvim', opts = {} },
{ "antosha417/nvim-lsp-file-operations", config = true },
{ "williamboman/mason.nvim", config = true },
{ "williamboman/mason-lspconfig.nvim" },
{ "WhoIsSethDaniel/mason-tool-installer.nvim" },
{ "j-hui/fidget.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
{ 'dmmulroy/ts-error-translator.nvim', opts = {} },
{ 'mawkler/refjump.nvim', opts = {}, event = 'LspAttach', },
},
config = function()
local lspconfig = require("lspconfig")
local utils = require("lsp.utils")
vim.api.nvim_create_autocmd("LspAttach", {
@ -43,7 +43,7 @@ return {
},
signs = true,
underline = true,
update_in_insert = false,
update_in_insert = true,
severity_sort = true,
})
@ -69,10 +69,16 @@ return {
end
end
-- Setup all servers
-- Setup all servers using the new vim.lsp.config and vim.lsp.enable APIs
for server_name, server in pairs(servers) do
-- Merge capabilities
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
lspconfig[server_name].setup(server)
-- Use vim.lsp.config to define/customize the server configuration
vim.lsp.config(server_name, server)
-- Use vim.lsp.enable to activate the server for its filetypes
vim.lsp.enable(server_name)
end
end,
}

+ 17
- 0
.local/bin/toggle-swapescape-hyprland View File

@ -0,0 +1,17 @@
#!/bin/bash
# Script to toggle caps:swapescape setting in Hyprland
# Save this as ~/.config/hypr/scripts/toggle-caps-escape.sh
# Check current state
current_setting=$(hyprctl getoption input:kb_options | grep -o "caps:swapescape" || echo "")
if [ -n "$current_setting" ]; then
# Currently swapped, disable it
hyprctl keyword input:kb_options ""
notify-send "Keyboard Layout" "Caps Lock and Escape returned to normal" -i input-keyboard
else
# Not swapped, enable it
hyprctl keyword input:kb_options "caps:swapescape"
notify-send "Keyboard Layout" "Caps Lock and Escape swapped" -i input-keyboard
fi

Loading…
Cancel
Save