nvim config stolen from @Lukacms

This commit is contained in:
2023-11-03 11:24:41 +01:00
parent e881d7c7f5
commit 50c4761b4b
42 changed files with 1809 additions and 0 deletions

1
.emacs
View File

@@ -23,6 +23,7 @@
(show-paren-mode 1)
(electric-pair-mode 1)
(global-display-line-numbers-mode 1)
(global-font-lock-mode 0)
(setq display-line-numbers-type 'relative)
(set-face-attribute 'default nil :height 200)
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)

View File

@@ -1,6 +1,7 @@
.Xresources|symlink|
.tmux.conf|symlink|
.vimrc|symlink|
nvim|symlink|.config
dunstrc|symlink|.config/dunst
kitty.conf|symlink|.config/kitty
neofetch/config.conf|symlink|.config

10
nvim/.luarc.json Normal file
View File

@@ -0,0 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.checkThirdParty": false,
"diagnostics.disable": [
"unused-local"
],
"diagnostics.globals": [
"vim"
]
}

View File

@@ -0,0 +1 @@
vmap <Leader><Bslash> :EasyAlign*<Bar><Enter>

20
nvim/init.lua Normal file
View File

@@ -0,0 +1,20 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("options")
require("mappings")
require("settings")
require("lazy").setup("plugins")
require("lsp")
require("highlights")

49
nvim/lazy-lock.json Normal file
View File

@@ -0,0 +1,49 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
"glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
"lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" },
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "7533b0ead663d80452210c0c089e5105089697e5" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
"neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
"nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" },
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
"nvim-autopairs": { "branch": "master", "commit": "f6c71641f6f183427a651c0ce4ba3fb89404fa9e" },
"nvim-cmp": { "branch": "main", "commit": "d3a3056204e1a9dbb7c7fe36c114dc43b681768c" },
"nvim-code-action-menu": { "branch": "main", "commit": "e4399dbaf6eabff998d3d5f1cbcd8d9933710027" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" },
"nvim-treesitter": { "branch": "master", "commit": "afa103385a2b5ef060596ed822ef63276ae88016" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" },
"nvim-ufo": { "branch": "main", "commit": "ebbab711d909d5f675e38ad489765bd22bd2c6b3" },
"nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" },
"nvim-window-picker": { "branch": "main", "commit": "5902827d0e338890a22849e2f18dc80d1cc1a8db" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"prettier.nvim": { "branch": "main", "commit": "d98e732cb73690b07c00c839c924be1d1d9ac5c2" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"schemastore.nvim": { "branch": "main", "commit": "a8fa6a36f09f00d32577fae0b3cee2f25ffc5c74" },
"stabilize.nvim": { "branch": "master", "commit": "eeb1873daffaba67246188a5668b366e45ed1de1" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabline.nvim": { "branch": "main", "commit": "2eb56826bf7b85b9090aff73a696e0e803bf89ae" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" },
"vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" },
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
"vim-vsnip": { "branch": "master", "commit": "be277461265f1e5c7db470aa479f30956597ea9e" },
"vim-windowswap": { "branch": "master", "commit": "15db3f697aa1fa696d99fcdc920c90cd2cec855e" },
"vscode.nvim": { "branch": "main", "commit": "563e3f671543ba14f23ccb57020a428add640d02" }
}

29
nvim/lua/highlights.lua Normal file
View File

@@ -0,0 +1,29 @@
local highlight = require("utils").highlight
vim.o.termguicolors = true
highlight("VertSplit", { bg = "None" })
return {
colors = {
columbia_blue = "#9CDCFE",
eclipse = "#3C3C3C",
glabe_green = "#608B4E",
grey = "#808080",
light_grey = "#D4D4D4",
lilac = "#C586C0",
nero = "#262626",
picton_blue = "#569CD6",
straw = "#D7BA7D",
-- Diagnostics
equator = "#E0AF68",
mountain_meadow = "#10B981",
sunset_orange = "#F44747",
-- GitSigns
bordeaux = "#4b1818",
clover = "#4b5632",
raw_umber = "#6F490B",
},
}

10
nvim/lua/lsp/asm.lua Normal file
View File

@@ -0,0 +1,10 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").asm.setup({
capabilities = capabilities,
cmd = { "asm-lsp" },
on_attach = on_attach,
})
end
return M

12
nvim/lua/lsp/clangd.lua Normal file
View File

@@ -0,0 +1,12 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").clangd.setup({
capabilities = capabilities,
cmd = { "clangd", "--background-index", "-clang-tidy" },
on_attach = on_attach,
filetype = { "c", "cpp", "objc", "objcpp" },
})
end
return M

View File

@@ -0,0 +1,7 @@
local M = {}
M.setup = function(on_attach, capabilities)
require 'lspconfig'.csharp_ls.setup {}
end
return M

46
nvim/lua/lsp/elsint.lua Normal file
View File

