Aggiunta impostazioni base vim.

This commit is contained in:
Emiliano Vavassori 2023-04-29 16:36:57 +02:00
parent 56f659d5ce
commit 0f56baa132
48 changed files with 10738 additions and 1 deletions

132
vim/ftplugin/cucumber.vim Normal file
View file

@ -0,0 +1,132 @@
" Vim filetype plugin
" Language: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 Aug 09
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=CucumberComplete
let b:undo_ftplugin = "setl fo< com< cms< ofu<"
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
nmap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
nmap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
nmap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
nmap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
let b:undo_ftplugin .= "| sil! nunmap <buffer> <C-]>| sil! nunmap <buffer> <C-W>]| sil! nunmap <buffer> <C-W><C-]>| sil! nunmap <buffer> <C-W>}"
endif
function! s:jump(command,count)
let steps = s:steps('.')
if len(steps) == 0 || len(steps) < a:count
return 'echoerr "No matching step found"'
elseif len(steps) > 1 && !a:count
return 'echoerr "Multiple matching steps found"'
else
let c = a:count ? a:count-1 : 0
return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#')
endif
endfunction
function! s:allsteps()
let step_pattern = '\C^\s*\K\k*\>\s*\zs\S.\{-\}\ze\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
let steps = []
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
let lines = readfile(file)
let num = 0
for line in lines
let num += 1
if line =~ step_pattern
let type = matchstr(line,'\w\+')
let steps += [[file,num,type,matchstr(line,step_pattern)]]
endif
endfor
endfor
return steps
endfunction
function! s:steps(lnum)
let c = indent(a:lnum) + 1
while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$'
let c = c + 1
endwhile
let step = matchstr(getline(a:lnum)[c-1 : -1],'^\s*\zs.\{-\}\ze\s*$')
return filter(s:allsteps(),'s:stepmatch(v:val[3],step)')
endfunction
function! s:stepmatch(receiver,target)
if a:receiver =~ '^[''"].*[''"]$'
let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$'
elseif a:receiver =~ '^/.*/$'
let pattern = a:receiver[1:-2]
elseif a:receiver =~ '^%r..*.$'
let pattern = escape(a:receiver[3:-2],'/')
else
return 0
endif
try
let vimpattern = substitute(substitute(pattern,'\\\@<!(?:','%(','g'),'\\\@<!\*?','{-}','g')
if a:target =~# '\v'.vimpattern
return 1
endif
catch
endtry
if has("ruby") && pattern !~ '\\\@<!#{'
ruby VIM.command("return #{if (begin; Kernel.eval('/'+VIM.evaluate('pattern')+'/'); rescue SyntaxError; end) === VIM.evaluate('a:target') then 1 else 0 end}")
else
return 0
endif
endfunction
function! s:bsub(target,pattern,replacement)
return substitute(a:target,'\C\\\@<!'.a:pattern,a:replacement,'g')
endfunction
function! CucumberComplete(findstart,base) abort
let indent = indent('.')
let group = synIDattr(synID(line('.'),indent+1,1),'name')
let type = matchstr(group,'\Ccucumber\zs\%(Given\|When\|Then\)')
let e = matchend(getline('.'),'^\s*\S\+\s')
if type == '' || col('.') < col('$') || e < 0
return -1
endif
if a:findstart
return e
endif
let steps = []
for step in s:allsteps()
if step[2] ==# type
if step[3] =~ '^[''"]'
let steps += [step[3][1:-2]]
elseif step[3] =~ '^/\^.*\$/$'
let pattern = step[3][2:-3]
let pattern = substitute(pattern,'\C^(?:|I )','I ','')
let pattern = s:bsub(pattern,'\\[Sw]','w')
let pattern = s:bsub(pattern,'\\d','1')
let pattern = s:bsub(pattern,'\\[sWD]',' ')
let pattern = s:bsub(pattern,'\[\^\\\="\]','_')
let pattern = s:bsub(pattern,'[[:alnum:]. _-][?*]?\=','')
let pattern = s:bsub(pattern,'\[\([^^]\).\{-\}\]','\1')
let pattern = s:bsub(pattern,'+?\=','')
let pattern = s:bsub(pattern,'(\([[:alnum:]. -]\{-\}\))','\1')
let pattern = s:bsub(pattern,'\\\([[:punct:]]\)','\1')
if pattern !~ '[\\()*?]'
let steps += [pattern]
endif
endif
endif
endfor
call filter(steps,'strpart(v:val,0,strlen(a:base)) ==# a:base')
return sort(steps)
endfunction
" vim:set sts=2 sw=2:

