From ddc41696ae5d6757a18b80ced6e1c36d206cbb10 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Sat, 9 Sep 2023 10:52:28 -0400 Subject: [PATCH] nvim lsp stuff and sway --- nvim/after/plugin/fugitive.lua | 1 - nvim/after/plugin/lsp.lua | 13 ++++++++++++- nvim/lua/RageCage64/packer.lua | 1 - nvim/lua/RageCage64/remap.lua | 3 +++ sway/config | 31 +++++++++++++++++++++++++++++-- 5 files changed, 44 insertions(+), 5 deletions(-) delete mode 100644 nvim/after/plugin/fugitive.lua diff --git a/nvim/after/plugin/fugitive.lua b/nvim/after/plugin/fugitive.lua deleted file mode 100644 index 80c9070..0000000 --- a/nvim/after/plugin/fugitive.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "gs", vim.cmd.Git) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index f8ee762..352f2a8 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -37,10 +37,21 @@ lsp.on_attach(function(_, bufnr) vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("n", "", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vc", function() vim.lsp.buf.code_action() end, opts) vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) end) +lsp.format_on_save({ + format_opts = { + async = false, + timeout_ms = 10000, + }, + servers = { + ['lua_ls'] = {'lua'}, + ['gopls'] = {'go'}, + } +}) + lsp.setup() diff --git a/nvim/lua/RageCage64/packer.lua b/nvim/lua/RageCage64/packer.lua index 0777410..e28c826 100644 --- a/nvim/lua/RageCage64/packer.lua +++ b/nvim/lua/RageCage64/packer.lua @@ -44,7 +44,6 @@ return require('packer').startup(function(use) {'L3MON4D3/LuaSnip'}, -- Required }, - use('tpope/vim-fugitive'), use('editorconfig/editorconfig-vim'), } end) diff --git a/nvim/lua/RageCage64/remap.lua b/nvim/lua/RageCage64/remap.lua index 5bf0926..5520499 100644 --- a/nvim/lua/RageCage64/remap.lua +++ b/nvim/lua/RageCage64/remap.lua @@ -45,3 +45,6 @@ vim.keymap.set("n", "wt", ":tabnew") vim.keymap.set("n", "c", '"+') vim.keymap.set("v", "c", '"+') + +-- Reload config +vim.keymap.set("n", "rc", ":so $HOME/.config/nvim/init.lua") diff --git a/sway/config b/sway/config index 293eb21..61baaf3 100644 --- a/sway/config +++ b/sway/config @@ -139,6 +139,29 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill bindsym $mod+Shift+0 move container to workspace number 10 # Note: workspaces can have any name you want, not just numbers. # We just use 1-10 as the default. + + # bind numpad as well + bindsym $mod+Mod2+KP_1 workspace number 1 + bindsym $mod+Mod2+KP_2 workspace number 2 + bindsym $mod+Mod2+KP_3 workspace number 3 + bindsym $mod+Mod2+KP_4 workspace number 4 + bindsym $mod+Mod2+KP_5 workspace number 5 + bindsym $mod+Mod2+KP_6 workspace number 6 + bindsym $mod+Mod2+KP_7 workspace number 7 + bindsym $mod+Mod2+KP_8 workspace number 8 + bindsym $mod+Mod2+KP_9 workspace number 9 + bindsym $mod+Mod2+KP_0 workspace number 10 + bindsym $mod+Shift+Mod2+KP_1 move container to workspace number 1 + bindsym $mod+Shift+Mod2+KP_2 move container to workspace number 2 + bindsym $mod+Shift+Mod2+KP_3 move container to workspace number 3 + bindsym $mod+Shift+Mod2+KP_4 move container to workspace number 4 + bindsym $mod+Shift+Mod2+KP_5 move container to workspace number 5 + bindsym $mod+Shift+Mod2+KP_6 move container to workspace number 6 + bindsym $mod+Shift+Mod2+KP_7 move container to workspace number 7 + bindsym $mod+Shift+Mod2+KP_8 move container to workspace number 8 + bindsym $mod+Shift+Mod2+KP_9 move container to workspace number 9 + bindsym $mod+Shift+Mod2+KP_0 move container to workspace number 10 + # # Layout stuff: # @@ -210,7 +233,8 @@ bar { # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. - status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + # status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done + status_command i3status colors { statusline #ffffff @@ -222,9 +246,12 @@ bar { # Make SSH work exec "ssh-agent -a $SSH_AUTH_SOCK" -# Swap Caps and Esc input "type:keyboard" { + # Swap Caps and Esc xkb_options caps:swapescape + + # enable numlock + xkb_numlock enabled } # media/brightness buttons