@@ -0,0 +1,46 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").eslint.setup({
capabilities = capabilities,
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"vue",
},
on_attach = on_attach,
settings = {
codeAction = {
disableRuleComment = {
enable = true,
location = "separateLine",
},
showDocumentation = {
enable = true,
},
},
codeActionOnSave = {
enable = false,
mode = "all",
},
format = false,
nodePath = "",
onIgnoredFiles = "off",
packageManager = "yarn",
quiet = false,
rulesCustomizations = {},
run = "onType",
useESLintClass = false,
validate = "on",
workingDirectory = {
mode = "location",
},
},
})
end
return M

19
nvim/lua/lsp/hls.lua Normal file
View File

@@ -0,0 +1,19 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").hls.setup({
capabilities = capabilities,
cmd = { "haskell-language-server-wrapper", "--lsp" },
on_attach = on_attach,
filetypes = { "haskell", "lhaskell" },
settings = {
haskell = {
-- formattingProvider = "stylish-haskell",
--[[ formattingProvider = "",
cabalFormattingProvider = "cabalfmt", ]]
},
},
})
end
return M

110
nvim/lua/lsp/init.lua Normal file
View File

@@ -0,0 +1,110 @@
local lsp_utils = require("lsp.utils")
local u = require("utils")
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
update_in_insert = false,
virtual_text = {
prefix = "",
},
})
vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DiagnosticSignWarn", { text = "", texthl = "DiagnosticSignWarn" })
vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local lsp_formatting = function(bufnr, async, range)
vim.lsp.buf.format({
async = async,
bufnr = bufnr,
filter = function(client)
local excluded_clients = { "html", "tsserver" }
for _, excluded_client in ipairs(excluded_clients) do
if excluded_client == client.name then
return false
end
end
return true
end,
range = range,
})
end
local on_attach = function(client, bufnr)
u.buf_map(bufnr, "n", "gd", vim.lsp.buf.definition)
u.buf_map(bufnr, "n", "gi", vim.lsp.buf.implementation)
u.buf_map(bufnr, "n", "K", vim.lsp.buf.hover)
u.buf_map(bufnr, "n", "<C-l>", vim.lsp.buf.signature_help)
u.buf_map(bufnr, "n", "gt", vim.lsp.buf.type_definition)
u.buf_map(bufnr, "n", "gr", vim.lsp.buf.references)
u.buf_map(bufnr, "n", "<C-c>", ":CodeActionMenu<CR>")
u.buf_map(bufnr, "n", "<leader>d", vim.diagnostic.open_float)
u.buf_map(bufnr, "n", "<leader>r", vim.lsp.buf.rename)
u.buf_map(bufnr, "n", "<C-d>", ":Trouble document_diagnostics<CR>")
if client.supports_method("textDocument/formatting") then
u.buf_command(bufnr, "LspFormatting", function()
lsp_formatting(bufnr, false)
end)
u.buf_map(bufnr, "n", "<leader>f", function()
lsp_formatting(bufnr, true)
end)
if lsp_utils.is_path_excluded(bufnr, client) == false then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
command = "LspFormatting",
})
end
end
if client.supports_method("textDocument/rangeFormatting") then
u.buf_map(bufnr, "v", "<leader>f", function()
local start = vim.api.nvim_buf_get_mark(0, "<")
local _end = vim.api.nvim_buf_get_mark(0, ">")
local range = { start = start, ["end"] = _end }
lsp_formatting(bufnr, true, range)
end)
end
end
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local servers_names = {
"bashls",
"clangd",
"cmake",
"csharp_ls",
"cssmodules_ls",
"dockerls",
"elixirls",
"html",
"hls",
"java_language_server",
"jsonls",
"lua_ls",
"null-ls",
"pyright",
"rust-analyzer",
-- "sumneko_lua",
"texlab",
"tsserver",
"yamlls",
}
for _, server_name in ipairs(servers_names) do
local success, server = pcall(require, "lsp." .. server_name)
if success then
server.setup(on_attach, capabilities)
else
-- Load default lsp config
require("lspconfig")[server_name].setup({ on_attach, capabilities })
end
end

16
nvim/lua/lsp/jsonls.lua Normal file
View File

@@ -0,0 +1,16 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").jsonls.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
json = {
validate = { enable = true },
schemas = require("schemastore").json.schemas(),
},
},
})
end
return M

37
nvim/lua/lsp/null-ls.lua Normal file
View File

@@ -0,0 +1,37 @@
local null_ls = require("null-ls")
local b = null_ls.builtins
-- https://github.com/jose-elias-alvarez/null-ls.nvim/pull/804
local buf_path_in_workflow_folder = function()
local api = vim.api
local path = api.nvim_buf_get_name(api.nvim_get_current_buf())
return path:match("github/workflows/") ~= nil
end
local sources = {
b.diagnostics.actionlint.with({
runtime_condition = buf_path_in_workflow_folder,
}),
function()
local nl_utils = require("null-ls.utils").make_conditional_utils()
return nl_utils.root_has_file({ ".prettierrc.json", ".prettierrc" })
and b.formatting.prettierd.with({ filetypes = { "html", "javascript", "typescript", "svelte" } })
or b.formatting.eslint_d
end,
b.formatting.black,
b.formatting.stylua,
}
local M = {}
M.setup = function(on_attach)
null_ls.setup({
debug = false,
sources = sources,
on_attach = on_attach,
})
end
return M

View File

