This commit is contained in:
Thies Lennart Alff 2023-12-04 16:20:32 +01:00
parent 159fadd35b
commit 0ec4e62a17
24 changed files with 376 additions and 124 deletions

View file

@ -53,6 +53,7 @@ RUN apt-get update \
ros-${ROS_DISTR}-rqt-tf-tree \
ros-${ROS_DISTR}-apriltag \
ros-${ROS_DISTR}-plotjuggler-ros \
ros-${ROS_DISTR}-tf-transformations \
# && rosdep install --from-paths /ros2_underlay/src -y --ignore-src \
# && rosdep install --from paths /ros2/src -y --ignore-src \
&& apt-get autoremove -y \
@ -94,6 +95,7 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
&& pip3 install yapf pre-commit ruff \
&& sudo wget https://hippocampusrobotics.github.io/docs/_downloads/6055b3168d4f0a8cd764ebc481280219/ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \
&& sudo apt-get install ./ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \
&& sudo apt install asciinema \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

View file

@ -12,5 +12,6 @@ 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
echo "bindkey '^ ' autosuggest-toggle" >> ~/.zshrc
exec $@

View file

@ -0,0 +1,4 @@
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true

View file

@ -0,0 +1 @@
vim.opt_local.shiftwidth = 2

View file

@ -0,0 +1,6 @@
vim.opt.wrap = true -- softwrap the text
vim.opt.linebreak = true -- do not break in the middle of words
vim.opt.tabstop = 3
vim.opt.softtabstop = 3
vim.opt.shiftwidth = 3
vim.opt.expandtab = true

View file

@ -1,6 +0,0 @@
function ColorMyPencils(color)
color = color or "rose-pine"
vim.cmd.colorscheme(color)
end
ColorMyPencils()

View file

@ -0,0 +1,14 @@
local lspconfig = require('lspconfig')
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = {
'vim',
'require',
},
},
},
},
})

View file

@ -0,0 +1,46 @@
local ls = require('luasnip')
local ll = require('luasnip.loaders.from_lua')
local types = require('luasnip.util.types')
ls.config.set_config({
enable_autosnippets = true,
store_selection_keys = '<C-s>',
history = true,
updateevents = 'TextChanged,TextChangedI',
delete_check_events = 'TextChanged',
ext_opts = {
[types.insertNode] = {
active = {},
unvisited = {
virt_text = { { '<- insert', 'DiagnosticVirtualTextHint' } }
},
visited = {},
passive = {},
snippet_passive = {},
},
[types.choiceNode] = {
active = {
virt_text = { { '<- insert', 'DiagnosticVirtualTextError' } },
},
}
},
})
ll.load({ paths = { vim.fn.stdpath('config') .. '/snippets' } })
vim.keymap.set({ 'i', 's' }, '<C-j>', function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-k>', function()
if ls.jumpable(-1) then
ls.jump(-1)
end
end, { silent = true })
vim.keymap.set('n', '<leader><leader>s', function()
vim.cmd('source ' .. vim.fn.stdpath('config') .. '/after/plugin/luasnip.lua')
vim.notify('Sourced snippets', 'info', { title = 'LuaSnip' })
end)

View file

@ -0,0 +1,2 @@
vim.keymap.set('n', '<leader>nf', '<cmd>Neotree<cr>')
vim.keymap.set('n', '<leader>nb', '<cmd>Neotree source=buffers<cr>')

View file

@ -1,6 +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()
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set("n", '<C-s>', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)

View file

@ -1,5 +1,4 @@
require('lennartalff.remap')
require('lennartalff.set')
-- vim.cmd('colorscheme rose-pine')
vim.o.termguicolors = true
vim.cmd.colorscheme 'catppuccin-frappe'

View file

@ -1,65 +0,0 @@
-- 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)

View file

@ -42,3 +42,12 @@ local function quickfix()
end
vim.keymap.set('n', '<leader>qf', quickfix)
vim.keymap.set('v', '<leader>dgh', "<cmd>diffget LOCAL<cr>")
vim.keymap.set('v', '<leader>dgl', "<cmd>diffget REMOTE<cr>")
vim.keymap.set('n', '<leader>dgh', "<cmd>diffget LOCAL<cr>")
vim.keymap.set('n', '<leader>dgl', "<cmd>diffget REMOTE<cr>")
-- stay in visual mode after indenting/dedenting
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')

View file

@ -1,9 +1,13 @@
-- vim.opt.guicursor = ''
vim.notify = require('notify')
-- line numbers
vim.opt.nu = true
vim.opt.relativenumber = true
-- highlight current line
vim.opt.cursorline = true
vim.opt.breakindent = true
-- default indentation
@ -16,11 +20,10 @@ 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
vim.api.nvim_create_autocmd('FileType', {
pattern = 'Makefile',
callback = function ()
vim.opt_local.expandtab = false
end
})
@ -28,16 +31,3 @@ vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes'
vim.opt.updatetime = 500
vim.opt.colorcolumn = '80'
vim.api.nvim_create_autocmd('FileType', {
pattern = 'rst',
callback = function()
vim.opt.wrap = true -- softwrap the text
vim.opt.linebreak = true -- do not break in the middle of words
-- rst uses 3 space indents
vim.opt.tabstop = 3
vim.opt.softtabstop = 3
vim.opt.shiftwidth = 3
vim.opt.expandtab = true
end
})

