From 01ac9df6e444effb360729f03b84bfa7acbf5108 Mon Sep 17 00:00:00 2001 From: Belal Elsabbagh Date: Tue, 13 May 2025 10:03:09 +0300 Subject: [PATCH] new lsp thing --- .config/btop/btop.conf | 8 +++++++- .config/nvim/init.lua | 11 +++++++++++ .config/nvim/lsp/clangd.lua | 18 ++++++++++++++++++ .config/nvim/lsp/gopls.lua | 0 .config/nvim/lsp/lua-language-server.lua | 20 ++++++++++++++++++++ .config/nvim/lsp/pyright.lua | 20 ++++++++++++++++++++ .config/nvim/lsp/rust-analyzer.lua | 0 .config/nvim/lsp/tsls.lua | 0 .config/nvim/lsp/yaml-language-server.lua | 0 9 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/lsp/clangd.lua create mode 100644 .config/nvim/lsp/gopls.lua create mode 100644 .config/nvim/lsp/lua-language-server.lua create mode 100644 .config/nvim/lsp/pyright.lua create mode 100644 .config/nvim/lsp/rust-analyzer.lua create mode 100644 .config/nvim/lsp/tsls.lua create mode 100644 .config/nvim/lsp/yaml-language-server.lua diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf index 146c7eb..93fef25 100644 --- a/.config/btop/btop.conf +++ b/.config/btop/btop.conf @@ -1,4 +1,4 @@ -#? Config file for btop v. 1.4.0 +#? Config file for btop v. 1.4.2 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" @@ -210,6 +210,9 @@ net_sync = True #* Starts with the Network Interface specified here. net_iface = "" +#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes. +base_10_bitrate = "Auto" + #* Show battery stats in top right if battery is present. show_battery = True @@ -226,6 +229,9 @@ log_level = "WARNING" #* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. nvml_measure_pcie_speeds = True +#* Measure PCIe throughput on AMD cards, may impact performance on certain cards. +rsmi_measure_pcie_speeds = True + #* Horizontally mirror the GPU graph. gpu_mirror_graph = True diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 64e77ad..a3ef4aa 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -52,6 +52,17 @@ end vim.opt.rtp:prepend(lazypath) +vim.lsp.config('*', { + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true, + }, + }, + }, + root_markers = { '.git' }, +}) + require('lazy').setup({ spec = { import = 'plugins' } }, { ui = { icons = vim.g.have_nerd_font and {} or { diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua new file mode 100644 index 0000000..d3ed57b --- /dev/null +++ b/.config/nvim/lsp/clangd.lua @@ -0,0 +1,18 @@ +return { + -- From the clangd configuration in /lsp/clangd.lua + cmd = { 'clangd' }, + -- From the clangd configuration in /lsp/clangd.lua + -- Overrides the "*" configuration in init.lua + root_markers = { '.clangd', 'compile_commands.json' }, + -- From the clangd configuration in init.lua + -- Overrides the clangd configuration in /lsp/clangd.lua + filetypes = { 'c' }, + -- From the "*" configuration in init.lua + capabilities = { + textDocument = { + semanticTokens = { + multilineTokenSupport = true, + }, + }, + }, +} diff --git a/.config/nvim/lsp/gopls.lua b/.config/nvim/lsp/gopls.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/lsp/lua-language-server.lua b/.config/nvim/lsp/lua-language-server.lua new file mode 100644 index 0000000..42daf97 --- /dev/null +++ b/.config/nvim/lsp/lua-language-server.lua @@ -0,0 +1,20 @@ +return { + cmd = { 'lua-language-server' }, + -- Filetypes to automatically attach to. + filetypes = { 'lua' }, + -- Sets the "root directory" to the parent directory of the file in the + -- current buffer that contains either a ".luarc.json" or a + -- ".luarc.jsonc" file. Files that share a root directory will reuse + -- the connection to the same LSP server. + root_markers = { '.luarc.json', '.luarc.jsonc' }, + -- Specific settings to send to the server. The schema for this is + -- defined by the server. For example the schema for lua-language-server + -- can be found here https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json + settings = { + Lua = { + runtime = { + version = 'LuaJIT', + }, + }, + }, +} diff --git a/.config/nvim/lsp/pyright.lua b/.config/nvim/lsp/pyright.lua new file mode 100644 index 0000000..ad93565 --- /dev/null +++ b/.config/nvim/lsp/pyright.lua @@ -0,0 +1,20 @@ +return { + cmd = { 'pyright' }, + filetypes = { 'python' }, + root_markers = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + 'pyrightconfig.json', + }, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + }, + }, + }, +} diff --git a/.config/nvim/lsp/rust-analyzer.lua b/.config/nvim/lsp/rust-analyzer.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/lsp/tsls.lua b/.config/nvim/lsp/tsls.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/lsp/yaml-language-server.lua b/.config/nvim/lsp/yaml-language-server.lua new file mode 100644 index 0000000..e69de29