@@ -0,0 +1,27 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("rust-tools").setup({
server = {
capabilities = capabilities,
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy",
},
cargo = {
autoreload = true,
},
diagnostics = {
enable = true,
disabled = { "unresolved-proc-macro" },
enableExperimental = true,
},
},
},
},
})
end
return M

View File

@@ -0,0 +1,32 @@
local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").sumneko_lua.setup({
capabilities = capabilities,
disable_formatting = true,
on_attach = on_attach,
settings = {
Lua = {
runtime = {
version = "LuaJIT",
path = runtime_path,
},
diagnostics = {
globals = { "vim", "use" },
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
})
end
return M

28
nvim/lua/lsp/texlab.lua Normal file
View File

@@ -0,0 +1,28 @@
local M = {}
M.setup = function(on_attach, capabilities)
require("lspconfig").texlab.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
texlab = {
build = {
executable = "tectonic",
args = {
"%f",
"--synctex",
"--keep-logs",
"--keep-intermediates",
},
},
formatterLineLength = 80,
latexFormatter = "latexindent",
latexindent = {
modifyLineBreaks = true,
},
},
},
})
end
return M

18
nvim/lua/lsp/tsserver.lua Normal file
View File

@@ -0,0 +1,18 @@
local u = require("utils")
local M = {}
M.setup = function(on_attach, capabilities)
require("typescript").setup({
server = {
capabilities = capabilities,
on_attach = function(client, bufnr)
on_attach(client, bufnr)
u.buf_map(bufnr, "n", "<leader>h", ":TypescriptOrganizeImports<CR>")
end,
},
})
end
return M

24
nvim/lua/lsp/utils.lua Normal file
View File

@@ -0,0 +1,24 @@
local M = {}
M.is_path_excluded = function(bufnr, client)
local buf_path = vim.api.nvim_buf_get_name(bufnr)
local excluded_paths = {}
local success, custom = pcall(require, "custom")
if success then
excluded_paths = custom.excluded_paths[client.name]
end
local is_excluded = false
if excluded_paths ~= nil then
for i = 1, #excluded_paths do
if buf_path:find("^" .. excluded_paths[i]) ~= nil then
is_excluded = true
break
end
end
end
return is_excluded
end
return M

36
nvim/lua/mappings.lua Normal file
View File

@@ -0,0 +1,36 @@
-- {{@@ header() @@}}
local map = require("utils").map
-- set leader key
vim.g.mapleader = ","
-- Remap ; to :
map("n", ";", ":")
-- jk to return to normal mode
map({ "i", "v" }, "jk", "<Esc>")
-- tab navigation
map("n", "H", ":tabprevious<CR>")
map("n", "L", ":tabnext<CR>")
map("n", "T", ":tabnew<CR>")
map("n", "C", ":tabclose<CR>")
-- Map Alt+Arrows to move lines
map("n", "<C-k>", ":m-2 <CR>==")
map("n", "<C-j>", ":m+ <CR>==")
map("v", "<C-k>", ":m '<-2<CR>gv=gv")
map("v", "<C-j>", ":m '>+1<CR>gv=gv")
-- Resize buffer size
map("n", "<Up>", "<C-w>2-")
map("n", "<Down>", "<C-w>2+")
map("n", "<Left>", "<C-w>2<")
map("n", "<Right>", "<C-w>2>")
-- Fold
map("n", "<Space>", "za")
--[[ map('n', 'n', ':cnext<CR>')
map('n', 'N', ':cprev<CR>') ]]

58
nvim/lua/options.lua Normal file
View File

@@ -0,0 +1,58 @@
-- {{@@ header() @@}}
local opt = vim.opt
vim.o.autochdir = false
opt.wildignorecase = true -- Make filenames autocompletion case-insensitive
opt.ignorecase = true -- Make search case insensitive if all lowercase
opt.smartcase = true -- No ignore case when pattern has uppercase
opt.syntax = "enable" -- Enables syntax highlighing
opt.wrap = false -- Display long lines as just one line
opt.foldlevel = 99
opt.foldlevelstart = 99 -- Minimum number of screen line below and above the cursor
opt.foldenable = true
opt.colorcolumn = "79"
opt.termguicolors = true -- Set colorscheme
opt.scrolloff = 99 -- Minimum number of line above and below the cursor line
opt.timeoutlen = 200 -- Shorten key sequence timeout
opt.clipboard = "unnamedplus" -- Copy paste between vim and everything else
-- Splits
opt.splitbelow = true
opt.splitright = true
opt.tabstop = 2 -- Number of spaces that <Tab> in files uses
opt.shiftwidth = 2 -- Number of spaces to use fir (auto)indent step
opt.expandtab = true -- Use spaces when <Tab> is inserted
opt.autoindent = true -- Take indent for new line from previous line
opt.wrap = true
opt.fixeol = false
opt.number = true -- Print the line number in front of each line
opt.cursorline = true -- Highligh the screen line of the cursor
opt.signcolumn = "yes" -- Always display signcolumn
opt.wildignore = opt.wildignore + "*.o,*.gcno,*.gcda" -- Files matching these patterns are not completed
-- set relative number
opt.relativenumber = true
vim.o.shell = "/usr/bin/env bash"
vim.o.cmdheight = 1
vim.o.laststatus = 0
-- vim.o.mouse = vim.o.mouse .. "a"
vim.o.mouse = ""
-- vim.o.equalalways = false -- splitted windows are not always the same size

