From 83bd3f277fb87303be71d84726a3136be56cd060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 19 Jan 2023 13:03:18 +0100 Subject: [PATCH] Update rust tools --- .../config/nvim/lua/esensar/init/plugins.lua | 2 ++ symlinks/config/nvim/lua/esensar/lsp/servers.lua | 16 +++++++++++++++- .../config/sway/conf.d/15_workspace_assignment | 2 ++ .../config/sway/conf.d/16_floating_assignment | 11 +++++++++++ symlinks/config/sway/config | 12 ------------ symlinks/config/ulauncher/settings.json | 1 + symlinks/tool-versions | 4 ++-- 7 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 symlinks/config/sway/conf.d/16_floating_assignment diff --git a/symlinks/config/nvim/lua/esensar/init/plugins.lua b/symlinks/config/nvim/lua/esensar/init/plugins.lua index 0c964d0..42c024f 100644 --- a/symlinks/config/nvim/lua/esensar/init/plugins.lua +++ b/symlinks/config/nvim/lua/esensar/init/plugins.lua @@ -38,6 +38,7 @@ return require("packer").startup({ use("lewis6991/impatient.nvim") -- Caching lua modules for faster startup use("rcarriga/nvim-notify") -- notifications UI use("MunifTanjim/nui.nvim") -- General UI + use("jiangmiao/auto-pairs") -- Autoclosing of brackets and quotes -- Tools use("direnv/direnv.vim") -- Integration with Direnv @@ -90,6 +91,7 @@ return require("packer").startup({ -- LSP language specific use("tjdevries/nlua.nvim") -- Built-in Lua integration with LSP use("akinsho/flutter-tools.nvim") -- Additional flutter integrations + use("simrat39/rust-tools.nvim") -- Additional rust integrations use({ "mfussenegger/nvim-jdtls", ft = "java" }) -- Additional java integrations -- Lua support diff --git a/symlinks/config/nvim/lua/esensar/lsp/servers.lua b/symlinks/config/nvim/lua/esensar/lsp/servers.lua index b2a43b0..1f0218a 100644 --- a/symlinks/config/nvim/lua/esensar/lsp/servers.lua +++ b/symlinks/config/nvim/lua/esensar/lsp/servers.lua @@ -55,7 +55,6 @@ local servers = { "mint", "omnisharp", "pyright", - "rust_analyzer", "solang", "terraformls", "tsserver", @@ -83,3 +82,18 @@ require("nlua.lsp.nvim").setup( require("flutter-tools").setup({ lsp = common_config, }) + +-- Rust tools +local rt = require("rust-tools") + +rt.setup({ + server = vim.tbl_extend("force", common_config, { + on_attach = function(client, bufnr) + common_config.on_attach(client, bufnr) + -- Hover actions + vim.keymap.set("n", "", rt.hover_actions.hover_actions, { buffer = bufnr }) + -- Code action groups + vim.keymap.set("n", "a", rt.code_action_group.code_action_group, { buffer = bufnr }) + end, + }), +}) diff --git a/symlinks/config/sway/conf.d/15_workspace_assignment b/symlinks/config/sway/conf.d/15_workspace_assignment index eadf5f7..495b938 100644 --- a/symlinks/config/sway/conf.d/15_workspace_assignment +++ b/symlinks/config/sway/conf.d/15_workspace_assignment @@ -12,6 +12,8 @@ assign [class="jetbrains-rider"] $ide_workspace assign [class="octave-gui"] $ide_workspace assign [instance="vim"] $editor_workspace assign [instance="download"] $ongoing_operations +assign [class="Godot"] $ide_workspace +assign [class="FreeTube"] $music_workspace # Buggy apps for_window [class="Spotify"] move to workspace $music_workspace diff --git a/symlinks/config/sway/conf.d/16_floating_assignment b/symlinks/config/sway/conf.d/16_floating_assignment new file mode 100644 index 0000000..e2262b9 --- /dev/null +++ b/symlinks/config/sway/conf.d/16_floating_assignment @@ -0,0 +1,11 @@ +# Floating exceptions +for_window [window_role="pop-up"] floating enable +for_window [window_role="bubble"] floating enable +for_window [window_role="task_dialog"] floating enable +for_window [window_role="Preferences"] floating enable +for_window [window_type="dialog"] floating enable +for_window [window_type="menu"] floating enable +for_window [window_role="About"] floating enable +for_window [app_id="ulauncher"] border none +for_window [app_id="wofi"] border none +for_window [title="Firefox — Sharing Indicator"] floating enable diff --git a/symlinks/config/sway/config b/symlinks/config/sway/config index 3f4308e..645327c 100644 --- a/symlinks/config/sway/config +++ b/symlinks/config/sway/config @@ -10,17 +10,5 @@ gaps outer 5 smart_gaps on default_border none -# Floating exceptions -for_window [window_role="pop-up"] floating enable -for_window [window_role="bubble"] floating enable -for_window [window_role="task_dialog"] floating enable -for_window [window_role="Preferences"] floating enable -for_window [window_type="dialog"] floating enable -for_window [window_type="menu"] floating enable -for_window [window_role="About"] floating enable -for_window [app_id="ulauncher"] border none -for_window [app_id="wofi"] border none -for_window [title="Firefox — Sharing Indicator"] floating enable - include ~/.config/sway/conf.d/* include /etc/sway/config.d/* diff --git a/symlinks/config/ulauncher/settings.json b/symlinks/config/ulauncher/settings.json index eb25f6a..39570e7 100644 --- a/symlinks/config/ulauncher/settings.json +++ b/symlinks/config/ulauncher/settings.json @@ -1,6 +1,7 @@ { "blacklisted-desktop-dirs": "/usr/share/locale:/usr/share/app-install:/usr/share/kservices5:/usr/share/fk5:/usr/share/kservicetypes5:/usr/share/applications/screensavers:/usr/share/kde4:/usr/share/mimelnk", "clear-previous-query": true, + "disable-desktop-filters": false, "grab-mouse-pointer": false, "hotkey-show-app": "Super_Lspace", "render-on-screen": "mouse-pointer-monitor", diff --git a/symlinks/tool-versions b/symlinks/tool-versions index a0d3a58..f23191f 100644 --- a/symlinks/tool-versions +++ b/symlinks/tool-versions @@ -2,7 +2,7 @@ direnv 2.32.1 nodejs 18.1.0 python system ruby 3.0.0 -neovim 0.8.0 +neovim 0.8.2 java openjdk-17.0.2 -rust 1.64.0 +rust 1.65.0 golang 1.19.1