fix:add missing function in lsp conf

This commit is contained in:
max_richter 2022-02-02 14:28:36 +01:00
parent 9d6ff51f11
commit 89e4ef3149
3 changed files with 81 additions and 46 deletions

View File

@ -12,9 +12,9 @@ end
-- function to attach completion when setting up lsp -- function to attach completion when setting up lsp
local function on_attach() local function on_attach()
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
vim.cmd("command! LspOrganize lua lsp_organize_imports()") vim.cmd("command! LspOrganize lua lsp_organize_imports()")
vim.api.nvim_buf_map(bufnr, "n", "gs", ":LspOrganize<CR>", {silent = true}) vim.api.nvim_buf_map(bufnr, "n", "gs", ":LspOrganize<CR>", {silent = true})
end end
local system_name = "" local system_name = ""
@ -65,7 +65,11 @@ lsp.sumneko_lua.setup {
} }
-- Ltex Language Server -- Ltex Language Server
lsp.ltex.setup {} lsp.ltex.setup {
ltex = {
language = {"de", "en", "es"}
}
}
-- Go Language Server -- Go Language Server
lsp.gopls.setup { lsp.gopls.setup {
@ -86,6 +90,15 @@ lsp.svelte.setup {
capabilities = lsp_status.capabilities capabilities = lsp_status.capabilities
} }
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = {vim.api.nvim_buf_get_name(0)},
title = ""
}
vim.lsp.buf.execute_command(params)
end
-- Typescript Language Server -- Typescript Language Server
lsp.tsserver.setup { lsp.tsserver.setup {
on_attach = on_attach, on_attach = on_attach,

View File

@ -33,6 +33,7 @@ set $windowshot swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) |
# Default Programs # Default Programs
set $term alacritty set $term alacritty
set $explorer nautilus set $explorer nautilus
set $mail geary
set $browser google-chrome --enable-features=UseOzonePlatform --ozone-platform=wayland set $browser google-chrome --enable-features=UseOzonePlatform --ozone-platform=wayland
set $config_editor ~/.config/sway/config_editor.sh set $config_editor ~/.config/sway/config_editor.sh
@ -41,6 +42,7 @@ set $toggle_layout ~/.config/sway/toggle_layout.sh
set $toggle_gaps ~/.config/sway/toggle_gaps.sh set $toggle_gaps ~/.config/sway/toggle_gaps.sh
set $web_search $wofi_scripts/web-search.sh set $web_search $wofi_scripts/web-search.sh
set $select_window ~/.config/sway/select_window.sh set $select_window ~/.config/sway/select_window.sh
set $lock_screen ~/.config/sway/lock_screen.sh
set $select_emoji $wofi_scripts/wofi-emoji set $select_emoji $wofi_scripts/wofi-emoji
# Input configuration # Input configuration
@ -70,10 +72,11 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
# #
# Example configuration: # Example configuration:
# #
# exec swayidle -w \ exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \ timeout 300 '~/.config/sway/lock_screen.sh' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ timeout 600 'swaymsg "output \* dpms off"' \
# before-sleep 'swaylock -f -c 000000' timeout 660 'systemctl suspend' \
resume 'swaymsg "output \* dpms on"'
# #
# This will lock your screen after 300 seconds of inactivity, then turn off # This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when # your displays after another 300 seconds, and turn your screens back on when
@ -97,21 +100,21 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
# #
# Basics: # Basics:
# #
bindsym $mod+d exec $quickmenu bindsym $mod+d exec $quickmenu
bindsym $mod+q kill bindsym $mod+q kill
bindsym $mod+Shift+q exec $wofi_scripts/wofi-power-menu.sh bindsym $mod+Shift+q exec $wofi_scripts/wofi-power-menu.sh
bindsym $mod+Return exec $term bindsym $mod+Return exec $term
bindsym $mod+e exec $explorer bindsym $mod+e exec $explorer
bindsym $mod+Comma exec $settings bindsym $mod+Comma exec $settings
bindsym $mod+b exec $browser bindsym $mod+b exec $browser
bindsym $mod+Shift+Comma exec $config_editor bindsym $mod+Shift+Comma exec $config_editor
bindsym $mod+a exec $web_search bindsym $mod+a exec $web_search
# Drag and resize floating windows with mouse right/left drag # Drag and resize floating windows with mouse right/left drag
floating_modifier $mod normal floating_modifier $mod normal
# Reload the configuration file # Reload the configuration file
bindsym $mod+Shift+c reload bindsym $mod+Shift+c reload
# Multimedia Audio Keys # Multimedia Audio Keys
bindsym XF86AudioMute exec "pactl list sinks | grep -q Mute:.no && pactl set-sink-mute 0 1 || pactl set-sink-mute 0 0" bindsym XF86AudioMute exec "pactl list sinks | grep -q Mute:.no && pactl set-sink-mute 0 1 || pactl set-sink-mute 0 0"
@ -127,34 +130,35 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
# #
# Moving around: # Moving around:
# #
# Move your focus around # Move your focus around
bindsym $mod+$left focus left bindsym $mod+$left focus left
bindsym $mod+$down focus down bindsym $mod+$down focus down
bindsym $mod+$up focus up bindsym $mod+$up focus up
bindsym $mod+$right focus right # bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift # Or use $mod+[up|down|left|right]
bindsym $mod+Shift+$left move left bindsym $mod+Left focus left
bindsym $mod+Shift+$down move down bindsym $mod+Down focus down
bindsym $mod+Shift+$up move up bindsym $mod+Up focus up
bindsym $mod+Shift+$right move right bindsym $mod+Right focus right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left # Move the focused window with the same, but add Shift
bindsym $mod+Shift+Down move down bindsym $mod+Shift+$left move left
bindsym $mod+Shift+Up move up bindsym $mod+Shift+$down move down
bindsym $mod+Shift+Right move right bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# #
# Workspaces: # Workspaces:
# #
set $ws1 "1:  Code" set $ws1 "1:  Code"
assign [class="Alacritty"] $ws1 assign [class="Alacritty"] $ws1
set $ws2 "2:  Browser" set $ws2 "2:  Browser"
assign [class="Firefox"] $ws2 assign [class="Firefox"] $ws2
assign [class="Chromium"] $ws2 assign [class="Chromium"] $ws2
assign [class="Google-chrome-beta"] $ws2 assign [class="Google-chrome-beta"] $ws2
assign [class="Google-chrome"] $ws2 assign [class="Google-chrome"] $ws2
@ -224,7 +228,9 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
bindsym $mod+s exec $screenshot bindsym $mod+s exec $screenshot
bindsym $mod+i exec $select_emoji bindsym $mod+i exec $select_emoji
bindsym $mod+l exec $lock_screen
bindsym $mod+Tab exec $select_window bindsym $mod+Tab exec $select_window
bindsym $mod+m exec $mail
# #
# Scratchpad: # Scratchpad:
# #
@ -262,7 +268,10 @@ mode "resize" {
} }
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
# Do we need that?
exec_always nm-applet --indicator exec_always nm-applet --indicator
# Handles notifications
exec_always mako exec_always mako
# #

13
configs/sway/lock_screen.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/sh
swaylock \
--screenshots \
--indicator-radius 500 \
--effect-blur 7x5 \
--effect-pixelate 7 \
--ring-color ffffff \
--line-color 000000 \
--inside-color ffffff \
--separator-color 00000000 \
--grace 2 \
--fade-in 2