Lot of small changes

This commit is contained in:
2024-01-03 11:04:20 +01:00
parent 71b5d1313a
commit 00c6530485
9 changed files with 166 additions and 83 deletions

View File

@ -0,0 +1,31 @@
snippet base "tonitch's makefile base" b
.PHONY: all clean run
VERSION = 0.0.1
LIBS =
CMACRO = -DVERSION=\"$(VERSION)\"
CC = gcc
CFLAGS = -g -Wall -Wextra -pedantic $(shell pkg-config $(LIBS) --cflags) $(CMACRO)
LDFLAGS = $(shell pkg-config $(LIBS) --libs)
all: main
main: main.o
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o
rm -f main
bear: clean
bear -- make
run: main
./$<
endsnippet

View File

@ -62,3 +62,38 @@ priority -1
snippet "(\w+)" "latex default" r
\\`!p snip.rv = match.group(1)` $1
endsnippet
snippet task "Create a task list item"
- [ ] ${1:${VISUAL:item}}
endsnippet
snippet rest "add a restAPI endpoint" b
#### ${1:${VISUAL:Title}}
<details>
<summary><code>${2:${VISUAL:GET}}</code> <code><b>/${3:${VISUAL:Endpoint}}</b></code> <code>${4:${VISUAL:Description}}</code></summary>
##### Parameters
> | name | type | data type | description |
> |-----------|-----------|-------------------------|-----------------------------------------------------------------------|
> | None | required | object (JSON or YAML) | N/A |
##### Responses
> | http code | content-type | response |
> |---------------|-----------------------------------|---------------------------------------------------------------------|
> | \`200\` | \`text/plain;charset=UTF-8\` | \`Configuration created successfully\` |
> | \`400\` | \`application/json\` | \`{"code":"400","message":"Bad Request"}\` |
##### Example cURL
> \`\`\`javascript
> curl -X $2 -H "Content-Type: application/json" http://localhost:8889/$3
> \`\`\`
</details>
---------------------------------------------------------------------------------------
endsnippet

View File

@ -0,0 +1,18 @@
snippet base "Base" b
openapi: 3.0.0
info:
title: ${1:${VISUAL:Title}}
description: ${2:${VISUAL:Title}}
version: 0.0.1
servers:
- url: ${3:${VISUAL:https://example.com/api}}
description: ${4:${VISUAL:default api point for the service}}
$0
endsnippet
snippet desc "Description" b
description: ${1:${VISUAL:Description}}
endsnippet

View File

@ -1,8 +1,3 @@
autocmd Filetype python noremap <F11> <ESC>:vert term python -i %<CR>
autocmd Filetype python noremap <F12> <ESC>:vert term python %<CR>
autocmd Filetype tex noremap <silent> <F12> <ESC>:silent !pdflatex % && mupdf %:r.pdf&<CR>
autocmd FileType asm noremap <F12> <ESC>:execute 'silent !qtspim' expand('%::p')<CR>
nnoremap <C-p> :GFiles<CR>
@ -18,6 +13,8 @@ let g:pymode_python = 'python3'
let g:pymode_options_max_line_length = 120
" let g:ctrlp_cmd = 'CtrlPTag'
let g:htmljinja_disable_detection = 1
let g:vimtex_view_method = 'zathura'
let g:vimtex_grammar_vlty = {'lt_command': 'languagetool'}
let g:vimtex_grammar_textidote = {'jar': '/usr/share/java/textidote.jar'}
@ -26,10 +23,6 @@ let g:vimtex_view_method = 'zathura'
" nnoremap <c-p> <plug>(YCMFindSymbolInDirectory)
" nnoremap <c-P> <plug>(YCMFindSymbolInWorkspace)
function ManPage(expr)
execute 'silent vert term' &keywordprg a:expr
endfunction
nnoremap gd :YcmCompleter GoToDefinition<CR>
nnoremap gr :YcmCompleter GoToReferences<CR>
nnoremap K :YcmCompleter GetDoc<CR>
@ -40,11 +33,9 @@ nnoremap <F12> :Make<CR>
nnoremap <leader><F12> :Make run<CR>
"Documentation
"nnoremap K :execute 'Man' expand('<cexpr>')<cr>
nnoremap K :execute 'vert term' &keywordprg '<cexpr>'<cr>
command Curl :execute 'vert term lynx -dump' escape(@+, '#')
command OpenLink :silent w !urlscan
command -nargs=? Man call fzf#run(fzf#wrap({'source': 'whatis ' . shellescape(<q-args>) . '| sed -r "s/(^\w*)\s\((.*)\).*/\2 \1/"', 'sink': function('ManPage') , 'options': ['--preview', 'MANPAGER=cat MANWIDTH='. (&columns/2-4) .' man {1} {2}']}))
" AgIn: Start ag in the specified directory
"
@ -85,27 +76,28 @@ let g:ycm_language_server = [
nnoremap <space> za
syntax on
set nu
set rnu
set hls
set tabstop=4
set shiftwidth=4
set encoding=utf-8
set nocompatible
set ignorecase
set nowrap
set splitbelow splitright
set spelllang+=fr
set foldmethod=syntax
set foldlevel=99
set incsearch
set autochdir
" set foldcolumn=1
set clipboard^=unnamed,unnamedplus
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space
set concealcursor=
set conceallevel=2
set encoding=utf-8
" set foldcolumn=1
set foldlevel=99
set foldmethod=syntax
set hls
set ignorecase
set incsearch
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space
set mouse=a
set nocompatible
set nowrap
set nu
set rnu
set shiftwidth=4
set showcmd
set spelllang+=fr
set splitbelow splitright
set tabstop=4
color desert
hi Normal ctermfg=None ctermbg=None
@ -182,10 +174,6 @@ Plugin 'tikhomirov/vim-glsl'
"c sharp
" Plugin 'OmniSharp/omnisharp-vim'
"java
Plugin 'hdiniz/vim-gradle'
"latex
Plugin 'lervag/vimtex'