Skip to content

Instantly share code, notes, and snippets.

View marcotrosi's full-sized avatar

Marco Trosi marcotrosi

View GitHub Profile
#!/bin/bash
prog=$0
bash -l -c "$prog.sh"
@marcotrosi
marcotrosi / panel.vim
Created July 12, 2017 04:46
this is a draft for a Vim plugin to keep my plugins in the "same" window
if exists('loaded_panel')
finish
endif
let loaded_panel = 1
" TODO maybe move configuration to .vimrc
" TODO when a width of 0 is given -> ask panel for size; introduce min/max width
let s:panels_config = { 'files':{'run':'Files', 'width':60},
\ 'buffers':{'run':'Buffers', 'width':20},
\ 'tags':{'run':'Tags', 'width':30},
@marcotrosi
marcotrosi / completefunc.vim
Last active April 21, 2018 16:47
nested custom insert completion menus
let s:InitMenu = 'Font'
let s:NextMenu = ''
function! LatexFont(findstart, base)
if a:findstart
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~ '\a'
let start -= 1
endwhile
@marcotrosi
marcotrosi / Vim - Edit Register
Last active November 15, 2019 01:38
function and command to edit registers.
function! EditReg(reg)
let l:EditRegWinNum = bufwinnr("__EDITREG__")
if l:EditRegWinNum == -1
silent! belowright new __EDITREG__
setlocal modifiable
put! =getreg(a:reg)
$d_
setlocal noshowcmd