Compare commits
17 Commits
2f902123a9
...
feature/nv
| Author | SHA1 | Date | |
|---|---|---|---|
| 08585a0010 | |||
| 48ad61643f | |||
| 959cc167c6 | |||
| ba425ecf49 | |||
| b2be54b2b9 | |||
| ffb7d66888 | |||
| 924ba5c280 | |||
| 641fac3142 | |||
| d575ec44e0 | |||
| f45a4bd8c1 | |||
| dcb4e6e71d | |||
| 2bf187255a | |||
| b951634ce6 | |||
| 24fd231176 | |||
| 800ce599e9 | |||
| 9aba8cd855 | |||
| 52d0fd3efa |
@@ -1,3 +1,27 @@
|
||||
require('set')
|
||||
require('plugins')
|
||||
require('keymaps')
|
||||
require('lsp')
|
||||
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
change_detection = { enabled = false },
|
||||
})
|
||||
|
||||
39
nvim/.config/nvim/lazy-lock.json
Normal file
39
nvim/.config/nvim/lazy-lock.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "3979b01cb05734331c7873049001d3f2bb8477f4" },
|
||||
"auto-session": { "branch": "main", "commit": "292492ab7af4bd8b9e37e28508bc8ce995722fd5" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"copilot.lua": { "branch": "master", "commit": "e919876a5523b06406f0bc7285477da87a338a61" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d78fb3b64eedb701c9939f97361c06483af575e0" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "abf6d190f2c06818489c0bd4b926e7e3a06c5e51" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
|
||||
"outline.nvim": { "branch": "main", "commit": "6b62f73a6bf317531d15a7ae1b724e85485d8148" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"sqlite.nvim": { "branch": "master", "commit": "a8466c830a89794c2eafa41b41dd11fdf4a0d7ca" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" },
|
||||
"time-tracker.nvim": { "branch": "master", "commit": "4127c4b5fecaf5f5cb3aa840707e58bb88eb9bf0" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
|
||||
"vim-flog": { "branch": "master", "commit": "665b16ac8915f746bc43c9572b4581a5e9047216" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vimtex": { "branch": "master", "commit": "32bcb3922c20588e00de68f73c86312eda2141ad" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
119
nvim/.config/nvim/lua/lsp.lua
Normal file
119
nvim/.config/nvim/lua/lsp.lua
Normal file
@@ -0,0 +1,119 @@
|
||||
--
|
||||
--
|
||||
-- LSP configs
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
vim.lsp.config("texlab", {
|
||||
settings = {
|
||||
texlab = {
|
||||
rootDirectory = nil,
|
||||
build = {
|
||||
executable = 'latexmk',
|
||||
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '%f' },
|
||||
onSave = false,
|
||||
forwardSearchAfter = false,
|
||||
},
|
||||
forwardSearch = {
|
||||
executable = nil,
|
||||
args = {},
|
||||
},
|
||||
chktex = {
|
||||
onOpenAndSave = false,
|
||||
onEdit = false,
|
||||
},
|
||||
diagnosticsDelay = 300,
|
||||
latexFormatter = 'tex-fmt',
|
||||
bibtexFormatter = 'tex-fmt',
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
vim.lsp.config('clangd', {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--completion-style=bundled",
|
||||
"--cross-file-rename",
|
||||
"--header-insertion=iwyu",
|
||||
-- Required for embedded system compilers
|
||||
"--query-driver=/**/*g++",
|
||||
"--offset-encoding=utf-16"
|
||||
-- "-j=8",
|
||||
-- "--malloc-trim",
|
||||
-- "--pch-storage=memory"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
--
|
||||
-- Diagnostics config
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = function()
|
||||
local width = vim.api.nvim_win_get_width(0);
|
||||
|
||||
vim.diagnostic.open_float(nil, {
|
||||
scope = "cursor",
|
||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||
source = true,
|
||||
relative = "editor",
|
||||
width = 40,
|
||||
focusable = false,
|
||||
focused = false,
|
||||
border = "rounded",
|
||||
title = "Diagnostics",
|
||||
header = "",
|
||||
title_pos = "center",
|
||||
offset_x = width,
|
||||
offset_y = -1,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
--
|
||||
-- Keymaps
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
-- TODO: Do I need this if I use nvim-cmp?
|
||||
vim.o.completeopt = "menu,menuone,noinsert,fuzzy"
|
||||
|
||||
vim.api.nvim_set_keymap("i", "<C-Space>", "<C-x><C-o>", { noremap = true })
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||
callback = function(args)
|
||||
vim.keymap.set('n', '<M-L>',
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set('i', '<M-L>',
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set("n", "gd",
|
||||
function() vim.lsp.buf.definition() end, {
|
||||
desc = "Go to definition"
|
||||
})
|
||||
end,
|
||||
})
|
||||
@@ -85,18 +85,22 @@ end
|
||||
--
|
||||
--
|
||||
|
||||
vim.pack.add({ "https://github.com/goolord/alpha-nvim" })
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = get_random_image()
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
||||
dashboard.button('r', ' Recent files', ':Telescope oldfiles <CR>'),
|
||||
dashboard.button('f', ' Find file', ':Telescope find_files <CR>'),
|
||||
dashboard.button('g', ' Find text', ':Telescope live_grep <CR>'),
|
||||
dashboard.button('p', ' Open project', ':Telescope session-lens search_session<CR>'),
|
||||
dashboard.button('l', ' Lazy', ':Lazy<CR>'),
|
||||
dashboard.button('q', ' Quit', ':qa<CR>')
|
||||
}
|
||||
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = get_random_image()
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button('n', ' New file', ':ene <BAR> startinsert <CR>'),
|
||||
dashboard.button('r', ' Recent files', ':Telescope oldfiles <CR>'),
|
||||
dashboard.button('f', ' Find file', ':Telescope find_files <CR>'),
|
||||
dashboard.button('g', ' Find text', ':Telescope live_grep <CR>'),
|
||||
dashboard.button('p', ' Open project', ':Telescope session-lens search_session<CR>'),
|
||||
dashboard.button('l', ' Lazy', ':Lazy<CR>'),
|
||||
dashboard.button('q', ' Quit', ':qa<CR>')
|
||||
require("alpha").setup(dashboard.opts)
|
||||
end
|
||||
}
|
||||
|
||||
require("alpha").setup(dashboard.opts)
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
vim.pack.add({
|
||||
-- dependencies
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||
{ src = "https://github.com/nvim-telescope/telescope.nvim" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||
-- plugin
|
||||
{ src = "https://github.com/rmagatti/auto-session" }
|
||||
})
|
||||
|
||||
require("auto-session").setup({
|
||||
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||
log_level = "error",
|
||||
auto_save_enabled = false,
|
||||
session_lens = {
|
||||
picker = "telescope",
|
||||
load_on_setup = true,
|
||||
mappings = {
|
||||
delete_session = { "i", "<C-d>" },
|
||||
alternate_session = { "i", "<C-s>" },
|
||||
copy_session = { "i", "<C-y>" },
|
||||
},
|
||||
return {
|
||||
"https://github.com/rmagatti/auto-session",
|
||||
-- TODO: This forces telescope to be loaded non-lazily. Fix this
|
||||
dependencies = {
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
"https://github.com/nvim-telescope/telescope.nvim",
|
||||
"https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
})
|
||||
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
|
||||
vim.keymap.set('n', '<leader>ss', '<cmd>AutoSession save<CR>', { desc = "Save" })
|
||||
vim.keymap.set('n', '<leader>sd', '<cmd>AutoSession delete<CR>', { desc = "Delete" })
|
||||
|
||||
vim.keymap.set('n', '<leader>fs', '<cmd>Telescope session-lens<CR>', { desc = "Session-lens" })
|
||||
init = function()
|
||||
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>ss', '<cmd>AutoSession save<CR>', desc = "Save" },
|
||||
{ '<leader>sd', '<cmd>AutoSession delete<CR>', desc = "Delete" },
|
||||
{ '<leader>fs', '<cmd>Telescope session-lens<CR>', desc = "Session" }
|
||||
},
|
||||
opts = {
|
||||
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||
log_level = "error",
|
||||
auto_save_enabled = false,
|
||||
session_lens = {
|
||||
picker = "telescope",
|
||||
load_on_setup = true,
|
||||
mappings = {
|
||||
delete_session = { "i", "<C-d>" },
|
||||
alternate_session = { "i", "<C-s>" },
|
||||
copy_session = { "i", "<C-y>" },
|
||||
},
|
||||
}
|
||||
},
|
||||
lazy = false,
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
vim.pack.add({ "https://github.com/zbirenbaum/copilot.lua" })
|
||||
|
||||
require("copilot").setup({
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<C-l>"
|
||||
-- accept_word = false,
|
||||
-- accept_line = false,
|
||||
-- next = "<M-]>",
|
||||
-- prev = "<M-[>",
|
||||
-- dismiss = "<C-]>"
|
||||
return {
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
opts = {
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<C-l>"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/tpope/vim-fugitive" },
|
||||
{ src = "https://github.com/rbong/vim-flog" }
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
return {
|
||||
{
|
||||
"https://github.com/tpope/vim-fugitive",
|
||||
keys = { { "<leader>gs", vim.cmd.Git } }
|
||||
},
|
||||
{
|
||||
"https://github.com/rbong/vim-flog",
|
||||
dependencies = {
|
||||
"https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
cmd = "Flog"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
src = "https://github.com/nvim-lua/plenary.nvim"
|
||||
return
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
{ "<leader>a", function() require("harpoon"):list():add() end },
|
||||
{ "<C-e>", function() require("harpoon").ui:toggle_quick_menu(require("harpoon"):list()) end },
|
||||
{ "<C-h>", function() require("harpoon"):list():select(1) end },
|
||||
{ "<C-t>", function() require("harpoon"):list():select(2) end },
|
||||
{ "<C-n>", function() require("harpoon"):list():select(3) end },
|
||||
{ "<C-s>", function() require("harpoon"):list():select(4) end },
|
||||
},
|
||||
{
|
||||
src = "https://github.com/ThePrimeagen/harpoon",
|
||||
version = "harpoon2",
|
||||
}
|
||||
})
|
||||
config = true
|
||||
}
|
||||
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
|
||||
-- vim.pack.add({
|
||||
-- {
|
||||
-- src = "https://github.com/nvim-lua/plenary.nvim"
|
||||
-- },
|
||||
-- {
|
||||
-- src = "https://github.com/ThePrimeagen/harpoon",
|
||||
-- version = "harpoon2",
|
||||
-- }
|
||||
-- })
|
||||
--
|
||||
-- local harpoon = require("harpoon")
|
||||
--
|
||||
-- harpoon:setup()
|
||||
--
|
||||
-- vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
-- vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
--
|
||||
-- vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
-- vim.keymap.set("n", "<C-t>", function() harpoon:list():select(2) end)
|
||||
-- vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
|
||||
-- vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
local plugin_dir = vim.fn.stdpath('config') .. '/lua/plugins'
|
||||
local plugin_files = vim.fn.glob(plugin_dir .. '/*.lua', false, true)
|
||||
|
||||
for _, file in ipairs(plugin_files) do
|
||||
local plugin_name = vim.fn.fnamemodify(file, ':t:r')
|
||||
|
||||
if plugin_name ~= "init" then
|
||||
require('plugins.' .. plugin_name)
|
||||
end
|
||||
end
|
||||
@@ -1,114 +0,0 @@
|
||||
--
|
||||
--
|
||||
-- Plugin config
|
||||
--
|
||||
--
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||
{ src = "https://github.com/mason-org/mason-lspconfig.nvim" },
|
||||
{ src = "https://github.com/mason-org/mason.nvim" },
|
||||
})
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
--
|
||||
--
|
||||
-- Diagnostic config
|
||||
--
|
||||
--
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = function()
|
||||
local width = vim.api.nvim_win_get_width(0);
|
||||
|
||||
vim.diagnostic.open_float(nil, {
|
||||
scope = "cursor",
|
||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||
source = true,
|
||||
relative = "editor",
|
||||
width = 40,
|
||||
focusable = false,
|
||||
-- focus = false,
|
||||
border = "rounded",
|
||||
title = "Diagnostics",
|
||||
header = "",
|
||||
title_pos = "center",
|
||||
offset_x = width,
|
||||
offset_y = -1,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim.diagnostic.handlers["quickfix"] = {
|
||||
-- show = function(_, _, _, _)
|
||||
-- vim.diagnostic.setqflist({ open = false })
|
||||
-- end,
|
||||
--
|
||||
-- hide = function(_, _)
|
||||
-- vim.fn.setqflist({}, 'r')
|
||||
-- end
|
||||
-- }
|
||||
|
||||
--
|
||||
--
|
||||
-- Completion & Formatting
|
||||
--
|
||||
--
|
||||
|
||||
vim.o.completeopt = "menu,menuone,noinsert,fuzzy"
|
||||
vim.api.nvim_set_keymap("i", "<C-Space>", "<C-x><C-o>", { noremap = true })
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||
callback = function(args)
|
||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||
|
||||
-- Make tab accept the selected completion
|
||||
vim.keymap.set('i', '<Tab>', function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return '<C-y>'
|
||||
else
|
||||
return '<Tab>'
|
||||
end
|
||||
end, { expr = true })
|
||||
|
||||
-- Make enter just insert a newline (don't accept completion)
|
||||
vim.keymap.set('i', '<CR>', function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return '<C-e><CR>'
|
||||
else
|
||||
return '<CR>'
|
||||
end
|
||||
end, { expr = true })
|
||||
|
||||
if client:supports_method('textDocument/completion') then
|
||||
-- Trigger autocompletion on every keypress
|
||||
local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
|
||||
client.server_capabilities.completionProvider.triggerCharacters = chars
|
||||
|
||||
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<M-L>',
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set('i', '<M-L>',
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, { desc = "Go to definition" })
|
||||
end,
|
||||
})
|
||||
@@ -1,18 +1,36 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" }
|
||||
})
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = 'gruvbox_dark'
|
||||
},
|
||||
extensions = {
|
||||
'nvim-tree',
|
||||
'trouble',
|
||||
'mason',
|
||||
'lazy',
|
||||
'toggleterm'
|
||||
},
|
||||
sections = { lualine_x = { { color = { fg = "#ff9e64" } } } }
|
||||
})
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = { theme = 'gruvbox_dark' },
|
||||
extensions = {
|
||||
'mason',
|
||||
'toggleterm'
|
||||
},
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
shorting_target = 50,
|
||||
}
|
||||
},
|
||||
lualine_b = { 'branch' },
|
||||
lualine_x = { 'encoding' },
|
||||
lualine_y = {
|
||||
{
|
||||
function()
|
||||
local reg = vim.fn.reg_recording()
|
||||
if reg ~= "" then
|
||||
return "Recording @" .. reg
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end,
|
||||
color = { fg = "#fabd2f" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
nvim/.config/nvim/lua/plugins/luasnip.lua
Normal file
17
nvim/.config/nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"https://github.com/rafamadriz/friendly-snippets",
|
||||
dependencies = { "https://github.com/L3MON4D3/LuaSnip" },
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local loader = require("luasnip.loaders.from_lua")
|
||||
loader.lazy_load({ paths = { "./snippets" } })
|
||||
|
||||
require("luasnip").config.set_config({
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = "<leader>v"
|
||||
})
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<c-j>", function() require("luasnip").jump(1) end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<c-k>", function() require("luasnip").jump(-1) end, { silent = true })
|
||||
end
|
||||
}
|
||||
9
nvim/.config/nvim/lua/plugins/mason.lua
Normal file
9
nvim/.config/nvim/lua/plugins/mason.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", config = true },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
config = true,
|
||||
}
|
||||
@@ -1,28 +1,40 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/MunifTanjim/nui.nvim" },
|
||||
{ src = "https://github.com/folke/noice.nvim" }
|
||||
})
|
||||
|
||||
require("noice").setup({
|
||||
messages = { enabled = false },
|
||||
views = {
|
||||
cmdline_popup = {
|
||||
backend = "popup",
|
||||
relative = "editor",
|
||||
position = {
|
||||
row = -1,
|
||||
col = "0%"
|
||||
return {
|
||||
"https://github.com/folke/noice.nvim",
|
||||
dependencies = { "https://github.com/MunifTanjim/nui.nvim" },
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- messages = { enabled = false },
|
||||
views = {
|
||||
history = {
|
||||
{ event = "lsp", kind = "" },
|
||||
},
|
||||
border = {
|
||||
style = "none"
|
||||
}
|
||||
},
|
||||
cmdline_popupmenu = {
|
||||
relative = "editor",
|
||||
position = {
|
||||
row = -2,
|
||||
col = "0%"
|
||||
cmdline_popup = {
|
||||
backend = "popup",
|
||||
relative = "editor",
|
||||
position = {
|
||||
row = -1,
|
||||
col = "0%"
|
||||
},
|
||||
border = { style = "none" }
|
||||
},
|
||||
cmdline_popupmenu = {
|
||||
relative = "editor",
|
||||
position = {
|
||||
row = -2,
|
||||
col = "0%"
|
||||
}
|
||||
},
|
||||
mini = {
|
||||
border = { style = "rounded" },
|
||||
position = {
|
||||
row = -2,
|
||||
col = "100%",
|
||||
},
|
||||
size = {
|
||||
max_width = 50,
|
||||
max_height = 4,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
70
nvim/.config/nvim/lua/plugins/nvim-cmp.lua
Normal file
70
nvim/.config/nvim/lua/plugins/nvim-cmp.lua
Normal file
@@ -0,0 +1,70 @@
|
||||
return
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'L3MON4D3/LuaSnip',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
-- TODO: Do I need these?
|
||||
'hrsh7th/cmp-cmdline',
|
||||
-- 'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||
'saadparwaiz1/cmp_luasnip'
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
-- window = {
|
||||
-- -- completion = cmp.config.window.bordered(),
|
||||
-- -- documentation = cmp.config.window.bordered(),
|
||||
-- },
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<Tab>'] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- -- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- -- Set configuration for specific filetype.
|
||||
-- cmp.setup.filetype('gitcommit', {
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = 'git' },
|
||||
-- }, {
|
||||
-- { name = 'buffer' },
|
||||
-- })
|
||||
-- })
|
||||
-- require("cmp_git").setup()
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- -- Set up lspconfig.
|
||||
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
-- vim.lsp.config('<YOUR_LSP_SERVER>', {
|
||||
-- capabilities = capabilities
|
||||
-- })
|
||||
-- vim.lsp.enable('<YOUR_LSP_SERVER>')
|
||||
end
|
||||
|
||||
}
|
||||
@@ -1,4 +1,11 @@
|
||||
vim.pack.add({"https://github.com/stevearc/oil.nvim"})
|
||||
require("oil").setup()
|
||||
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
lazy = false, -- Make sure oil is available for, e.g., `nvim .`
|
||||
init = function()
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||
end,
|
||||
config = true
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
vim.pack.add({ "https://github.com/hedyhli/outline.nvim" })
|
||||
require("outline").setup({
|
||||
outline_window = {
|
||||
focus_on_open = false,
|
||||
return {
|
||||
"https://github.com/hedyhli/outline.nvim",
|
||||
keys = {
|
||||
{ "<leader>l", "<cmd>Outline<CR>", desc = "Toggle Outline" }
|
||||
},
|
||||
symbol_folding = {
|
||||
autofold_depth = 3,
|
||||
markers = { '', '' },
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>l", "<cmd>Outline<CR>", { desc = "Toggle Outline" })
|
||||
opts = {
|
||||
outline_window = {
|
||||
focus_on_open = false,
|
||||
},
|
||||
symbol_folding = {
|
||||
autofold_depth = 3,
|
||||
markers = { '', '' },
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/stevearc/overseer.nvim", version = "v1.6.0" }
|
||||
})
|
||||
|
||||
require("overseer").setup({
|
||||
templates = {
|
||||
"user.cargo_build",
|
||||
"user.cargo_clean",
|
||||
"user.cargo_run",
|
||||
"user.cargo_test",
|
||||
"user.cmake_generate",
|
||||
"user.cmake_build",
|
||||
"user.cmake_clean",
|
||||
"user.cmake_test",
|
||||
"user.python_run"
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>oo", function() require("overseer").toggle() end, { desc = "Toggle" })
|
||||
vim.keymap.set("n", "<leader>or", ":OverseerRun<CR>", { desc = "Run" })
|
||||
vim.keymap.set("n", "<leader>oq", ":OverseerQuickAction<CR>", { desc = "Quick Action" })
|
||||
vim.keymap.set("n", "<leader>of", ":OverseerQuickAction open float<CR>", { desc = "Open Float" })
|
||||
@@ -1,2 +0,0 @@
|
||||
vim.pack.add({"https://github.com/stevearc/quicker.nvim"})
|
||||
require("quicker").setup()
|
||||
@@ -1 +1,4 @@
|
||||
vim.pack.add({"https://github.com/tpope/vim-surround"})
|
||||
return {
|
||||
"https://github.com/tpope/vim-surround",
|
||||
event = "InsertEnter"
|
||||
}
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||
{ src = "https://github.com/nvim-telescope/telescope.nvim" },
|
||||
{ src = "https://github.com/nvim-telescope/telescope-ui-select.nvim" }
|
||||
})
|
||||
|
||||
vim.pack.add({})
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', function() require("telescope.builtin").find_files() end, { desc = "Files" })
|
||||
vim.keymap.set('n', '<leader>fg', function() require("telescope.builtin").live_grep() end, { desc = "grep" })
|
||||
vim.keymap.set('n', '<leader>fa', function() require("telescope.builtin").find_files({ hidden = true }) end,
|
||||
{ desc = "All files" })
|
||||
|
||||
vim.keymap.set('n', '<leader>fb', function() require("telescope.builtin").buffers() end, { desc = "Buffers" })
|
||||
vim.keymap.set('n', '<leader>fh', function() require("telescope.builtin").help_tags() end, { desc = "Help tags" })
|
||||
|
||||
-- require("telescope").setup {
|
||||
-- -- extensions = {
|
||||
-- -- ["ui-select"] = {
|
||||
-- -- require("telescope.themes").get_dropdown {
|
||||
-- -- }
|
||||
-- -- }
|
||||
-- -- }
|
||||
-- }
|
||||
|
||||
require("telescope").load_extension("ui-select")
|
||||
return {
|
||||
"https://github.com/nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"https://github.com/nvim-lua/plenary.nvim",
|
||||
"https://github.com/nvim-telescope/telescope-ui-select.nvim",
|
||||
},
|
||||
cmd = { "Telescope" },
|
||||
keys = {
|
||||
{ "<leader>ff", function() require("telescope.builtin").find_files() end, desc = "Files" },
|
||||
{ "<leader>fg", function() require("telescope.builtin").live_grep() end, desc = "grep" },
|
||||
{ "<leader>fa", function() require("telescope.builtin").find_files({ hidden = true }) end, desc = "All files" },
|
||||
{ "<leader>fb", function() require("telescope.builtin").buffers() end, desc = "Buffers" },
|
||||
{ "<leader>fh", function() require("telescope.builtin").help_tags() end, desc = "Help tags" }
|
||||
},
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown()
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
vim.pack.add({"https://github.com/ellisonleao/gruvbox.nvim"})
|
||||
|
||||
require("gruvbox").setup({
|
||||
contrast = "hard",
|
||||
transparent_mode = true,
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
contrast = "hard",
|
||||
transparent_mode = true
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("gruvbox").setup(opts)
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/3rd/sqlite.nvim" },
|
||||
{ src = "https://github.com/3rd/time-tracker.nvim" }
|
||||
})
|
||||
|
||||
require("time-tracker").setup({
|
||||
data_file = vim.fn.stdpath("data") .. "/time-tracker.db"
|
||||
})
|
||||
return {
|
||||
"3rd/time-tracker.nvim",
|
||||
dependencies = {
|
||||
"3rd/sqlite.nvim"
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
data_file = vim.fn.stdpath("data") .. "/time-tracker.db"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||
{ src = "https://github.com/folke/todo-comments.nvim" }
|
||||
})
|
||||
|
||||
require("todo-comments").setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>ft", ":TodoTelescope<CR>")
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
event = "BufEnter",
|
||||
keys = {
|
||||
{"<leader>ft", ":TodoTelescope<CR>", desc = "TODOs"}
|
||||
},
|
||||
config = true
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
vim.pack.add({ "https://github.com/akinsho/toggleterm.nvim" })
|
||||
|
||||
require("toggleterm").setup({
|
||||
size = 30,
|
||||
open_mapping = [[<c-\>]]
|
||||
})
|
||||
return {
|
||||
"https://github.com/akinsho/toggleterm.nvim",
|
||||
keys = {
|
||||
"<c-\\>"
|
||||
},
|
||||
opts = {
|
||||
size = 30,
|
||||
open_mapping = "<c-\\>"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"cpp",
|
||||
"c",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query"
|
||||
},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = {
|
||||
"latex"
|
||||
}
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
branxh = "main",
|
||||
lazy = false, -- This plugin doesn't support lazy loading
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"cpp",
|
||||
"c",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query"
|
||||
},
|
||||
sync_install = false,
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
-- disable = { "latex" },
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = {
|
||||
"latex"
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
vim.pack.add({"https://github.com/mbbill/undotree"})
|
||||
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<CR>", { desc = "Undotree" })
|
||||
return {
|
||||
"https://github.com/mbbill/undotree",
|
||||
keys = {
|
||||
{ "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Undotree" }
|
||||
}
|
||||
}
|
||||
|
||||
47
nvim/.config/nvim/lua/plugins/vimtex.lua
Normal file
47
nvim/.config/nvim/lua/plugins/vimtex.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- For backward search to work, :VimtexInverseSearch must always be available
|
||||
config = function()
|
||||
-- General configuration
|
||||
|
||||
vim.cmd("syntax enable")
|
||||
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
out_dir = 'build',
|
||||
options = {
|
||||
'-shell-escape',
|
||||
'-verbose',
|
||||
'-file-line-error',
|
||||
'-interaction=nonstopmode',
|
||||
'-synctex=1'
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.vimtex_view_method = 'zathura_simple'
|
||||
vim.g.vimtex_quickfix_mode = 0
|
||||
|
||||
-- Concealment
|
||||
|
||||
vim.o.conceallevel = 1
|
||||
|
||||
vim.g.vimtex_syntax_conceal = {
|
||||
accents = 1,
|
||||
ligatures = 1,
|
||||
cites = 1,
|
||||
fancy = 1,
|
||||
spacing = 0,
|
||||
greek = 1,
|
||||
math_bounds = 1,
|
||||
math_delimiters = 1,
|
||||
math_fracs = 1,
|
||||
math_super_sub = 0,
|
||||
math_symbols = 1,
|
||||
sections = 0,
|
||||
styles = 0,
|
||||
}
|
||||
|
||||
vim.g.vimtex_syntax_custom_cmds = {
|
||||
{ name = 'bm', mathmode = 1, argstyle = 'bold', conceal = 1 },
|
||||
}
|
||||
end
|
||||
}
|
||||
@@ -1,19 +1,26 @@
|
||||
vim.pack.add({ "https://github.com/folke/which-key.nvim" })
|
||||
return {
|
||||
"https://github.com/folke/which-key.nvim",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- TODO: Add names for other nameless keymaps, e.g.,
|
||||
-- defaults = {
|
||||
-- ["<leader>x"] = { name = "+Trouble" }
|
||||
-- }
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("which-key").setup(opts)
|
||||
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
require("which-key").setup({
|
||||
-- defaults = {
|
||||
-- ["<leader>x"] = { name = "+Trouble" }
|
||||
-- }
|
||||
})
|
||||
|
||||
require("which-key").add({
|
||||
{ "<leader>d", group = "Debug" },
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>l", group = "LSP" },
|
||||
{ "<leader>o", group = "Overseer" },
|
||||
{ "<leader>s", group = "Session" },
|
||||
{ "<leader>x", group = "Trouble" }
|
||||
})
|
||||
require("which-key").add({
|
||||
{ "<leader>d", group = "Debug" },
|
||||
{ "<leader>f", group = "Find" },
|
||||
{ "<leader>l", group = "LSP" },
|
||||
{ "<leader>o", group = "Overseer" },
|
||||
{ "<leader>s", group = "Session" },
|
||||
{ "<leader>x", group = "Trouble" }
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.undofile = true
|
||||
|
||||
@@ -22,6 +24,37 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||
callback = function() vim.bo.commentstring = '// %s' end
|
||||
})
|
||||
|
||||
-- TODO: Is this necessary?
|
||||
--
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- pattern = 'rust',
|
||||
-- callback = function()
|
||||
-- vim.cmd [[
|
||||
-- let &efm = ''
|
||||
-- " Random non issue stuff
|
||||
-- let &efm .= '%-G%.%#aborting due to previous error%.%#,'
|
||||
-- let &efm .= '%-G%.%#test failed, to rerun pass%.%#,'
|
||||
-- " Capture enter directory events for doc tests
|
||||
-- let &efm .= '%D%*\sDoc-tests %f%.%#,'
|
||||
-- " Doc Tests
|
||||
-- let &efm .= '%E---- %f - %o (line %l) stdout ----,'
|
||||
-- let &efm .= '%Cerror%m,'
|
||||
-- let &efm .= '%-Z%*\s--> %f:%l:%c,'
|
||||
-- " Unit tests && `tests/` dir failures
|
||||
-- " This pattern has to come _after_ the doc test one
|
||||
-- let &efm .= '%E---- %o stdout ----,'
|
||||
-- let &efm .= '%Zthread %.%# panicked at %m\, %f:%l:%c,'
|
||||
-- let &efm .= '%Cthread %.%# panicked at %m,'
|
||||
-- let &efm .= '%+C%*\sleft: %.%#,'
|
||||
-- let &efm .= '%+Z%*\sright: %.%#\, %f:%l:%c,'
|
||||
-- " Compiler Errors and Warnings
|
||||
-- let &efm .= '%Eerror%m,'
|
||||
-- let &efm .= '%Wwarning: %m,'
|
||||
-- let &efm .= '%-Z%*\s--> %f:%l:%c,'
|
||||
-- ]]
|
||||
-- end
|
||||
-- })
|
||||
|
||||
vim.opt.cmdheight = 0
|
||||
|
||||
vim.o.updatetime = 50
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
{
|
||||
"plugins": {
|
||||
"alpha-nvim": {
|
||||
"rev": "3979b01",
|
||||
"src": "https://github.com/goolord/alpha-nvim"
|
||||
},
|
||||
"auto-session": {
|
||||
"rev": "292492a",
|
||||
"src": "https://github.com/rmagatti/auto-session"
|
||||
},
|
||||
"copilot.lua": {
|
||||
"rev": "5bde2cf",
|
||||
"src": "https://github.com/zbirenbaum/copilot.lua"
|
||||
},
|
||||
"dressing.nvim": {
|
||||
"rev": "2d7c2db",
|
||||
"src": "https://github.com/stevearc/dressing.nvim"
|
||||
},
|
||||
"gruvbox.nvim": {
|
||||
"rev": "5e0a460",
|
||||
"src": "https://github.com/ellisonleao/gruvbox.nvim"
|
||||
},
|
||||
"harpoon": {
|
||||
"rev": "87b1a35",
|
||||
"src": "https://github.com/ThePrimeagen/harpoon",
|
||||
"version": "'harpoon2'"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "3946f01",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "d7b5feb",
|
||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
"rev": "ad7146a",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"noice.nvim": {
|
||||
"rev": "7bfd942",
|
||||
"src": "https://github.com/folke/noice.nvim"
|
||||
},
|
||||
"nui.nvim": {
|
||||
"rev": "de74099",
|
||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "2010fc6",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-notify": {
|
||||
"rev": "8701bec",
|
||||
"src": "https://github.com/rcarriga/nvim-notify"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "42fc28ba",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "8dcb311",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "7e1cd77",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"outline.nvim": {
|
||||
"rev": "6b62f73",
|
||||
"src": "https://github.com/hedyhli/outline.nvim"
|
||||
},
|
||||
"overseer.nvim": {
|
||||
"rev": "c77c78b",
|
||||
"src": "https://github.com/stevearc/overseer.nvim",
|
||||
"version": "'v1.6.0'"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "b9fd522",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"quicker.nvim": {
|
||||
"rev": "12a2291",
|
||||
"src": "https://github.com/stevearc/quicker.nvim"
|
||||
},
|
||||
"session-lens": {
|
||||
"rev": "eae46b4",
|
||||
"src": "https://github.com/rmagatti/session-lens"
|
||||
},
|
||||
"snacks.nvim": {
|
||||
"rev": "9a15b31",
|
||||
"src": "https://github.com/folke/snacks.nvim"
|
||||
},
|
||||
"sqlite.nvim": {
|
||||
"rev": "a8466c8",
|
||||
"src": "https://github.com/3rd/sqlite.nvim"
|
||||
},
|
||||
"telescope-ui-select.nvim": {
|
||||
"rev": "6e51d7d",
|
||||
"src": "https://github.com/nvim-telescope/telescope-ui-select.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "0294ae3",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"time-tracker.nvim": {
|
||||
"rev": "4127c4b",
|
||||
"src": "https://github.com/3rd/time-tracker.nvim"
|
||||
},
|
||||
"todo-comments.nvim": {
|
||||
"rev": "411503d",
|
||||
"src": "https://github.com/folke/todo-comments.nvim"
|
||||
},
|
||||
"toggleterm.nvim": {
|
||||
"rev": "9a88eae",
|
||||
"src": "https://github.com/akinsho/toggleterm.nvim"
|
||||
},
|
||||
"undotree": {
|
||||
"rev": "0f1c981",
|
||||
"src": "https://github.com/mbbill/undotree"
|
||||
},
|
||||
"vim-flog": {
|
||||
"rev": "665b16a",
|
||||
"src": "https://github.com/rbong/vim-flog"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "61b51c0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"vim-surround": {
|
||||
"rev": "3d188ed",
|
||||
"src": "https://github.com/tpope/vim-surround"
|
||||
},
|
||||
"which-key.nvim": {
|
||||
"rev": "3aab214",
|
||||
"src": "https://github.com/folke/which-key.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
83
nvim/.config/nvim/snippets/all/surround.lua
Normal file
83
nvim/.config/nvim/snippets/all/surround.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
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
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="()", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("("),
|
||||
i(1),
|
||||
t(")"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
s({trig="[]", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("["),
|
||||
i(1),
|
||||
t("]"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
s({trig="{}", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("{"),
|
||||
i(1),
|
||||
t("}"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
s({trig="<>", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("<"),
|
||||
i(1),
|
||||
t(">"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
s({trig="\"\"", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("\""),
|
||||
i(1),
|
||||
t("\""),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
s({trig="''", wordTrig=false, snippetType="autosnippet"},
|
||||
{
|
||||
t("'"),
|
||||
i(1),
|
||||
t("'"),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
285
nvim/.config/nvim/snippets/tex/general.lua
Normal file
285
nvim/.config/nvim/snippets/tex/general.lua
Normal file
@@ -0,0 +1,285 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
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
|
||||
local conds = require("luasnip.extras.expand_conditions")
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="notes"},
|
||||
fmta(
|
||||
[[
|
||||
\documentclass[dvipsnames]{article}
|
||||
|
||||
\usepackage{float}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{mleftright}
|
||||
\usepackage{bm}
|
||||
\usepackage{tikz}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{pgfplots}
|
||||
\pgfplotsset{compat=newest}
|
||||
|
||||
\title{<>}
|
||||
\author{<>}
|
||||
\date{<>}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
<>
|
||||
\end{document}
|
||||
]],
|
||||
{
|
||||
i(1, "Notes"),
|
||||
i(2, "Andreas Tsouchlos"),
|
||||
i(3, os.date("%d.%m.%y")),
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="beg", wordTrig=true, snippetType="autosnippet", condition=conds.line_begin},
|
||||
fmta(
|
||||
[[
|
||||
\begin{<>}
|
||||
<>
|
||||
\end{<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="item", wordTrig=true, snippetType="autosnippet",
|
||||
condition = function(line_to_cursor, matched_trigger, captures)
|
||||
return tex_utils.in_env("itemize") and conds.line_begin(line_to_cursor, matched_trigger, captures)
|
||||
end},
|
||||
fmta(
|
||||
[[
|
||||
\item <>
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="item", wordTrig=true, snippetType="autosnippet", condition=conds.line_begin},
|
||||
fmta(
|
||||
[[
|
||||
\begin{itemize}
|
||||
\item <>
|
||||
\end{itemize}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="frame", wordTrig=true, snippetType="autosnippet", condition=conds.line_begin},
|
||||
fmta(
|
||||
[[
|
||||
\begin{frame}
|
||||
\frametitle{<>}
|
||||
\end{frame}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="sec"},
|
||||
fmta(
|
||||
[[
|
||||
\section{<>}
|
||||
\label{sec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="ssec"},
|
||||
fmta(
|
||||
[[
|
||||
\subsection{<>}
|
||||
\label{subsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="sssec"},
|
||||
fmta(
|
||||
[[
|
||||
\subsubsection{<>}
|
||||
\label{subsubsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\section{<>}
|
||||
\label{sec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="cssec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%%%%%%%%%
|
||||
\subsection{<>}
|
||||
\label{subsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csssec"},
|
||||
fmta(
|
||||
[[
|
||||
%%%%%%%%
|
||||
\subsubsection{<>}
|
||||
\label{subsubsec:<>}
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
rep(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
-- s({trig="()", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("("),
|
||||
-- i(1),
|
||||
-- t(")"),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
--
|
||||
-- s({trig="[]", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("["),
|
||||
-- i(1),
|
||||
-- t("]"),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
--
|
||||
-- s({trig="{}", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("{"),
|
||||
-- i(1),
|
||||
-- t("}"),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
--
|
||||
-- s({trig="<>", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("<"),
|
||||
-- i(1),
|
||||
-- t(">"),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
--
|
||||
-- s({trig="\"\"", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("\""),
|
||||
-- i(1),
|
||||
-- t("\""),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
--
|
||||
-- s({trig="''", wordTrig=false, snippetType="autosnippet"},
|
||||
-- {
|
||||
-- t("'"),
|
||||
-- i(1),
|
||||
-- t("'"),
|
||||
-- i(0),
|
||||
-- }
|
||||
-- ),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
439
nvim/.config/nvim/snippets/tex/greek.lua
Normal file
439
nvim/.config/nvim/snippets/tex/greek.lua
Normal file
@@ -0,0 +1,439 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="´a", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\alpha ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´b", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\beta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´g", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\gamma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´d", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\delta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´e", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\epsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´z", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\zeta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´h", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\eta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´q", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\theta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´i", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\iota ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´k", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\kappa ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´l", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\lambda ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´m", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\mu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´n", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\nu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´x", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\xi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´p", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\pi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´r", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\rho ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´s", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\sigma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´t", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\tau ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´u", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\upsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´f", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\phi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´c", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\chi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´y", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\psi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´w", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\omega ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´A", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Alpha ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´B", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Beta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´G", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Gamma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´D", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Delta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´E", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Epsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Z", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Zeta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´H", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Eta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Q", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Theta ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´I", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Iota ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´K", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Kappa ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´L", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Lambda ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´M", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Mu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´N", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Nu ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´X", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Xi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´P", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Pi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´R", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Rho ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´S", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Sigma ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´T", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Tau ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´U", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Upsilon ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´F", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Phi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´C", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Chi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´Y", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Psi ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="´W", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Omega ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
|
||||
-- Strictly speaking not greek characters, but very similar snippets
|
||||
|
||||
s({trig="´6", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\partial ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
} -- return
|
||||
|
||||
418
nvim/.config/nvim/snippets/tex/math.lua
Normal file
418
nvim/.config/nvim/snippets/tex/math.lua
Normal file
@@ -0,0 +1,418 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
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
|
||||
local conds = require("luasnip.extras.expand_conditions")
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="ali", wordTrig=true, snippetType="autosnippet", condition=conds.line_begin},
|
||||
fmta(
|
||||
[[
|
||||
\begin{align*}
|
||||
<>
|
||||
<>%
|
||||
\end{align*}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
i(1, "."),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="cases"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{cases}
|
||||
<>
|
||||
\end{cases}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="matb"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{bmatrix}
|
||||
<>
|
||||
\end{bmatrix}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="matp"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{pmatrix}
|
||||
<>
|
||||
\end{pmatrix}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])array", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[
|
||||
<>\begin{array}{c}
|
||||
<>
|
||||
\end{array}
|
||||
]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])int', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\int_{<>}^{<>} <> d<> ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "-\\infty"),
|
||||
i(2, "\\infty"),
|
||||
i(4),
|
||||
i(3, "x"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])prod', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\prod_{<>}^{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "-\\infty"),
|
||||
i(2, "\\infty"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])sum', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\sum_{<>}^{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "n=0"),
|
||||
i(2, "N-1"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])sqrt', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\sqrt{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])log', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\log_{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1, "2"),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig='([^%a])ln', regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\ln ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig = '([^%a])ff', regTrig = true, wordTrig = false, snippetType = "autosnippet"},
|
||||
fmta(
|
||||
[[<>\frac{<>}{<>} ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
i(2)
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])mcal", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\mathcal{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])mbb", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\mathbb{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])tt", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\text{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
-- s({trig=".", snippetType="autosnippet"},
|
||||
-- fmta(
|
||||
-- [[\cdot ]],
|
||||
-- {}
|
||||
-- ),
|
||||
-- {condition = tex_utils.in_mathzone}
|
||||
-- ),
|
||||
|
||||
s({trig="$$", snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[$<>$]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])bm", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\bm{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="__", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[_{<>}]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="^^", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[^{<>}]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])oo", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\infty]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="((", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\mleft( <> \mright)]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="[[", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\mleft[ <> \\mright]",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="{{", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\mleft\\{ <> \\mright\\}",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="||", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
"\\lvert <> \\rvert ",
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])hat", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\hat{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])tld", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\tilde{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])bar", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\overline{<>}]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
i(1),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([%a])([%d])", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>_<>]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
f( function(_, snip) return snip.captures[2] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="=>", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\Rightarrow ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="->", wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[\rightarrow ]],
|
||||
{}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
s({trig="([^%a])nab", regTrig=true, wordTrig=false, snippetType="autosnippet"},
|
||||
fmta(
|
||||
[[<>\nabla ]],
|
||||
{
|
||||
f( function(_, snip) return snip.captures[1] end ),
|
||||
}
|
||||
),
|
||||
{condition = tex_utils.in_mathzone}
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
132
nvim/.config/nvim/snippets/tex/plotting.lua
Normal file
132
nvim/.config/nvim/snippets/tex/plotting.lua
Normal file
@@ -0,0 +1,132 @@
|
||||
----------------
|
||||
-- Abbreviations
|
||||
----------------
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
---------------
|
||||
-- Environments
|
||||
---------------
|
||||
|
||||
|
||||
local tex_utils = {}
|
||||
|
||||
tex_utils.in_mathzone = function() -- math context detection
|
||||
return vim.fn['vimtex#syntax#in_mathzone']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_text = function()
|
||||
return not tex_utils.in_mathzone()
|
||||
end
|
||||
|
||||
tex_utils.in_comment = function() -- comment detection
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
tex_utils.in_env = function(name) -- generic environment detection
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
local get_visual = function(args, parent)
|
||||
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
|
||||
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
|
||||
else
|
||||
return sn(nil, i(1))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-----------
|
||||
-- Snippets
|
||||
-----------
|
||||
|
||||
|
||||
return {
|
||||
|
||||
|
||||
s({trig="funcplot"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
domain=<>,
|
||||
width=\textwidth,
|
||||
height=0.75\textwidth,
|
||||
]
|
||||
\addplot+[mark=none, line width=1pt]
|
||||
{<>};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1, "-5:5"),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="csvplot"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
width=\textwidth,
|
||||
height=0.75\textwidth,
|
||||
]
|
||||
\addplot+[mark=none, line width=1pt]
|
||||
table[col sep=comma, x=<>, y=<>]
|
||||
{<>};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(1, "x"),
|
||||
i(2, "y"),
|
||||
i(3),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s({trig="fig"},
|
||||
fmta(
|
||||
[[
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
|
||||
<>
|
||||
|
||||
\caption{<>}
|
||||
\label{fig:<>}
|
||||
\end{figure}
|
||||
]],
|
||||
{
|
||||
i(0),
|
||||
i(1),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
} -- return
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
#
|
||||
#
|
||||
# General options
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
set-option -g default-shell /bin/zsh
|
||||
setw -g mode-keys vi
|
||||
|
||||
@@ -13,42 +20,33 @@ set -s escape-time 0
|
||||
|
||||
set -g allow-passthrough on
|
||||
|
||||
## COLORSCHEME: gruvbox dark (medium)
|
||||
# TODO: Do we need this? What does it do?
|
||||
# vim: set ft=tmux tw=0 nowrap:
|
||||
|
||||
|
||||
#
|
||||
#
|
||||
# Theme: gruvbox dark (medium)
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
set-option -g status "on"
|
||||
|
||||
# default statusbar color
|
||||
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
|
||||
|
||||
# default window title colors
|
||||
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
|
||||
|
||||
# default window with an activity alert
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
|
||||
|
||||
# active window title colors
|
||||
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
|
||||
|
||||
# pane border
|
||||
set-option -g pane-active-border-style fg=colour250 #fg2
|
||||
set-option -g pane-border-style fg=colour237 #bg1
|
||||
|
||||
# message infos
|
||||
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
|
||||
|
||||
# writing commands inactive
|
||||
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
|
||||
|
||||
# pane number display
|
||||
set-option -g display-panes-active-colour colour250 #fg2
|
||||
set-option -g display-panes-colour colour237 #bg1
|
||||
|
||||
# clock
|
||||
set-window-option -g clock-mode-colour colour109 #blue
|
||||
|
||||
# bell
|
||||
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
|
||||
|
||||
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
|
||||
set-option -g status-justify "left"
|
||||
set-option -g status-left-style none
|
||||
set-option -g status-left-length "80"
|
||||
@@ -57,10 +55,9 @@ set-option -g status-right-length "80"
|
||||
set-window-option -g window-status-separator ""
|
||||
|
||||
set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
|
||||
set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h "
|
||||
set-option -g status-right "#[fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h "
|
||||
|
||||
set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]"
|
||||
set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]"
|
||||
|
||||
# vim: set ft=tmux tw=0 nowrap:
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ set completion-highlight-bg "rgba(131,165,152,1)" # bright:blue
|
||||
set completion-highlight-fg "rgba(80,73,69,1)" # bg2
|
||||
|
||||
# Define the color in index mode
|
||||
set index-bg "rgba(80,73,69,1)" # bg2
|
||||
set index-fg "rgba(235,219,178,1)" # fg
|
||||
set index-active-bg "rgba(131,165,152,1)" # bright:blue
|
||||
set index-active-fg "rgba(80,73,69,1)" # bg2
|
||||
# set index-bg "rgba(80,73,69,1)" # bg2
|
||||
# set index-fg "rgba(235,219,178,1)" # fg
|
||||
# set index-active-bg "rgba(131,165,152,1)" # bright:blue
|
||||
# set index-active-fg "rgba(80,73,69,1)" # bg2
|
||||
|
||||
set inputbar-bg "rgba(29,32,33,1)" # bg
|
||||
set inputbar-fg "rgba(235,219,178,1)" # fg
|
||||
|
||||
Reference in New Issue
Block a user