View file

@ -16,6 +16,7 @@ return {
sources = {
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'luasnip' },
},
mapping = cmp.mapping.preset.insert({
['<Tab>'] = cmp.mapping(function(fallback)

View file

@ -0,0 +1,11 @@
return {
'klen/nvim-config-local',
opts = {
config_files = { '.nvim.lua' },
hasfile = vim.fn.stdpath('data') .. '/config-local',
autocommands_create = true,
commands_create = true,
lookup_parents = true,
silent = false,
},
}

2
nvim/lua/plugins/ibl.lua Normal file
View file

@ -0,0 +1,2 @@
require('ibl').setup()
return {}

View file

@ -2,18 +2,25 @@ return {
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
{
'L3MON4D3/LuaSnip',
tag = 'v2.*',
version = "v2.*",
build = 'make install_jsregexp',
},
{ 'saadparwaiz1/cmp_luasnip' },
'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' },
{
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000
},
{
'tpope/vim-fugitive',
name = 'fugitive'
},
{
'ThePrimeagen/harpoon',
dependencies = {
@ -32,4 +39,12 @@ return {
dependencies = 'nvim-treesitter/nvim-treesitter',
config = true,
},
{
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',
opts = {},
},
{
'jiangmiao/auto-pairs',
},
}

View file

@ -7,6 +7,13 @@
-- require('cmp_nvim_lsp').default_capabilities()
--)
--vim.api.nvim_create_autocmd('FileType', {
-- pattern = 'tex',
-- callback = function()
-- require('cmp').setup.buffer { sources = {{ name = 'omni' }} }
-- end,
--})
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(event)
@ -58,6 +65,29 @@ local handlers = {
end,
})
end,
texlab = function()
require('lspconfig').texlab.setup({
settings = {
texlab = {
build = {
onSave = false,
forwardSearchAfter = true,
},
chktex = {
onOpenAndSave = true,
},
forwardSearch = {
executable = 'zathura',
args = {
'--synctex-forward',
'%l:1:%f',
'%p',
},
},
},
},
})
end,
}
return {
@ -80,7 +110,7 @@ return {
opts = {
handlers = handlers,
ensure_installed = {
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp',
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp', 'lemminx',
},
},
},

View file

@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
dependencies = {
{ 'nvim-tree/nvim-web-devicons' },
},
config = function()
require('lualine').setup({
theme = 'catppuccin-frappe'
})
end,
}

View file

@ -0,0 +1,18 @@
return {
{
'nvim-neo-tree/neo-tree.nvim',
branch = 'v3.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'MunifTanjim/nui.nvim',
},
opts = {
filesystem = {
follow_current_file = {
enabled = true,
},
}
},
},
}

View file

@ -0,0 +1,73 @@
local ls = require('luasnip')
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local d = ls.dynamic_node
local fmt = require('luasnip.extras.fmt').fmt
local fmta = require('luasnip.extras.fmt').fmta
local rep = require('luasnip.extras').rep
return {
s(
{
trig = 'console',
name = 'Console Code-Block',
dscr = 'Creates a console code block'
},
fmta(
[[
.. code-block:: console
$ <>
]],
{
i(1),
}
)
),
s(
{
trig = 'shell',
name = 'Shell Code-Block',
dscr = 'Create a shell code block'
},
fmta(
[[
.. code-block:: sh
<>
<>
]],
{
i(1),
i(2),
}
)
),
s(
{
trig = 'python',
name = 'Python Code-Block',
dscr = 'Create python code block',
},
fmta(
[[
.. code-block:: python
:linenos:
:caption: <>
:emphasize-lines: <>
<>
]],
{
i(1),
i(2),
i(3),
}
)
),
}

View file

@ -0,0 +1,88 @@
local ls = require('luasnip')
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local d = ls.dynamic_node
local fmt = require('luasnip.extras.fmt').fmt
local fmta = require('luasnip.extras.fmt').fmta
local rep = require('luasnip.extras').rep
return {
s(
{
trig = 'env',
name = 'Environment',
dscr = 'Creates generic \\begin{} \\end{} environment',
},
fmta(
[[
\begin{<>}
<>
\end{<>}
]],
{
i(1),
i(2),
rep(1),
}
)
),
s(
{
trig = 'frame',
name = 'Beamer Frame',
dscr = 'Frame environment for beamer slides',
},
fmta(
[[
\begin{frame}
\frametitle{<>}
<>
\end{frame}
]],
{
i(1),
i(2),
}
)
),
s(
{
trig = 'frame-fragile',
name = 'Frame Fragile',
dscr = 'Required for verbatim content like code listings.',
},
fmta(
[[
\begin{frame}[fragile]
\frametitle{<>}
<>
\end{frame}
]],
{
i(1),
i(2),
}
)
),
s(
{
trig = 'noindent',
name = 'No Indent',
dscr = 'Add no indent instructin for latexindent. Useful for code-blocks.'
},
fmta(
[[
% \begin{noindent}
<>
% \end{noindent}
]]
,
{
i(1),
}
)
),
}