Skip to content

Commit

Permalink
Fix issue with clangd and LSP offset error
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlf committed Apr 30, 2024
1 parent 6d00263 commit 3eccf9d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 9 additions & 1 deletion config/lvim/lua/user/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
},
{ name = "isort" },
{ name = "yamlfmt" },
}

require("lvim.lsp.null-ls.linters").setup {
{ name = "cmakelint" },
{ name = "cpplint" },
Expand All @@ -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
13 changes: 10 additions & 3 deletions config/lvim/lua/user/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -38,24 +40,29 @@ lvim.plugins = {
},
{
"<leader>De",
"<CMD>DevcontainerExec<CR>",
"<CMD>DevcontainerExec direction='horizontal'<CR>",
desc = "Execute a command in the DevContainer",
},
{
"<leader>Db",
"<CMD>DevcontainerExec colcon build --symlink-install --merge-install<CR>",
"<CMD>DevcontainerExec cmd='colcon build --symlink-install --merge-install' direction='horizontal'<CR>",
desc = "ROS2 build in the DevContainer",
},
{
"<leader>Dt",
"<CMD>DevcontainerExec source install/setup.zsh && colcon test --merge-install<CR>",
"<CMD>DevcontainerExec cmd='source install/setup.zsh && colcon test --merge-install' direction='horizontal'<CR>",
desc = "ROS2 test in the DevContainer",
},
{
"<leader>Dc",
"<CMD>DevcontainerConnect<CR>",
desc = "Connect to DevContainer",
},
{
"<leader>DT",
"<CMD>DevcontainerToggle<CR>",
desc = "Toggle the current DevContainer Terminal"
},
}
},

Expand Down
2 changes: 2 additions & 0 deletions my-home/dot-exports
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 1 addition & 2 deletions my-home/dot-zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3eccf9d

Please sign in to comment.