From 6f1a904990c258ca86a1430ccb14b89c8bcf816a Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Wed, 10 Jan 2024 14:46:47 +0100 Subject: [PATCH] vim qol --- vim/.vim/UltiSnips/make.snippets | 15 +++++++-------- vim/.vim/plugin/Make.vim | 2 +- vim/.vimrc | 1 + 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vim/.vim/UltiSnips/make.snippets b/vim/.vim/UltiSnips/make.snippets index 3474bb2..8123136 100644 --- a/vim/.vim/UltiSnips/make.snippets +++ b/vim/.vim/UltiSnips/make.snippets @@ -1,31 +1,30 @@ snippet base "tonitch's makefile base" b - .PHONY: all clean run VERSION = 0.0.1 -LIBS = +LIBS = $2 CMACRO = -DVERSION=\"$(VERSION)\" CC = gcc CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO) LDFLAGS = $(shell pkg-config $(LIBS) --libs) -all: main +all: ${1:${VISUAL:main}} -main: main.o - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) +$1: $1.o + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< - +$0 clean: rm -f *.o - rm -f main + rm -f $1 bear: clean bear -- make -run: main +run: $1 ./$< endsnippet diff --git a/vim/.vim/plugin/Make.vim b/vim/.vim/plugin/Make.vim index 8c06193..c8e324b 100644 --- a/vim/.vim/plugin/Make.vim +++ b/vim/.vim/plugin/Make.vim @@ -27,7 +27,7 @@ function s:make(args) abort let cmd .= ' ' . a:args endif - let options = {'close_cb': function('s:make_callback'), 'term_rows': 16} + let options = {'close_cb': function('s:make_callback'), 'term_rows': 8} let s:make_buf = term_start(cmd, options) let s:making = 1 diff --git a/vim/.vimrc b/vim/.vimrc index d4622d8..79a858a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -94,6 +94,7 @@ set nowrap set nu set rnu set shiftwidth=4 +set scrolloff=10 set showcmd set spelllang+=fr set splitbelow splitright