diff --git a/misc/environment/config.vim b/misc/environment/config.vim new file mode 100644 index 0000000000000000000000000000000000000000..bbdad1a05a8e335a607751750dae6882a30af730 --- /dev/null +++ b/misc/environment/config.vim @@ -0,0 +1,23 @@ +""" Vim Config + +" Tabs +set expandtab +set smarttab + +" Indents +set shiftwidth=2 +set tabstop=2 +set autoindent +set smartindent +set cindent + +" Turn backup off +set nobackup +set nowb +set noswapfile + +" Highlight matching brackets +set showmatch + +" Display line numbers +set number diff --git a/misc/template.cpp b/misc/environment/template.cpp similarity index 100% rename from misc/template.cpp rename to misc/environment/template.cpp diff --git a/notebook/gen_latex.py b/notebook/gen_latex.py index 9b49dbe481c8b6ef99ead4e516d5fb74c39742fa..c42922acc61219f5ef2867a6a5fbf1aa9a9f3d0c 100644 --- a/notebook/gen_latex.py +++ b/notebook/gen_latex.py @@ -11,7 +11,9 @@ class Tree: # and directories. def build(self): for di in self.dirs: - path_list = sorted(list(Path(di).glob('**/*.cpp'))) + path_list = list(Path(di).glob('**/*.cpp')) + path_list += list(Path(di).glob('**/*.vim')) + path_list = sorted(path_list) for path in path_list: branch = str(path).split('/') @@ -46,7 +48,7 @@ class LatexGenerator: self._add_header() self.gen_latex(tree) - self.output.write('\end{document}') + self.output.write('\\end{document}') # Adds Latex header to the output. def _add_header(self): @@ -63,7 +65,8 @@ class LatexGenerator: # Prints code in Latex format. def gen_code_latex(self, path): # TODO: Add code parsing funcion to extract text - self.output.write('\\begin{lstlisting}[style=customcpp]\n') + suffix = path.split('.')[-1] + self.output.write('\\begin{lstlisting}[style=custom%s]\n' % suffix) with open(path) as f: lines = f.readlines() @@ -84,7 +87,6 @@ class LatexGenerator: self.gen_title_latex(self._parse_dir_name(i), depth) self.gen_latex(sub[i], path + i + '/', depth + 1) - #self.output.write('\\newpage\n') self.output.write('\n') # Parses name of the section (capitalize) diff --git a/notebook/header.tex b/notebook/header.tex index 6310e5968c9293308de90ebb040970f334030bc8..163ead96bb17f7ccdfc01c39178e6ad263a4c69e 100644 --- a/notebook/header.tex +++ b/notebook/header.tex @@ -18,5 +18,12 @@ breaklines=true, morekeywords={int32\_t, ll} } +\lstdefinestyle{customvim}{ + frame=single, + basicstyle=\small, + tabsize=2, + breaklines=true, + morekeywords={set} +} \begin{document} \tableofcontents