202
nvim/lua/plugins/coding.lua Normal file
View File

@@ -0,0 +1,202 @@
return {
-- {%@@ if profile != "lukac" @@%}
{ "b0o/schemastore.nvim" },
{
"neovim/nvim-lspconfig",
event = "BufReadPre",
dependencies = {
{ "weilbith/nvim-code-action-menu", cmd = "CodeActionMenu" },
"jose-elias-alvarez/null-ls.nvim",
"jose-elias-alvarez/typescript.nvim",
"simrat39/rust-tools.nvim",
"hrsh7th/cmp-nvim-lsp",
},
},
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "BufReadPre",
opts = {}
},
--[[ {
"L3MON4D3/LuaSnip",
version = "<CurrentMajor>.*",
config = function()
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "~/.config/nvim/snippets/" } })
end,
keys = {
{
"<C-l>",
function()
require("luasnip").jump(1)
end,
mode = "i",
},
{
"<C-h>",
function()
require("luasnip").jump(-1)
end,
mode = "i",
},
},
}, ]]
{
"hrsh7th/vim-vsnip",
config = function()
vim.g.vsnip_snippet_dir = "~/.config/nvim/snippets"
local map = require("utils").map
local options = { expr = true, noremap = true }
map("i", "<C-l>", 'vsnip#jumpable(1) ? "<Plug>(vsnip-jump-next)" : "<C-l>"', options)
map("s", "<C-l>", 'vsnip#jumpable(1) ? "<Plug>(vsnip-jump-next)" : "<C-l>"', options)
map("s", "<C-k>", 'vsnip#jumpable(-1) ? "<Plug>(vsnip-jump-prev)" : "<C-h>"', options)
map("i", "<C-k>", 'vsnip#jumpable(-1) ? "<Plug>(vsnip-jump-prev)" : "<C-h>"', options)
end,
},
-- Autocompletion
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-path",
"hrsh7th/cmp-vsnip",
-- "L3MON4D3/LuaSnip",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp",
"onsails/lspkind-nvim",
},
init = function(_)
local highlight = require("utils").highlight
local colors = require("highlights").colors
local cmp = require("cmp")
local lspkind = require("lspkind")
highlight("CmpItemAbbrDeprecated", { style = "strikethrough", fg = colors.grey })
highlight("CmpItemAbbrMatch", { bg = "NONE", fg = colors.picton_blue })
highlight("CmpItemAbbrMatchFuzzy", { bg = "NONE", fg = colors.picton_blue })
highlight("CmpItemKindVariable", { bg = "NONE", fg = colors.columbia_blue })
highlight("CmpItemKindInterface", { bg = "NONE", fg = colors.columbia_blue })
highlight("CmpItemKindText", { bg = "NONE", fg = colors.columbia_blue })
highlight("CmpItemKindFunction", { bg = "NONE", fg = colors.lilac })
highlight("CmpItemKindMethod", { bg = "NONE", fg = colors.lilac })
highlight("CmpItemKindKeyword", { bg = "NONE", fg = colors.light_grey })
highlight("CmpItemKindProperty", { bg = "NONE", fg = colors.light_grey })
highlight("CmpItemKindUnit", { bg = "NONE", fg = colors.light_grey })
vim.opt.completeopt = { "menuone", "noselect" }
-- Remove cmp status display
vim.opt.shortmess:append("c")
end,
opts = function()
local cmp = require("cmp")
local lspkind = require("lspkind")
-- local luasnip = require("luasnip")
return {
snippet = {
expand = function(args)
-- luasnip.lsp_expand(args.body)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = {
["<C-Space>"] = cmp.mapping.complete({
config = {
sources = {
{ name = "nvim_lsp" },
-- { name = "LuaSnip" },
{ name = "vsnip" },
{ name = "path" },
{ name = "buffer" },
},
},
}),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
},
sources = {
{ name = "nvim_lsp" },
-- { name = "LuaSnip" },
{ name = "vsnip" },
{ name = "path" },
{ name = "buffer" },
},
formatting = {
format = lspkind.cmp_format({
mode = "symbol",
maxwidth = "50",
symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "[]",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
}),
},
}
end,
},
-- Symbol tree
{ "simrat39/symbols-outline.nvim", keys = { { "<Leader>s", "<cmd>SymbolsOutlineOpen<CR>" } }, opts = {} },
{ "JoosepAlviste/nvim-ts-context-commentstring", lazy = true },
{
"numToStr/Comment.nvim",
opts = {
ignore = "^$",
toggler = {
line = "<Space>/",
},
},
},
{
"MunifTanjim/prettier.nvim",
opts = {
single_quote = true,
print_width = 100,
jsx_single_quote = true,
bracket_same_line = true,
}
}
}

View File

@@ -0,0 +1,45 @@
return {
{
"Mofiqul/vscode.nvim",
priority = 1000,
opts = {
transparent = true,
italic_comments = true,
color_overrides = {
vscLineNumber = "#D7BA7D",
vscFoldBackground = "#202d39",
-- Syntax colors
vscGray = "#808080",
vscViolet = "#646695",
vscBlue = "#569CD6",
vscAccentBlue = "#4FC1FE",
vscDarkBlue = "#223E55",
vscMediumBlue = "#18a2fe",
vscLightBlue = "#9CDCFE",
vscGreen = "#808080",
vscBlueGreen = "#4EC9B0",
vscLightGreen = "#B5CEA8",
vscRed = "#F44747",
vscOrange = "#CE9178",
vscLightRed = "#D16969",
vscYellowOrange = "#D7BA7D",
vscYellow = "#DCDCAA",
vscDarkYellow = "#FFA602",
vscPink = "#C586C0",
},
group_overrides = {
-- this supports the same val table as vim.api.nvim_set_hl
-- use colors from this colorscheme by requiring vscode.colors!
Cursor = {
fg = "#646695",
bg = "#B5CEA8",
bold = false,
},
},
},
config = function(plugin, opts)
require("vscode").setup(opts)
require("vscode").load()
end,
},
}

View File

@@ -0,0 +1,9 @@
return {
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
config = true,
-- Uncomment next line if you want to follow only stable versions
-- version = "*"
}
}

284
nvim/lua/plugins/editor.lua Normal file
View File