View file

@ -0,0 +1,142 @@
<+ +> !comp! !exe!
%% Based on <bare_jrnl.tex> in the ieee package available from CTAN,
%% I have changed the options so that most useful ones are clubbed together,
%% Have a look at <bare_jrnl.tex> to understand the function of each package.
%% This code is offered as-is - no warranty - user assumes all risk.
%% Free to use, distribute and modify.
% *** Authors should verify (and, if needed, correct) their LaTeX system ***
% *** with the testflow diagnostic prior to trusting their LaTeX platform ***
% *** with production work. IEEE's font choices can trigger bugs that do ***
% *** not appear when using other class files. ***
% Testflow can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/testflow
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[journal]{IEEEtran}
\usepackage{cite, graphicx, subfigure, amsmath}
\interdisplaylinepenalty=2500
% *** Do not adjust lengths that control margins, column widths, etc. ***
% *** Do not use packages that alter fonts (such as pslatex). ***
% There should be no need to do such things with IEEEtran.cls V1.6 and later.
<++>
% correct bad hyphenation here
\hyphenation{<+op-tical net-works semi-conduc-tor+>}
\begin{document}
%
% paper title
\title{<+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>}
%
%
% author names and IEEE memberships
% note positions of commas and nonbreaking spaces ( ~ ) LaTeX will not break
% a structure at a ~ so this keeps an author's name from being broken across
% two lines.
% use \thanks{} to gain access to the first footnote area
% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks
% was not built to handle multiple paragraphs
\author{<+Sumit Bhardwaj+>~\IEEEmembership{<+Student~Member,~IEEE,+>}
<+John~Doe+>,~\IEEEmembership{<+Fellow,~OSA,+>}
<+and~Jane~Doe,+>~\IEEEmembership{<+Life~Fellow,~IEEE+>}}% <-this % stops a space
\thanks{<+Manuscript received January 20, 2002; revised August 13, 2002.
This work was supported by the IEEE.+>}% <-this % stops a space
\thanks{<+S. Bhardwaj is with the Indian Institute of Technology, Delhi.+>}
%
% The paper headers
\markboth{<+Journal of VIM-\LaTeX\ Class Files,~Vol.~1, No.~8,~August~2002+>}{
<+Bhardwaj \MakeLowercase{\textit{et al.}+>}: <+Skeleton of IEEEtran.cls for Journals in VIM-Latex+>}
% The only time the second header will appear is for the odd numbered pages
% after the title page when using the twoside option.
% If you want to put a publisher's ID mark on the page
% (can leave text blank if you just want to see how the
% text height on the first page will be reduced by IEEE)
%\pubid{0000--0000/00\$00.00~\copyright~2002 IEEE}
% use only for invited papers
%\specialpapernotice{(Invited Paper)}
% make the title area
\maketitle
\begin{abstract}
<+The abstract goes here.+>
\end{abstract}
\begin{keywords}
<+IEEEtran, journal, \LaTeX, paper, template, VIM, VIM-\LaTeX+>.
\end{keywords}
\section{Introduction}
\PARstart{<+T+>}{<+his+>} <+demo file is intended to serve as a ``starter file"
for IEEE journal papers produced under \LaTeX\ using IEEEtran.cls version
1.6 and later.+>
% You must have at least 2 lines in the paragraph with the drop letter
% (should never be an issue)
<+May all your publication endeavors be successful.+>
% needed in second column of first page if using \pubid
%\pubidadjcol
% trigger a \newpage just before the given reference
% number - used to balance the columns on the last page
% adjust value as needed - may need to be readjusted if
% the document is modified later
%\IEEEtriggeratref{8}
% The "triggered" command can be changed if desired:
%\IEEEtriggercmd{\enlargethispage{-5in}}
% references section
%\bibliographystyle{IEEEtran.bst}
%\bibliography{IEEEabrv,../bib/paper}
\begin{thebibliography}{1}
\bibitem{IEEEhowto:kopka}
H.~Kopka and P.~W. Daly, \emph{A Guide to {\LaTeX}}, 3rd~ed.\hskip 1em plus
0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.
\end{thebibliography}
% biography section
%
\begin{biography}{Sumit Bhardwaj}
Biography text here.
\end{biography}
% if you will not have a photo
\begin{biographynophoto}{John Doe}
Biography text here.
\end{biographynophoto}
% insert where needed to balance the two columns on the last page
%\newpage
\begin{biographynophoto}{Jane Doe}
Biography text here.
\end{biographynophoto}
% You can push biographies down or up by placing
% a \vfill before or after them. The appropriate
% use of \vfill depends on what kind of text is
% on the last page and whether or not the columns
% are being equalized.
%\vfill
% Can be used to pull up biographies so that the bottom of the last one
% is flush with the other column.
%\enlargethispage{-5in}
\end{document}

