From 62ebe8d56cb83d67ff7379be810fd9dc98ee454e Mon Sep 17 00:00:00 2001 From: Erich L Foster Date: Tue, 30 Apr 2024 13:24:27 +0200 Subject: [PATCH] Fix issue with clangd and LSP offset error --- config/lvim/lua/user/options.lua | 10 +++++++++- config/lvim/lua/user/plugins.lua | 13 ++++++++++--- my-home/dot-exports | 2 ++ my-home/dot-zshrc | 3 +-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/config/lvim/lua/user/options.lua b/config/lvim/lua/user/options.lua index d9e7636..d0a49b2 100644 --- a/config/lvim/lua/user/options.lua +++ b/config/lvim/lua/user/options.lua @@ -74,10 +74,14 @@ table.insert(lvim.builtin.alpha.dashboard.section.buttons.entries, -- LSP require("lvim.lsp.null-ls.formatters").setup { { name = "black" }, - { name = "clang-format" }, + { name = "clang-format", + filetype = { "c", "cpp", "cs", "java" }, + extra_args = { "--style", "file:~/.clang-format" } + }, { name = "isort" }, { name = "yamlfmt" }, } + require("lvim.lsp.null-ls.linters").setup { { name = "cmakelint" }, { name = "cpplint" }, @@ -87,3 +91,7 @@ require("lvim.lsp.null-ls.linters").setup { { name = "pylint" }, { name = "yamllint" }, } + +lvim.lsp.null_ls.setup.on_init = function(new_client, _) + new_client.offset_encoding = "utf-8" +end diff --git a/config/lvim/lua/user/plugins.lua b/config/lvim/lua/user/plugins.lua index 9e174f8..5d036c8 100644 --- a/config/lvim/lua/user/plugins.lua +++ b/config/lvim/lua/user/plugins.lua @@ -21,6 +21,8 @@ lvim.plugins = { { "erichlf/devcontainer-cli.nvim", branch = "main", + branch = "specify-window-location", + dependencies = { 'akinsho/toggleterm.nvim' }, opts = { interactive = false, dotfiles_repository = "https://github.com/erichlf/dotfiles.git", @@ -38,17 +40,17 @@ lvim.plugins = { }, { "De", - "DevcontainerExec", + "DevcontainerExec direction='horizontal'", desc = "Execute a command in the DevContainer", }, { "Db", - "DevcontainerExec colcon build --symlink-install --merge-install", + "DevcontainerExec cmd='colcon build --symlink-install --merge-install' direction='horizontal'", desc = "ROS2 build in the DevContainer", }, { "Dt", - "DevcontainerExec source install/setup.zsh && colcon test --merge-install", + "DevcontainerExec cmd='source install/setup.zsh && colcon test --merge-install' direction='horizontal'", desc = "ROS2 test in the DevContainer", }, { @@ -56,6 +58,11 @@ lvim.plugins = { "DevcontainerConnect", desc = "Connect to DevContainer", }, + { + "DT", + "DevcontainerToggle", + desc = "Toggle the current DevContainer Terminal" + }, } }, diff --git a/my-home/dot-exports b/my-home/dot-exports index 38f79a0..74418b1 100644 --- a/my-home/dot-exports +++ b/my-home/dot-exports @@ -28,4 +28,6 @@ if [ -d $HOME/bin ] ; then fi export PATH="$PATH:$HOME/.local/bin" +# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. +export PATH="$PATH:$HOME/.rvm/bin" export ROS_DOMAIN_ID="3" diff --git a/my-home/dot-zshrc b/my-home/dot-zshrc index a63f1b3..3aae61c 100644 --- a/my-home/dot-zshrc +++ b/my-home/dot-zshrc @@ -78,5 +78,4 @@ setopt nonomatch eval "$(starship init zsh)" -# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. -export PATH="$PATH:$HOME/.rvm/bin" +set -o vi