updae
This commit is contained in:
parent
159fadd35b
commit
0ec4e62a17
24 changed files with 376 additions and 124 deletions
|
|
@ -53,6 +53,7 @@ RUN apt-get update \
|
||||||
ros-${ROS_DISTR}-rqt-tf-tree \
|
ros-${ROS_DISTR}-rqt-tf-tree \
|
||||||
ros-${ROS_DISTR}-apriltag \
|
ros-${ROS_DISTR}-apriltag \
|
||||||
ros-${ROS_DISTR}-plotjuggler-ros \
|
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_underlay/src -y --ignore-src \
|
||||||
# && rosdep install --from paths /ros2/src -y --ignore-src \
|
# && rosdep install --from paths /ros2/src -y --ignore-src \
|
||||||
&& apt-get autoremove -y \
|
&& 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 \
|
&& 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 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-get install ./ros-iron-px4-msgs_2.0.1-0jammy_amd64.deb \
|
||||||
|
&& sudo apt install asciinema \
|
||||||
&& sudo apt-get autoremove -y \
|
&& sudo apt-get autoremove -y \
|
||||||
&& sudo apt-get clean -y \
|
&& sudo apt-get clean -y \
|
||||||
&& sudo rm -rf /var/lib/apt/lists/*
|
&& sudo rm -rf /var/lib/apt/lists/*
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,6 @@ echo 'source $HOME/uuv/ros2/install/local_setup.zsh' >> ~/.zshrc
|
||||||
echo 'export RCUTILS_COLORIZED_OUTPUT=1' >> ~/.zshrc
|
echo 'export RCUTILS_COLORIZED_OUTPUT=1' >> ~/.zshrc
|
||||||
echo 'eval "$(register-python-argcomplete3 ros2)"' >> ~/.zshrc
|
echo 'eval "$(register-python-argcomplete3 ros2)"' >> ~/.zshrc
|
||||||
echo 'eval "$(register-python-argcomplete3 colcon)"' >> ~/.zshrc
|
echo 'eval "$(register-python-argcomplete3 colcon)"' >> ~/.zshrc
|
||||||
|
echo "bindkey '^ ' autosuggest-toggle" >> ~/.zshrc
|
||||||
|
|
||||||
exec $@
|
exec $@
|
||||||
|
|
|
||||||
4
nvim/after/ftplugin/cmake.lua
Normal file
4
nvim/after/ftplugin/cmake.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.softtabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
1
nvim/after/ftplugin/cpp.lua
Normal file
1
nvim/after/ftplugin/cpp.lua
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
vim.opt_local.shiftwidth = 2
|
||||||
6
nvim/after/ftplugin/rst.lua
Normal file
6
nvim/after/ftplugin/rst.lua
Normal 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
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
function ColorMyPencils(color)
|
|
||||||
color = color or "rose-pine"
|
|
||||||
vim.cmd.colorscheme(color)
|
|
||||||
end
|
|
||||||
|
|
||||||
ColorMyPencils()
|
|
||||||
14
nvim/after/plugin/lualsp.lua
Normal file
14
nvim/after/plugin/lualsp.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup({
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = {
|
||||||
|
'vim',
|
||||||
|
'require',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
46
nvim/after/plugin/luasnip.lua
Normal file
46
nvim/after/plugin/luasnip.lua
Normal 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)
|
||||||
2
nvim/after/plugin/neotree.lua
Normal file
2
nvim/after/plugin/neotree.lua
Normal 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>')
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
||||||
vim.keymap.set("n", "C-p", builtin.git_files, {})
|
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
||||||
vim.keymap.set("n", "<leader>ps", function()
|
vim.keymap.set("n", '<C-s>', function()
|
||||||
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
require('lennartalff.remap')
|
require('lennartalff.remap')
|
||||||
require('lennartalff.set')
|
require('lennartalff.set')
|
||||||
-- vim.cmd('colorscheme rose-pine')
|
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
vim.cmd.colorscheme 'catppuccin-frappe'
|
vim.cmd.colorscheme 'catppuccin-frappe'
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
|
|
@ -42,3 +42,12 @@ local function quickfix()
|
||||||
end
|
end
|
||||||
vim.keymap.set('n', '<leader>qf', quickfix)
|
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')
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
-- vim.opt.guicursor = ''
|
-- vim.opt.guicursor = ''
|
||||||
|
vim.notify = require('notify')
|
||||||
|
|
||||||
-- line numbers
|
-- line numbers
|
||||||
vim.opt.nu = true
|
vim.opt.nu = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|
||||||
|
-- highlight current line
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
vim.opt.breakindent = true
|
vim.opt.breakindent = true
|
||||||
|
|
||||||
-- default indentation
|
-- default indentation
|
||||||
|
|
@ -16,11 +20,10 @@ vim.opt.smartindent = true
|
||||||
|
|
||||||
vim.opt.wrap = false
|
vim.opt.wrap = false
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = "cpp",
|
pattern = 'Makefile',
|
||||||
callback = function ()
|
callback = function ()
|
||||||
vim.opt_local.shiftwidth = 2
|
vim.opt_local.expandtab = false
|
||||||
vim.opt_local.tabstop = 2
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -28,16 +31,3 @@ vim.opt.scrolloff = 8
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.opt.signcolumn = 'yes'
|
||||||
vim.opt.updatetime = 500
|
vim.opt.updatetime = 500
|
||||||
vim.opt.colorcolumn = '80'
|
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
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ return {
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'nvim_lua' },
|
{ name = 'nvim_lua' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
|
|
||||||
11
nvim/lua/plugins/config-local.lua
Normal file
11
nvim/lua/plugins/config-local.lua
Normal 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
2
nvim/lua/plugins/ibl.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
require('ibl').setup()
|
||||||
|
return {}
|
||||||
|
|
@ -2,18 +2,25 @@ return {
|
||||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||||
{
|
{
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
tag = 'v2.*',
|
version = "v2.*",
|
||||||
build = 'make install_jsregexp',
|
build = 'make install_jsregexp',
|
||||||
},
|
},
|
||||||
|
{ 'saadparwaiz1/cmp_luasnip' },
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'nvim-lua/plenary.nvim' } }
|
{ 'nvim-lua/plenary.nvim' } }
|
||||||
},
|
},
|
||||||
{ 'rose-pine/neovim', name = 'rose-pine' },
|
{
|
||||||
{ 'catppuccin/nvim', name = 'catppuccin', priority = 1000 },
|
'catppuccin/nvim',
|
||||||
{ 'tpope/vim-fugitive', name = 'fugitive' },
|
name = 'catppuccin',
|
||||||
|
priority = 1000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'tpope/vim-fugitive',
|
||||||
|
name = 'fugitive'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'ThePrimeagen/harpoon',
|
'ThePrimeagen/harpoon',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
|
@ -32,4 +39,12 @@ return {
|
||||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
|
main = 'ibl',
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'jiangmiao/auto-pairs',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,13 @@
|
||||||
-- require('cmp_nvim_lsp').default_capabilities()
|
-- 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', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
desc = 'LSP actions',
|
desc = 'LSP actions',
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
|
|
@ -58,6 +65,29 @@ local handlers = {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
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 {
|
return {
|
||||||
|
|
@ -80,7 +110,7 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
handlers = handlers,
|
handlers = handlers,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp',
|
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp', 'lemminx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
11
nvim/lua/plugins/lualine.lua
Normal file
11
nvim/lua/plugins/lualine.lua
Normal 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,
|
||||||
|
}
|
||||||
18
nvim/lua/plugins/neotree.lua
Normal file
18
nvim/lua/plugins/neotree.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
73
nvim/snippets/rst/snippets.lua
Normal file
73
nvim/snippets/rst/snippets.lua
Normal 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),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
}
|
||||||
88
nvim/snippets/tex/environments.lua
Normal file
88
nvim/snippets/tex/environments.lua
Normal 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),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue