From 4749a1d22ecf0058690faf048a451bd6eb365343 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Tue, 3 Nov 2026 13:14:16 +0100 Subject: [PATCH] vim update --- vim/.vim/UltiSnips/tex.snippets | 16 ++++ vim/.vim/UltiSnips/zig.snippets | 81 ++++++++++++++++++++ vim/.vim/compiler/nob.vim | 1 + vim/.vim/ftdetect/spf.vim | 1 + vim/.vim/ftplugin/spf.vim | 1 + vim/.vim/ftplugin/tex.vim | 3 + vim/.vim/ftplugin/zig.vim | 10 +++ vim/.vim/pack/autoload/other/emmet-vim | 1 + vim/.vim/pack/autoload/start/vim-easy-align | 1 + vim/.vim/pack/autoload/start/vim-lark-syntax | 1 + vim/.vim/pack/autoload/start/vim-snippets | 2 +- vim/.vim/syntax/spf.vim | 36 +++++++++ vim/.vimrc | 1 + 13 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 vim/.vim/UltiSnips/zig.snippets create mode 100644 vim/.vim/compiler/nob.vim create mode 100644 vim/.vim/ftdetect/spf.vim create mode 100644 vim/.vim/ftplugin/spf.vim create mode 100644 vim/.vim/ftplugin/zig.vim create mode 160000 vim/.vim/pack/autoload/other/emmet-vim create mode 160000 vim/.vim/pack/autoload/start/vim-easy-align create mode 160000 vim/.vim/pack/autoload/start/vim-lark-syntax create mode 100644 vim/.vim/syntax/spf.vim diff --git a/vim/.vim/UltiSnips/tex.snippets b/vim/.vim/UltiSnips/tex.snippets index 4b9f626..de1ff86 100644 --- a/vim/.vim/UltiSnips/tex.snippets +++ b/vim/.vim/UltiSnips/tex.snippets @@ -24,6 +24,22 @@ snippet bb "mathbb" i \mathbb{${1:${VISUAL:R}}} $0 endsnippet +snippet inkscape "inkscape include" b + +% Inkscape link +\usepackage{import} +\usepackage{pdfpages} +\usepackage{transparent} +\usepackage{xcolor} +\newcommand{\incfig}[2][1]{% + \def\svgwidth{#1\columnwidth} + \import{./figures/}{#2.pdf_tex} +} + +\pdfsuppresswarningpagegroup=1 + +endsnippet + priority -9999999 snippet "(\w+)" "latex default" r \\`!p snip.rv = match.group(1)` $1 diff --git a/vim/.vim/UltiSnips/zig.snippets b/vim/.vim/UltiSnips/zig.snippets new file mode 100644 index 0000000..e9efd05 --- /dev/null +++ b/vim/.vim/UltiSnips/zig.snippets @@ -0,0 +1,81 @@ +snippet imp "import" b +const $1 = @import("${1:${VISUAL:std}}"); +endsnippet + +snippet self "self to this" b +const Self = @This(); +endsnippet + +snippet arena "Arena Allocator" b +var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); +defer arena.deinit(); + +const allocator = arena.allocator(); +endsnippet + +snippet main "main" b +pub fn main() !void { + $0 +} +endsnippet + +snippet build "build" b +const std = @import("std"); + +pub fn build(b: *std.Build) void { + + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const exe_mod = b.createModule(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + + const exe = b.addExecutable(.{ + .name = "zig", + .root_module = exe_mod, + }); + + b.installArtifact(exe); + + const run_cmd = b.addRunArtifact(exe); + + run_cmd.step.dependOn(b.getInstallStep()); + + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); + + const exe_unit_tests = b.addTest(.{ + .root_module = exe_mod, + }); + + const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); + + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&run_exe_unit_tests.step); +} +endsnippet + +snippet zon "zon" b +.{ + .name = .${1:${VISUAL:name}}, + .version = "0.0.0", + .minimum_zig_version = "0.14.0", + + .dependencies = .{ + }, + + .paths = .{ + "build.zig", + "build.zig.zon", + "src", + $0 + }, +} +endsnippet diff --git a/vim/.vim/compiler/nob.vim b/vim/.vim/compiler/nob.vim new file mode 100644 index 0000000..3655f4c --- /dev/null +++ b/vim/.vim/compiler/nob.vim @@ -0,0 +1 @@ +let &makeprg="./nob" diff --git a/vim/.vim/ftdetect/spf.vim b/vim/.vim/ftdetect/spf.vim new file mode 100644 index 0000000..393a1a3 --- /dev/null +++ b/vim/.vim/ftdetect/spf.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.spf set filetype=spf diff --git a/vim/.vim/ftplugin/spf.vim b/vim/.vim/ftplugin/spf.vim new file mode 100644 index 0000000..ba1f3f0 --- /dev/null +++ b/vim/.vim/ftplugin/spf.vim @@ -0,0 +1 @@ +set commentstring="//" diff --git a/vim/.vim/ftplugin/tex.vim b/vim/.vim/ftplugin/tex.vim index f6089ed..6c87e8e 100644 --- a/vim/.vim/ftplugin/tex.vim +++ b/vim/.vim/ftplugin/tex.vim @@ -4,3 +4,6 @@ set textwidth=100 highlight Conceal ctermfg=red noremap :silent !pdflatex % && mupdf %:r.pdf& + +inoremap : silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"':w +nnoremap : silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &':redraw! diff --git a/vim/.vim/ftplugin/zig.vim b/vim/.vim/ftplugin/zig.vim new file mode 100644 index 0000000..8cc142e --- /dev/null +++ b/vim/.vim/ftplugin/zig.vim @@ -0,0 +1,10 @@ +let g:tagbar_type_zig = { + \ 'ctagstype': 'zig', + \ 'kinds' : [ + \'f:functions', + \'s:structs', + \'e:enums', + \'u:unions', + \'E:errors' + \] + \} diff --git a/vim/.vim/pack/autoload/other/emmet-vim b/vim/.vim/pack/autoload/other/emmet-vim new file mode 160000 index 0000000..3fb2f63 --- /dev/null +++ b/vim/.vim/pack/autoload/other/emmet-vim @@ -0,0 +1 @@ +Subproject commit 3fb2f63799e1922f7647ed9ff3b32154031a76ee diff --git a/vim/.vim/pack/autoload/start/vim-easy-align b/vim/.vim/pack/autoload/start/vim-easy-align new file mode 160000 index 0000000..9815a55 --- /dev/null +++ b/vim/.vim/pack/autoload/start/vim-easy-align @@ -0,0 +1 @@ +Subproject commit 9815a55dbcd817784458df7a18acacc6f82b1241 diff --git a/vim/.vim/pack/autoload/start/vim-lark-syntax b/vim/.vim/pack/autoload/start/vim-lark-syntax new file mode 160000 index 0000000..e59976a --- /dev/null +++ b/vim/.vim/pack/autoload/start/vim-lark-syntax @@ -0,0 +1 @@ +Subproject commit e59976afd02b4c5ac36818ad0076c04c1584336a diff --git a/vim/.vim/pack/autoload/start/vim-snippets b/vim/.vim/pack/autoload/start/vim-snippets index 96d7952..f0a3184 160000 --- a/vim/.vim/pack/autoload/start/vim-snippets +++ b/vim/.vim/pack/autoload/start/vim-snippets @@ -1 +1 @@ -Subproject commit 96d79529edc3dee1ccf2ce7b75a88cb546ec2501 +Subproject commit f0a3184d9f90b96b044d5914625a25c554d7f301 diff --git a/vim/.vim/syntax/spf.vim b/vim/.vim/syntax/spf.vim new file mode 100644 index 0000000..7ec6b32 --- /dev/null +++ b/vim/.vim/syntax/spf.vim @@ -0,0 +1,36 @@ +if exists("g:current_syntax") + finish +endif + +syn region spfComment start='#' end='\n' + +syn keyword spfType booléen entier texte liste + +syn match spfNumber /\d\+/ +syn region spfString start='"' end='"' +syn keyword spfString vrai faux + +syn keyword spfIf si alors sinon +syn keyword spfWhile "tant que" faire +syn keyword spfFor "pour chaque" dans faire + +syn keyword spfOp + - * / < <= > >= + +syn keyword spfKw afficher ajouter + +let g:current_syntax="spf" + +hi def link spfComment Comment + +hi def link spfType Type + +hi def link spfNumber Number +hi def link spfString String +hi def link spfBool Boolean + +hi def link spfIf Repeat +hi def link spfIf Repeat + +hi def link spfOp Operator + +hi def link spfKw Keyword diff --git a/vim/.vimrc b/vim/.vimrc index eadaf16..5f4cd90 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -130,6 +130,7 @@ syntax on " set foldcolumn=1 set autochdir set clipboard^=unnamed,unnamedplus +set colorcolumn=-1 set concealcursor= set conceallevel=2 set encoding=utf-8