View file

@ -0,0 +1,13 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper]{article}
\usepackage[italian]{babel}
\usepackage{fontspec,textcomp,xltxtra}
\defaultfontfeatures{Ligatures=Common}
\setmainfont[Mapping=tex-text,Alternate=0,Numbers=OldStyle]{Warnock Pro Light}
\begin{document}
<++>
\end{document}

View file

@ -0,0 +1,41 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Creato: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Ultima Modifica: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass{beamer}
\mode<presentation>{
\usetheme{Warsaw}
\setbeamercovered{transparent}
}
\usepackage[italian]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\beamerdefaultoverlayspecification{<+->}
\title[<+Titolo Corto+>]{<+Titolo lunghissimo+>}
\subtitle{<+Sottotitolo+>}
\author{Emiliano Vavassori}
\institute[BGlug]{Bergamo Linux Users Group}
\date[<+Evento breve+>]{\today --- <+Occasione lunga+>}
\subject{Talks}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}{Sommario}
\tableofcontents
\end{frame}
<++>
\end{document}

View file

@ -0,0 +1,52 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper,12pt,boldsubject,italicsignature]{letteracdp}
\usepackage[italian]{babel}
\usepackage{fontspec,textcomp,xltxtra}
\defaultfontfeatures{Ligatures=Common}
\setmainfont[Mapping=tex-text,Alternate=0,Numbers=OldStyle]{Warnock Pro Light}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true,%
urlcolor=blue,%
pdfauthor={Emiliano Vavassori}%
}
\name{Franco \textsc{Vavassori}}
\address{Franco Vavassori\\
Via B.~Moriggia, n\textdegree~197\\
24050 Covo (BG)\\
Tel.~0363 902222}
\place{Covo}
\signature{Franco Vavassori}
\begin{document}
\begin{letter}{%
<+destinatario+>
}[% \registered % Invio raccomandata
% <+oggetto della lettera+>
]
\opening{}
Con la presente il sottoscritto Franco Vavassori, nato a Romano di Lombardia
il 3 agosto 1956, residente a Covo in via B.~Moriggia n\textdegree~197, Codice
Fiscale \texttt{VVSFNC56M03H509Z},
\begin{center}\scshape\Large
Delega
\end{center}
<+corpo del testo+>
Colgo l'occasione per porgere
\closing{Distinti saluti}
% \begin{enclosures}
% \item Primo oggetto
% \end{enclosures}
\end{letter}
\end{document}

View file

