Compare commits
10 commits
1048c54afe
...
b34d120f26
| Author | SHA1 | Date | |
|---|---|---|---|
| b34d120f26 | |||
| 8396e814fd | |||
|
|
1f47704848 | ||
| 26b5d14b47 | |||
| ec1a6cd00f | |||
| b2397c3a80 | |||
| 8c8cc7750b | |||
| aebc887077 | |||
| 1b19215133 | |||
| bbee602b13 |
22 changed files with 417 additions and 109 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*.log
|
||||
nvim/lazy-lock.json
|
||||
56
Dockerfile
56
Dockerfile
|
|
@ -16,22 +16,42 @@ RUN apt-get update \
|
|||
&& apt-get install -y \
|
||||
libgl1-mesa-dri \
|
||||
libgl1-mesa-glx \
|
||||
mesa-utils \
|
||||
mesa-utils-extra \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
avahi-daemon \
|
||||
avahi-utils \
|
||||
libnss-mdns \
|
||||
iputils-ping \
|
||||
sudo \
|
||||
vim \
|
||||
ripgrep \
|
||||
wget \
|
||||
byobu \
|
||||
xmlstarlet \
|
||||
ros-${ROS_DISTR}-rqt-tf-tree \
|
||||
ros-${ROS_DISTR}-apriltag \
|
||||
ros-${ROS_DISTR}-plotjuggler-ros \
|
||||
clang-format \
|
||||
&& python3 -m pip install yapf \
|
||||
rope \
|
||||
flake8 \
|
||||
pylint \
|
||||
jedi \
|
||||
xclip \
|
||||
# neovim build depends \
|
||||
ninja-build \
|
||||
gettext \
|
||||
cmake \
|
||||
unzip \
|
||||
curl \
|
||||
# end neovim build depends \
|
||||
# && rosdep install --from-paths /ros2_underlay/src -y --ignore-src \
|
||||
# && rosdep install --from paths /ros2/src -y --ignore-src \
|
||||
&& mkdir -p /etc/apt/keyrings \
|
||||
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
|
||||
&& NODE_MAJOR=20 \
|
||||
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
|
||||
&& apt update \
|
||||
&& apt-get remove nodejs \
|
||||
&& apt-get install nodejs \
|
||||
&& git clone https://github.com/neovim/neovim.git \
|
||||
&& cd neovim && git checkout stable && make CMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
&& sudo make install \
|
||||
&& groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
||||
|
|
@ -57,30 +77,28 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
|
|||
-a 'PATH=$PATH:$HOME/.local/bin' \
|
||||
-a 'export HISTFILE=/zsh_history/.zsh_history' \
|
||||
-a 'export TERM=xterm-256color' \
|
||||
-a 'eval "$(register-python-argcomplete3 ros2)"' \
|
||||
-a 'eval "$(register-python-argcomplete3 colcon)"' \
|
||||
-a 'export COLORTERM=truecolor' \
|
||||
&& mkdir -p "$HOME/.zsh" \
|
||||
&& git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure" \
|
||||
&& echo "source /opt/ros/$ROS_DISTR/setup.zsh" >> /home/$USERNAME/.zshrc
|
||||
|
||||
ADD vimrc /home/$USERNAME/.vimrc
|
||||
ADD ycm_extra_conf.py /home/$USERNAME/.ycm_extra_conf.py
|
||||
RUN git clone https://github.com/VundleVim/Vundle.vim.git /home/$USERNAME/.vim/bundle/Vundle.vim
|
||||
RUN vim +PluginInstall +qall
|
||||
RUN cd /home/$USERNAME/.vim/bundle/YouCompleteMe \
|
||||
&& python3 install.py --clangd-completer
|
||||
|
||||
USER root
|
||||
RUN mkdir /zsh_history \
|
||||
&& touch /zsh_history/.zsh_history \
|
||||
&& chown -R $USERNAME /zsh_history
|
||||
ADD cpp.vim /home/$USERNAME/.vim/after/ftplugin/cpp.vim
|
||||
ADD ros2-vim/nvim /home/$USERNAME/.config/nvim
|
||||
RUN chown -R $USERNAME /home/$USERNAME/
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
USER ${USERNAME}
|
||||
RUN nvim --headless "+Lazy! sync" +qa
|
||||
RUN nvim --headless +"MasonInstall lua-language-server clangd python-lsp-server yaml-language-server" +q
|
||||
WORKDIR /home/$USERNAME
|
||||
|
||||
USER root
|
||||
ADD ros2-vim/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
RUN chown $USERNAME /entrypoint.sh
|
||||
USER ${USERNAME}
|
||||
WORKDIR /home/$USERNAME
|
||||
RUN wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format.py
|
||||
# Switch back to dialog for any ad-hoc use of apt-get
|
||||
ENV DEBIAN_FRONTEND=dialog
|
||||
CMD [ "/usr/bin/zsh"]
|
||||
|
|
|
|||
25
README.md
Normal file
25
README.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Update The Base Image
|
||||
|
||||
~~~ bash
|
||||
docker pull osrf/ros:humble-desktop-full
|
||||
~~~
|
||||
|
||||
# Rebuild The Image from Dockerfile
|
||||
|
||||
~~~ bash
|
||||
docker-compose build
|
||||
~~~
|
||||
|
||||
# Run The Container
|
||||
|
||||
## NVIDIA
|
||||
|
||||
~~~ bash
|
||||
docker-compose run --rm nvidia
|
||||
~~~
|
||||
|
||||
## Others
|
||||
|
||||
~~~ bash
|
||||
docker-compose run --rm dev
|
||||
~~~
|
||||
3
build
Executable file
3
build
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
docker compose build
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
services:
|
||||
nvidia:
|
||||
container_name: ros2-vim
|
||||
extends:
|
||||
service: dev
|
||||
deploy:
|
||||
|
|
@ -10,13 +11,16 @@ services:
|
|||
count: all
|
||||
capabilities: [gpu]
|
||||
dev:
|
||||
container_name: ros2-vim
|
||||
network_mode: host
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
context: ..
|
||||
dockerfile: ./ros2-vim/Dockerfile
|
||||
ssh:
|
||||
- default
|
||||
stdin_open: true
|
||||
tty: true
|
||||
entrypoint: ["/entrypoint.sh", "byobu"]
|
||||
entrypoint: ["/entrypoint.sh", "zsh"]
|
||||
working_dir: /home/ros-user/uuv/ros2
|
||||
devices:
|
||||
- "/dev/dri:/dev/dri"
|
||||
|
|
@ -33,8 +37,13 @@ services:
|
|||
- type: bind
|
||||
source: /var/run/avahi-daemon/socket
|
||||
target: /var/run/avahi-daemon/socket
|
||||
- type: bind
|
||||
source: ${HOME}/Documents/ros2-vim/nvim
|
||||
target: /home/ros-user/.config/nvim
|
||||
- "ros2_zsh_history:/zsh_history"
|
||||
- nvim_data:/home/ros-user/.local/share/nvim
|
||||
- $SSH_AUTH_SOCK:/ssh-agent
|
||||
- "~/.gitconfig:/etc/gitconfig"
|
||||
|
||||
environment:
|
||||
- DISPLAY=${DISPLAY}
|
||||
|
|
@ -42,6 +51,10 @@ services:
|
|||
- SHELL=/usr/bin/zsh
|
||||
- ROS_WORKSPACE=/home/ros-user/uuv/ros2
|
||||
- SSH_AUTH_SOCK=/ssh-agent
|
||||
- TERM=xterm-256color
|
||||
- COLORTERM=24bit
|
||||
- ROS_DOMAIN_ID=29
|
||||
|
||||
volumes:
|
||||
ros2_zsh_history:
|
||||
nvim_data:
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
PX4_DIR="\$HOME/uuv/PX4-Autopilot"
|
||||
WORKSPACE_DIR="\$HOME/uuv/ros2"
|
||||
echo "source $PX4_DIR/Tools/setup_gazebo.bash $PX4_DIR $PX4_DIR/build/px4_sitl_default > /dev/null" >> ~/.zshrc
|
||||
echo "export ROS_PACKAGE_PATH=\$ROS_PACKAGE_PATH:$PX4_DIR" >> ~/.zshrc
|
||||
echo "export ROS_PACKAGE_PATH=\$ROS_PACKAGE_PATH:$PX4_DIR/Tools/sitl_gazebo" >> ~/.zshrc
|
||||
vim +PluginUpdate +qall
|
||||
UNDERLAY_DIR="\$HOME/uuv/ros2_underlay"
|
||||
|
||||
echo "alias build_ros=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source $UNDERLAY_DIR/install/setup.bash && cd $WORKSPACE_DIR && colcon build --symlink-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON'\"" >> ~/.zshrc
|
||||
echo "alias build_underlay=\"env -i HOME=\$HOME USER=\$USER TERM=xterm-256color bash -l -c 'source /opt/ros/$ROS_DISTR/setup.bash && cd $UNDERLAY_DIR && colcon build'\"" >> ~/.zshrc
|
||||
|
||||
|
||||
echo 'source $HOME/uuv/ros2_underlay/install/setup.zsh' >> ~/.zshrc
|
||||
echo 'source $HOME/uuv/ros2/install/local_setup.zsh' >> ~/.zshrc
|
||||
echo 'export RCUTILS_COLORIZED_OUTPUT=1' >> ~/.zshrc
|
||||
echo 'eval "$(register-python-argcomplete3 ros2)"' >> ~/.zshrc
|
||||
echo 'eval "$(register-python-argcomplete3 colcon)"' >> ~/.zshrc
|
||||
|
||||
exec $@
|
||||
|
|
|
|||
6
nvim/after/plugin/color.lua
Normal file
6
nvim/after/plugin/color.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
function ColorMyPencils(color)
|
||||
color = color or "rose-pine"
|
||||
vim.cmd.colorscheme(color)
|
||||
end
|
||||
|
||||
ColorMyPencils()
|
||||
1
nvim/after/plugin/fugitive.lua
Normal file
1
nvim/after/plugin/fugitive.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
|
||||
9
nvim/after/plugin/gitsigns.lua
Normal file
9
nvim/after/plugin/gitsigns.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = {text='+'},
|
||||
change = {text='~'},
|
||||
delete = {text='_'},
|
||||
topdelete = {text='‾'},
|
||||
changedelete = {text='~'},
|
||||
}
|
||||
}
|
||||
16
nvim/after/plugin/harpoon.lua
Normal file
16
nvim/after/plugin/harpoon.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local mark = require('harpoon.mark')
|
||||
local ui = require('harpoon.ui')
|
||||
local cmd_ui = require('harpoon.cmd-ui')
|
||||
local term = require('harpoon.term')
|
||||
|
||||
vim.keymap.set('n', '<leader>a', mark.add_file)
|
||||
vim.keymap.set('n', '<C-e>', ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set('n', '<C-h>', function() ui.nav_file(1) end)
|
||||
vim.keymap.set('n', '<C-t>', function() ui.nav_file(2) end)
|
||||
vim.keymap.set('n', '<C-n>', function() ui.nav_file(3) end)
|
||||
vim.keymap.set('n', '<C-s>', function() ui.nav_file(4) end)
|
||||
|
||||
vim.keymap.set('n', '<leader>c', cmd_ui.toggle_quick_menu)
|
||||
vim.keymap.set('n', '<leader>gt1', function() term.gotoTerminal(1) end)
|
||||
vim.keymap.set('n', '<leader>br', function() term.sendCommand(1, 'build_ros') end)
|
||||
61
nvim/after/plugin/lsp.lua
Normal file
61
nvim/after/plugin/lsp.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
require('mason').setup({
|
||||
ui = {
|
||||
border = 'rounded'
|
||||
}
|
||||
})
|
||||
-- Install language servers
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = {
|
||||
'lua_ls', 'clangd', 'pylsp', 'yamlls'
|
||||
}
|
||||
}
|
||||
local lsp = require('lsp-zero').preset({
|
||||
manage_nvim_cmp = {
|
||||
set_sources = 'lsp',
|
||||
set_basic_mappings = true,
|
||||
set_extra_mappings = false,
|
||||
use_luasnip = true,
|
||||
set_format = true,
|
||||
documentation_window = true,
|
||||
}
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
lsp.default_keymaps({ buffer = bufnr })
|
||||
end)
|
||||
|
||||
-- (Optional) Configure lua language server for neovim
|
||||
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
|
||||
|
||||
lsp.setup()
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_action = require('lsp-zero').cmp_action()
|
||||
|
||||
-- configure auto complete key
|
||||
cmp.setup({
|
||||
mapping = {
|
||||
['<Tab>'] = cmp_action.tab_complete(),
|
||||
['<S-Tab>'] = cmp_action.select_prev_or_fallback(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<C-space>'] = cmp.mapping.complete(),
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(1),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(-1),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').pylsp.setup {
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
autopep8 = { enabled = false },
|
||||
yapf = { enabled = true, args = '--style={based_on_style: google column_limit: 80}' },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
nvim/after/plugin/telescope.lua
Normal file
6
nvim/after/plugin/telescope.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
||||
vim.keymap.set("n", "C-p", builtin.git_files, {})
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
||||
end)
|
||||
35
nvim/after/plugin/treesitter.lua
Normal file
35
nvim/after/plugin/treesitter.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
require('nvim-treesitter.configs').setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "cpp", "python", "yaml" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (for "all")
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
17
nvim/init.lua
Normal file
17
nvim/init.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
vim.g.mapleader = ' ' -- needs to be set before lazy im
|
||||
require('lazy').setup('plugins')
|
||||
|
||||
require('lennartalff')
|
||||
5
nvim/lua/lennartalff/init.lua
Normal file
5
nvim/lua/lennartalff/init.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require('lennartalff.remap')
|
||||
require('lennartalff.set')
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme 'catppuccin-frappe'
|
||||
65
nvim/lua/lennartalff/packer.lua
Normal file
65
nvim/lua/lennartalff/packer.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
-- packer bootstrapping
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- Packer can manage itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'lewis6991/gitsigns.nvim'
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.1',
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
use({ 'rose-pine/neovim', as = 'rose-pine' })
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
||||
ts_update()
|
||||
end,
|
||||
}
|
||||
use 'tpope/vim-fugitive'
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' }, -- Required
|
||||
{ -- Optional
|
||||
'williamboman/mason.nvim',
|
||||
run = function()
|
||||
pcall(vim.cmd, 'MasonUpdate')
|
||||
end,
|
||||
},
|
||||
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' }, -- Required
|
||||
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
|
||||
{ 'L3MON4D3/LuaSnip' }, -- Required
|
||||
{ 'mhartington/formatter.nvim' },
|
||||
}
|
||||
}
|
||||
use {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
requires = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-treesitter/nvim-treesitter" }
|
||||
}
|
||||
}
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
34
nvim/lua/lennartalff/remap.lua
Normal file
34
nvim/lua/lennartalff/remap.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
vim.g.mapleader = " "
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
-- move selected text
|
||||
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set('n', 'J', 'mzJ`z')
|
||||
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||
|
||||
-- yank to clipboard
|
||||
vim.keymap.set('n', '<leader>y', '"+y')
|
||||
vim.keymap.set('v', '<leader>y', '"+y')
|
||||
|
||||
-- delete to void
|
||||
vim.keymap.set('n', '<leader>d', '"_d')
|
||||
vim.keymap.set('v', '<leader>d', '"_d')
|
||||
|
||||
vim.keymap.set('i', '<C-c>', '<Esc>')
|
||||
|
||||
-- avoid accidentally closing everything!
|
||||
vim.keymap.set('n', 'Q', '<nop>')
|
||||
|
||||
vim.keymap.set('n', '<leader>f', function()
|
||||
vim.lsp.buf.format()
|
||||
end)
|
||||
|
||||
-- quickfix navigation
|
||||
vim.keymap.set('n', '<C-j>', '<cmd>cnext<CR>zz')
|
||||
vim.keymap.set('n', '<C-k>', '<cmd>cprev<CR>zz')
|
||||
vim.keymap.set('n', '<leader>j', '<cmd>lnext<CR>zz')
|
||||
vim.keymap.set('n', '<leader>k', '<cmd>lprev<CR>zz')
|
||||
29
nvim/lua/lennartalff/set.lua
Normal file
29
nvim/lua/lennartalff/set.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- vim.opt.guicursor = ''
|
||||
|
||||
-- line numbers
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- default indentation
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.api.nvim_create_autocmd("FileTYpe", {
|
||||
pattern = "cpp",
|
||||
callback = function()
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.tabstop = 2
|
||||
end
|
||||
})
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.updatetime = 500
|
||||
vim.opt.colorcolumn = '80'
|
||||
|
||||
36
nvim/lua/plugins/init.lua
Normal file
36
nvim/lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
'lewis6991/gitsigns.nvim',
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' } }
|
||||
},
|
||||
{ 'rose-pine/neovim', name = 'rose-pine' },
|
||||
{ 'catppuccin/nvim', name = 'catppuccin', priority = 1000 },
|
||||
{ 'tpope/vim-fugitive', name = 'fugitive' },
|
||||
{
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' }, -- Required
|
||||
{ 'williamboman/mason.nvim' }, -- Optional
|
||||
{ 'williamboman/mason-lspconfig.nvim' }, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' }, -- Required
|
||||
{ 'hrsh7th/cmp-nvim-lsp' }, -- Required
|
||||
{ 'L3MON4D3/LuaSnip' }, -- Required
|
||||
},
|
||||
},
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
},
|
||||
{ 'ray-x/lsp_signature.nvim', event = 'VeryLazy', opts = {},
|
||||
config = function(_, opts) require('lsp_signature').setup(opts) end },
|
||||
|
||||
}
|
||||
3
run
Executable file
3
run
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
docker compose run --rm --name ros2-vim dev
|
||||
65
vimrc
65
vimrc
|
|
@ -1,65 +0,0 @@
|
|||
set nocompatible
|
||||
" required for vundle
|
||||
filetype off
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
Plugin 'preservim/nerdtree'
|
||||
Plugin 'ycm-core/YouCompleteMe'
|
||||
Plugin 'NLKNguyen/papercolor-theme'
|
||||
Plugin 'tmsvg/pear-tree'
|
||||
Plugin 'vim-airline/vim-airline'
|
||||
Plugin 'vim-airline/vim-airline-themes'
|
||||
Plugin 'aonemd/quietlight.vim'
|
||||
|
||||
call vundle#end()
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
set tabstop=4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
|
||||
"disable soft wraps
|
||||
set nowrap
|
||||
augroup WrapLine
|
||||
autocmd!
|
||||
autocmd FileType txt setlocal wrap
|
||||
autocmd FileType rst setlocal wrap
|
||||
augroup End
|
||||
" enable line numbers
|
||||
set number relativenumber
|
||||
set nu rnu
|
||||
set ruler
|
||||
set visualbell
|
||||
set encoding=utf-8
|
||||
set ttyfast
|
||||
let mapleader=","
|
||||
|
||||
" always show mode status line
|
||||
set laststatus=2
|
||||
" always show mode
|
||||
set showmode
|
||||
|
||||
|
||||
inoremap jj <ESC>
|
||||
|
||||
nnoremap <leader>t :NERDTreeToggle<CR>
|
||||
nnoremap <leader>n :NERDTreeFocus<CR>
|
||||
nnoremap <C-f> :NERDTreeFind<CR>
|
||||
|
||||
set t_Co=256
|
||||
set background=light
|
||||
silent! colorscheme quietlight
|
||||
let g:airline_theme='papercolor'
|
||||
:set colorcolumn=81,121
|
||||
|
||||
let g:clang_format_fallback_style="Google"
|
||||
let g:ycm_autoclose_preview_window_after_completion=1
|
||||
let g:ycm_confirm_extra_conf=0
|
||||
let g:ycm_always_populate_location_list=1
|
||||
let g:ycm_clangd_args=['--header-insertion=never']
|
||||
|
||||
autocmd FileType c,cpp nnoremap <leader>f :py3f $HOME/clang-format.py<CR>
|
||||
autocmd FileType c,cpp vnoremap <leader>f :py3f $HOME/clang-format.py<CR>
|
||||
" autocmd FileType python nnoremap <leader><F> :0,$!yapf<CR><C-o>
|
||||
autocmd FileType python nnoremap <leader>f :0,$!yapf<CR><C-o>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
|
||||
def find_ros_python_packages():
|
||||
ros_ws = os.environ['ROS_WORKSPACE']
|
||||
cmd = shlex.split(
|
||||
f'bash -c "source {ros_ws}/install/setup.bash && echo $PYTHONPATH"')
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
for line in p.stdout:
|
||||
paths = line.rstrip().split(':')
|
||||
p.communicate()
|
||||
return paths
|
||||
|
||||
def Settings(**kwargs):
|
||||
return {'sys_path': find_ros_python_packages()}
|
||||
Loading…
Reference in a new issue