@@ -0,0 +1,284 @@
local utils = require("utils")
return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
cmd = "Neotree",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-tree/nvim-web-devicons" },
{ "MunifTanjim/nui.nvim" },
{
"s1n7ax/nvim-window-picker",
tag = "v1.5",
opts = function()
local colors = require("highlights").colors
return {
autoselect_one = true,
include_current = true,
filter_rules = {
bo = {
filetype = { "neo-tree", "neo-tree-popup", "notify", "Trouble" },
buftype = { "terminal", "quickfix" },
},
},
fg_color = colors.picton_blue,
other_win_hl_color = colors.bordeaux,
}
end,
},
},
keys = {
{ "<C-b>", "<cmd>Neotree toggle<CR>" },
},
opts = {
close_if_last_window = false,
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
window = {
mappings = {
["o"] = "open_with_window_picker",
},
},
default_component_configs = {
indent = {
with_markers = false,
},
name = {
use_git_status_colors = false,
},
git_status = {
symbols = {
deleted = "",
untracked = "*",
},
},
},
filesystem = {
hide_gitignored = true,
follow_current_file = true,
use_libuv_file_watcher = true,
always_show = {
".clang_format",
".clang-tidy",
},
},
},
},
-- {%@@ if profile != "lukac" @@%}
{
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/popup.nvim" },
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
},
keys = {
{ "<C-p>", "<cmd>Telescope find_files<CR>" },
{ "§", "<cmd>Telescope live_grep<CR>" },
{ "<C-s>", "<cmd>Telescope lsp_document_symbols<CR>" },
{ "<C-f>", "<cmd>Telescope current_buffer_fuzzy_find<CR>" },
},
init = function()
local telescope = require("telescope")
telescope.load_extension("fzf")
end,
opts = function()
local actions = require("telescope.actions")
return {
defaults = {
prompt_prefix = "",
selection_caret = " ",
entry_prefix = " ",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
preview_width = 0.55,
results_width = 0.8,
},
vertical = {
mirror = false,
},
width = 0.80,
height = 0.85,
preview_cutoff = 120,
},
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous,
["<C-j>"] = actions.move_selection_next,
["<esc>"] = actions.close,
},
},
},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
},
},
file_ignore_patterns = {
"nodes_modules/.*",
".git/.*",
"target/.*",
".yarn",
},
}
end,
},
{ "tpope/vim-fugitive" },
{
"lewis6991/gitsigns.nvim",
event = "BufReadPre",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function(_, opts)
local highlight = require("utils").highlight
local colors = require("highlights").colors
highlight("GitSignsAddNr", { bg = colors.clover, fg = "NONE" })
highlight("GitSignsChangeNr", { bg = colors.raw_umber, fg = "NONE" })
highlight("GitSignsDeleteNr", { bg = colors.bordeaux, fg = "NONE" })
require("gitsigns").setup(opts)
end,
opts = {
signs = {
add = { numhl = "GitSignsAddNr" },
change = { numhl = "GitSignsChangeNr" },
delete = { numhl = "GitSignsDeleteNr" },
topdelete = { numhl = "GitSignsDeleteNr" },
changedelete = { numhl = "GitSignsChangeNr" },
},
signcolumn = false,
numhl = true,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = true,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local buf_map = require("utils").buf_map
buf_map(bufnr, "n", "<leader>g", function()
gs.blame_line({ full = true })
end)
end,
},
},
{
"iamcco/markdown-preview.nvim",
config = function()
vim.fn["mkdp#util#install"]()
end,
},
-- { "iamcco/markdown-preview.nvim" },
{ "ellisonleao/glow.nvim", config = true, cmd = "Glow" },
{
"folke/todo-comments.nvim",
dependencies = "nvim-lua/plenary.nvim",
opts = {
signs = true,
sign_priority = 8,
keywords = {
FIX = {
icon = "",
color = "error",
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
},
merge_keywords = true,
highlight = {
before = "",
keyword = "wide",
after = "fg",
pattern = [[.*<(KEYWORDS)\s*]],
comments_only = true,
max_line_len = 400,
},
colors = {
error = { "LspDiagnosticsDefaultError", "ErrorMsg", "#DC2626" },
warning = { "LspDiagnosticsDefaultWarning", "WarningMsg", "#FBBF24" },
info = { "LspDiagnosticsDefaultInformation", "#2563EB" },
hint = { "LspDiagnosticsDefaultHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
pattern = [[\b(KEYWORDS)]], -- ripgrep regex
},
},
},
{
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
opts = {
use_diagnostic_signs = true,
},
},
{
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
init = function()
local bufnr = vim.api.nvim_get_current_buf()
require("ufo").setFoldVirtTextHandler(bufnr, utils.fold_handler)
end,
opts = {
open_fold_hl_timeout = 100,
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
fold_virt_text_handler = utils.fold_handler,
},
},
{ "junegunn/vim-easy-align" },
{ "wesQ3/vim-windowswap" },
-- {%@@ endif @@%}
{
"ntpeters/vim-better-whitespace",
event = "BufReadPre",
keys = {
{ "<leader><Space>", "<cmd>StripWhitespace<CR>" },
},
},
}

View File

@@ -0,0 +1 @@
return {}

35
nvim/lua/plugins/misc.lua Normal file
View File

@@ -0,0 +1,35 @@
--[[ local utils = require("utils")
return {
{
"andweeb/presence.nvim",
config = function(plugin, opts)
-- The setup config table shows all available config options with their default values:
require("presence").setup({
-- General options
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
-- Rich Presence text options
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
})
end,
},
} ]]
return {}

View File

@@ -0,0 +1,64 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "BufReadPost",
opts = {
ensure_installed = {
"bash",
"bibtex",
"c",
"cmake",
"cpp",
"css",
"dockerfile",
"elixir",
"fish",
"html",
"haskell",
"javascript",
"json",
"json5",
"latex",
"lua",
"make",
"markdown",
"mermaid",
"python",
"rust",
"typescript",
"yaml",
},
sync_install = true,
context_commentstring = {
enable = true,
},
highlight = {
enable = false,
},
playground = {
enable = true,
disable = {},
updatetime = 25,
persist_queries = false,
keybindings = {
toggle_query_editor = "o",
toggle_hl_groups = "i",
toggle_injected_languages = "t",
toggle_anonymous_nodes = "a",
toggle_language_display = "I",
focus_language = "f",
unfocus_language = "F",
update = "R",
goto_node = "<cr>",
show_help = "?",
},
},
},
config = function(plugin, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
{ "nvim-treesitter/playground" },
}

84
nvim/lua/plugins/ui.lua Normal file
View File

@@ -0,0 +1,84 @@
return {
{
"hoob3rt/lualine.nvim",
opts = function()
local colors = require("highlights").colors
local mode_highlight = function(highlight)
return {
a = { bg = highlight, fg = colors.eclipse, gui = "bold" },
b = { bg = colors.eclipse, fg = highlight },
c = { bg = colors.nero, fg = colors.light_grey },
}
end
local theme = {
normal = mode_highlight(colors.picton_blue),
insert = mode_highlight(colors.straw),
visual = mode_highlight(colors.glabe_green),
}
local diagnostics = {
"diagnostics",
sources = { "nvim_diagnostic" },
color_error = colors.sunset_orange,
color_warn = colors.equator,
color_info = colors.mountain_meadow,
color_hint = colors.light_grey,
symbols = { error = "", warn = "", info = "", hint = "" },
}
local winbar_filename = {
"filename",
path = 1,
shorting_target = 20,
}
require("lualine").setup({
tabline = {
lualine_x = { require("tabline").tabline_tabs },
},
winbar = { lualine_c = { winbar_filename } },
inactive_winbar = { lualine_c = { winbar_filename } },
status_line = {
lualine_a = { "mode" },
lualine_b = { "branch", diagnostics },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat" },
lualine_y = { "filetype" },
lualine_z = { "location", "progress" },
},
options = {
theme = theme,
disabled_filetypes = { "packer", "neo-tree" },
ignore_focus = { "neo-tree" },
globalstatus = true,
},
extensions = {},
})
end,
dependencies = { { "nvim-tree/nvim-web-devicons" } },
},
{
"keklleo/tabline.nvim",
opts = { enable = false },
dependencies = {
{ "hoob3rt/lualine.nvim" },
{ "nvim-tree/nvim-web-devicons" },
},
},
{ "nvim-tree/nvim-web-devicons", lazy = true },
{ "norcalli/nvim-colorizer.lua", opts = { "*" } },
{ "luukvbaal/stabilize.nvim" },
{
"windwp/nvim-autopairs",
config = function(plugin, opts)
require("nvim-autopairs").setup()
end,
},
}

17
nvim/lua/settings.lua Normal file
View File

@@ -0,0 +1,17 @@
-- auto source and compile when saving changes to nvim config
vim.cmd("augroup nvimconfig")
vim.cmd(" autocmd!")
vim.cmd(" autocmd BufWritePost ~/.config/nvim/** :so $MYVIMRC")
vim.cmd("augroup END")
vim.api.nvim_create_augroup("neotree_autoopen", { clear = true })
vim.api.nvim_create_autocmd("BufWinEnter", {
desc = "Open neo-tree on enter",
group = "neotree_autoopen",
callback = function()
if not vim.g.neotree_opened then
vim.cmd("Neotree show")
vim.g.neotree_opened = true
end
end,
})

85
nvim/lua/utils.lua Normal file
View File

@@ -0,0 +1,85 @@
local default_options = {
noremap = true,
silent = true,
}
return {
map = function(mode, keys, action, opts)
local options = default_options
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.keymap.set(mode, keys, action, options)
end,
buf_map = function(buffer, mode, keys, action, opts)
local options = default_options
options.buffer = buffer
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.keymap.set(mode, keys, action, options)
end,
buf_command = function(bufnr, name, fn, opts)
vim.api.nvim_buf_create_user_command(bufnr, name, fn, opts or {})
end,
highlight = function(group, color)
local command = "hi " .. group .. " "
if color.style then
command = command .. " gui=" .. color.style
end
if color.fg then
command = command .. " guifg=" .. color.fg
end
if color.bg then
command = command .. " guibg=" .. color.bg
end
if color.sp then
command = command .. " guisp=" .. color.sp
end
vim.cmd(command)
end,
fold_handler = function(virt_text, fold_start_line, fold_end_line, width, truncate)
local new_virt_text = {}
local suffix = ("  %d "):format(fold_end_line - fold_start_line)
local suf_width = vim.fn.strdisplaywidth(suffix)
local target_width = width - suf_width
local cur_width = 0
local fold_hl_group = nil
for _, chunk in ipairs(virt_text) do
local chunk_text = chunk[1]
local chunk_width = vim.fn.strdisplaywidth(chunk_text)
fold_hl_group = chunk[2] -- Not 100% guarantee to have the good hl group if
-- there is something after the fold character but most likely to.
if target_width > cur_width + chunk_width then
table.insert(new_virt_text, chunk)
else
chunk_text = truncate(chunk_text, target_width - cur_width)
local hl_group = chunk[2]
table.insert(new_virt_text, { chunk_text, hl_group })
chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- str width returned from truncate() may less than 2nd argument, need padding
if cur_width + chunk_width < target_width then
suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
end
break
end
cur_width = cur_width + chunk_width
end
table.insert(new_virt_text, { suffix, "MoreMsg" })
table.insert(new_virt_text, { vim.fn.trim(vim.fn.getline(fold_end_line)), fold_hl_group })
return new_virt_text
end,
}

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
CONFIG_FILE=$(find ~/.config/nvim/scripts/vimspector -type f | fzf)
if [[ -n $CONFIG_FILE ]]; then
cp $CONFIG_FILE .
else
echo "No configuration has been copied."
fi

View File

@@ -0,0 +1,21 @@
{
"configurations": {
"Launch": {
"adapter": "vscode-cpptools",
"configuration": {
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/binary_name",
"args": ["binary_name"],
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"stopAtEntry": true,
"MIMode": "gdb",
"logging": {
"engineLogging": false
}
}
}
}
}

96
nvim/snippets/c.json Normal file
View File

@@ -0,0 +1,96 @@
{
"header": {
"prefix": "header_c",
"body": [
"/*",
"** EPITECH PROJECT, 2023",
"** $TM_DIRECTORY",
"** File description:",
"** $TM_FILENAME_BASE",
"*/",
"",
"$0"
],
"description": "Code snippet for header"
},
"header_hpp": {
"prefix": "header_h",
"body": [
"/*",
"** EPITECH PROJECT, 2023",
"** $TM_DIRECTORY",
"** File description:",
"** $TM_FILENAME_BASE",
"*/",
"",
"#ifndef $3",
"#define $3",
"$0",
"#endif /* !$3 */",
""
],
"description": "Code snippet for header"
},
"main_": {
"prefix": "main_",
"body": [
"int main(int argc, char *const argv[]) {",
" return 0;",
"}"
]
},
"main": {
"prefix": "main",
"body": [
"int main(void) {",
" return 0;",
"}"
]
},
"while": {
"prefix": "while",
"body": [
"while ($1) {",
" $0",
"}"
],
"description": ""
},
"if": {
"prefix": "if",
"body": [
"if ($1) {",
" $0",
"}"
],
"description": "Code snippet for if statement"
},
"else": {
"prefix": "else",
"body": [
"else {",
" $0",
"}"
],
"description": "Code snippet for else statement"
},
"else if": {
"prefix": "else if",
"body": [
"else if ($1) {",
" $0",
"}"
],
"description": "Code snippet for else-if statement"
},
"Test()": {
"prefix": "Test",
"body": [
"Test(${1:function name}, ${2:test description})",
"{",
"$0",
"}"
],
"description": "Test criterion"
}
}

12
nvim/snippets/cmake.json Normal file
View File

@@ -0,0 +1,12 @@
{
"header": {
"prefix": "header",
"body": [
"##",
"## CMakeLists: $WORKSPACE_FOLDER / $TM_DIRECTORY",
"##",
"",
"$0"
]
}
}

147
nvim/snippets/cpp.json Normal file
View File

@@ -0,0 +1,147 @@
{
"header": {
"prefix": "header_cpp",
"body": [
"/*",
"** EPITECH PROJECT, 2023",
"** $TM_DIRECTORY",
"** File description:",
"** $TM_FILENAME_BASE",
"*/",
"",
"$0"
],
"description": "Code snippet for header"
},
"header_hpp": {
"prefix": "header_hpp",
"body": [
"/*",
"** EPITECH PROJECT, 2023",
"** $TM_DIRECTORY",
"** File description:",
"** $TM_FILENAME_BASE",
"*/",
"",
"#ifndef $3",
"#define $3",
"$0",
"#endif /* !$3 */",
""
],
"description": "Code snippet for header"
},
"header_hpp_": {
"prefix": "header_hpp_",
"body": [
"/*",
"** EPITECH PROJECT, 2023",
"** $TM_DIRECTORY",
"** File description:",
"** $TM_FILENAME_BASE",
"*/",
"",
"#pragma once",
"$0",
""
],
"description": "Code snippet for header"
},
"class": {
"prefix": "class",
"body": [
"class ${1:ClassName} {",
" public:",
" $1() = default;",
" $1($1 const& to_copy) = default;",
" $1($1&& to_move) = default;",
" ~$1() = default;",
" $1& operator=($1 const& to_copy) = default;",
" $1& operator=($1 && to_move) = default;",
"",
" private:",
"};",
""
],
"description": "Code snippet for class"
},
"ifndef": {
"prefix": "ifndef",
"body": [
"#ifndef $1",
"#define $1",
"",
"$0",
"",
"#endif /* !$1 */",
""
],
"description": "Code snippet for header"
},
"main_": {
"prefix": "main_",
"body": [
"int main(int argc, const char* argv[]) {",
" return 0;",
"}"
]
},
"main": {
"prefix": "main",
"body": [
"int main() {",
" return 0;",
"}"
]
},
"while": {
"prefix": "while",
"body": [
"while ($1)",
"{",
" $0",
"}"
],
"description": ""
},
"if": {
"prefix": "if",
"body": [
"if ($1)",
"{",
" $0",
"}"
],
"description": "Code snippet for if statement"
},
"else": {
"prefix": "else",
"body": [
"else",
"{",
" $0",
"}"
],
"description": "Code snippet for else statement"
},
"else if": {
"prefix": "else if",
"body": [
"else if ($1)",
"{",
" $0",
"}"
],
"description": "Code snippet for else-if statement"
},
"Test()": {
"prefix": "Test",
"body": [
"Test(${1:function name}, ${2:test description})",
"{",
"$0",
"}"
],
"description": "Test criterion"
}
}

View File

@@ -0,0 +1,16 @@
{
"header": {
"prefix": "header_haskell",
"body": [
"{-",
"-- EPITECH PROJECT, 2023",
"-- $TM_DIRECTORY",
"-- File description:",
"-- $TM_FILENAME_BASE",
"-}",
"",
"$0"
],
"description": "Code snippet for haskell header"
}
}

45
nvim/snippets/make.json Normal file
View File

@@ -0,0 +1,45 @@
{
"header": {
"prefix": "header_make",
"body": [
"##",
"## EPITECH PROJECT, 2023",
"## $RELATIVE_FILEPATH",
"## File description:",
"## $TM_FILENAME_BASE",
"##",
"",
"$0"
]
},
"src_c": {
"prefix": "SRC_C",
"body": [
"SRC\t=\t$1",
"",
"OBJ\t=\t(SRC:.c=.o)",
"",
"$0"
]
},
"src_cpp": {
"prefix": "SRC_CPP",
"body": [
"SRC\t=\t$1",
"",
"OBJ\t=\t(SRC:.cpp=.o)",
"",
"$0"
]
},
"src_asm": {
"prefix": "SRC_ASM",
"body": [
"SRC\t=\t$1",
"",
"OBJ\t=\t(SRC:.asm=.o)",
"",
"$0"
]
}
}

View File

@@ -0,0 +1 @@
{}

37
nvim/snippets/python.json Normal file
View File

@@ -0,0 +1,37 @@
{
"header": {
"prefix": "header_py",
"body": [
"##",
"## EPITECH PROJECT, 2023",
"## $TM_DIRECTORY",
"## File description:",
"## $TM_FILENAME_BASE",
"##",
"",
"$0"
],
"description": "code snippet for python header"
},
"rich print": {
"prefix": "frich",
"body": [
"from rich import print as rprint"
],
"description": ""
},
"pandas import": {
"prefix": "ipd",
"body": [
"import pandas as pd"
],
"description": ""
},
"numpy import": {
"prefix": "inp",
"body": [
"import numpy as np"
],
"description": ""
}
}

8
nvim/snippets/rust.json Normal file
View File

@@ -0,0 +1,8 @@
{
"header": {
"prefix": "header",
"body": [
""
]
}
}