@ -0,0 +1,47 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper,12pt,boldsubject,italicsignature]{letteracdp}
\usepackage[italian]{babel}
\usepackage{fontspec,textcomp,xltxtra,xcolor}
\defaultfontfeatures{Ligatures=Common}
\setmainfont[Mapping=tex-text,Alternate=0,Numbers=OldStyle]{Warnock Pro Light}
\usepackage{hyperref}
\definecolor{darkblue}{rgb}{0 0 .53}
\hypersetup{%
colorlinks=true,%
urlcolor=darkblue,%
pdfauthor={Emiliano Vavassori}%
}
\name{Emiliano \textsc{Vavassori}}
\address{Emiliano Vavassori\\
Via B.~Moriggia, n\textdegree~197\\
24050 Covo (BG)\\
Tel.~0363 902222}
\place{Covo}
\signature{Emiliano Vavassori}
\begin{document}
\begin{foldedletter}{%
<+indirizzo destinatario+>
}[% \registered % Invio raccomandata
% <+oggetto opzionale+>
]
\opening{}
<+corpo del testo+>
Colgo l'occasione per porgere
\closing{Distinti saluti}
% \begin{enclosures}
% \item Primo oggetto
% \end{enclosures}
\end{foldedletter}
\end{document}

View file

@ -0,0 +1,46 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper,12pt,boldsubject,italicsignature]{letteracdp}
\usepackage[italian]{babel}
\usepackage{fontspec,textcomp,xltxtra}
\defaultfontfeatures{Ligatures=Common}
\setmainfont[Mapping=tex-text,Alternate=0,Numbers=OldStyle]{Warnock Pro Light}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true,%
urlcolor=blue,%
pdfauthor={Emiliano Vavassori}%
}
\name{Emiliano \textsc{Vavassori}}
\address{Emiliano Vavassori\\
Via B.~Moriggia, n\textdegree~197\\
24050 Covo (BG)\\
Tel.~0363 902222}
\place{Covo}
\signature{Emiliano Vavassori}
\begin{document}
\begin{letter}{%
<+destinatario+>
}[% \registered % Invio raccomandata
% <+oggetto della lettera+>
]
\opening{}
<+corpo del testo+>
Colgo l'occasione per porgere
\closing{Distinti saluti}
% \begin{enclosures}
% \item Primo oggetto
% \end{enclosures}
\end{letter}
\end{document}

View file

@ -0,0 +1,9 @@
<+ +> !comp! !exe!
% File: !comp!expand("%")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper]{report}
\begin{document}
<++>
\end{document}

View file

@ -0,0 +1,9 @@
<+ +> !comp! !exe!
% File: !comp!expand("%:p:t")!comp!
% Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
% Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
%
\documentclass[a4paper,twocolumn]{report}
\begin{document}
<++>
\end{document}

View file

@ -0,0 +1,3 @@
" Customizing spacing in terraform files
set softtabstop=2
set shiftwidth=2

29
vim/ftplugin/tex.vim Normal file
View file

@ -0,0 +1,29 @@
" this is mostly a matter of taste. but LaTeX looks good with just a bit
" of indentation.
set softtabstop=2
set shiftwidth=2
set textwidth=78
" TIP: if you write your \label's as \label{fig:something}, then if you
" type in \ref{fig: and press <C-n> you will automatically cycle through
" all the figure labels. Very useful!
set iskeyword+=:
" Permits é in documents
imap <buffer> +it <Plug>Tex_InsertItemOnThisLine
" Permits ì in documents
imap <C-l> <Plug>Tex_LeftRight
" PDF Format
let g:Tex_CustomTemplateDirectory = '~/.vim/ftplugin/latex-suite/templates'
let g:Tex_DefaultTargetFormat = 'pdf'
let g:Tex_CompileRule_pdf = 'xelatex -interaction=nonstopmode $*'
let g:Tex_ViewRule_pdf = 'evince'
" Mappings for Beamer
call IMAP('BFR', "\\begin{frame}\<CR>\<Tab>\\frametitle{<+title+>}\<cr><++>\<cr>\\end{frame}<++>", 'tex')
call IMAP('BAL', "\\alert{~++~}~+overlay+~", 'tex', '~+', '+~')
call IMAP('BBL', "\\begin{block}{~+title+~}~+overlay+~\<CR>~++~\<CR>\\end{block}~++~", 'tex', '~+', '+~')
" Trying a vmap
vmap ,a "zdi\alert{<C-R>z}<ESC>

1
vim/ftplugin/yaml.vim Normal file
View file

@ -0,0 +1 @@
let b:ale_fixers = [ 'yamlfix' ]