Initial commit

This commit is contained in:
Martin Pander
2020-09-10 09:54:18 +02:00
commit 03c7bc3c59
50 changed files with 7816 additions and 0 deletions

1
nvim/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.cache/

123
nvim/UltiSnips/all.snippets Normal file
View File

@ -0,0 +1,123 @@
# This file contains snippets that are always defined. I personally
# have snippets for signatures and often needed texts
# sligthly lower priority than everything else since specialized versions
# should overwrite. The user needs to adjust her priority in her snippets to
# ~-55 so that other filetypes will still overwrite.
priority -60
##############
# NICE BOXES #
##############
global !p
import string, vim
""" Maps a filetype to comment format used for boxes.
Automatically filled during usage"""
_commentDict = { }
def _parse_comments(s):
""" Parses vim's comments option to extract comment format """
i = iter(s.split(","))
rv = []
try:
while True:
# get the flags and text of a comment part
flags, text = next(i).split(':', 1)
if len(flags) == 0:
rv.append((text, text, text, ""))
# parse 3-part comment, but ignore those with O flag
elif flags[0] == 's' and 'O' not in flags:
ctriple = []
indent = ""
if flags[-1] in string.digits:
indent = " " * int(flags[-1])
ctriple.append(text)
flags,text = next(i).split(':', 1)
assert(flags[0] == 'm')
ctriple.append(text)
flags,text = next(i).split(':', 1)
assert(flags[0] == 'e')
ctriple.append(text)
ctriple.append(indent)
rv.append(ctriple)
elif flags[0] == 'b':
if len(text) == 1:
rv.insert(0, (text,text,text, ""))
except StopIteration:
return rv
def _get_comment_format():
""" Returns a 4-element tuple representing the comment format for
the current file. """
return _parse_comments(vim.eval("&comments"))[0]
def make_box(twidth, bwidth=None):
b, m, e, i = _get_comment_format()
bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2
sline = b + m + bwidth_inner * m[0] + 2 * m[0]
nspaces = (bwidth_inner - twidth) // 2
mlines = i + m + " " + " " * nspaces
mlinee = " " + " "*(bwidth_inner - twidth - nspaces) + m
eline = i + m + bwidth_inner * m[0] + 2 * m[0] + e
return sline, mlines, mlinee, eline
def foldmarker():
"Return a tuple of (open fold marker, close fold marker)"
return vim.eval("&foldmarker").split(",")
endglobal
snippet box "A nice box with the current comment symbol" b
`!p
box = make_box(len(t[1]))
snip.rv = box[0] + '\n' + box[1]
`${1:content}`!p
box = make_box(len(t[1]))
snip.rv = box[2] + '\n' + box[3]`
$0
endsnippet
snippet bbox "A nice box over the full width" b
`!p
width = int(vim.eval("&textwidth")) or 71
box = make_box(len(t[1]), width)
snip.rv = box[0] + '\n' + box[1]
`${1:content}`!p
box = make_box(len(t[1]), width)
snip.rv = box[2] + '\n' + box[3]`
$0
endsnippet
snippet fold "Insert a vim fold marker" b
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = _get_comment_format()[2]`
endsnippet
snippet foldc "Insert a vim fold close marker" b
`!p snip.rv = _get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = _get_comment_format()[2]`
endsnippet
snippet foldp "Insert a vim fold marker pair" b
`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = _get_comment_format()[2]`
${2:${VISUAL:Content}}
`!p snip.rv = _get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = _get_comment_format()[2]`
endsnippet
##########################
# LOREM IPSUM GENERATORS #
##########################
snippet lorem "Lorem Ipsum - 50 Words" b
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
endsnippet
# vim:ft=snippets:

154
nvim/UltiSnips/c.snippets Normal file
View File

@ -0,0 +1,154 @@
###########################################################################
# TextMate Snippets #
###########################################################################
priority -50
snippet def "#define ..."
#define ${1}
endsnippet
snippet ifndef "#ifndef ... #define ... #endif"
#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
#define ${1:SYMBOL} ${2:value}
#endif
endsnippet
snippet #if "#if #endif" b
#if ${1:0}
${VISUAL}${0:${VISUAL/(.*)/(?1::code)/}}
#endif
endsnippet
snippet inc "#include local header (inc)"
#include "${1:`!p snip.rv = snip.basename + '.h'`}"
endsnippet
snippet Inc "#include <> (Inc)"
#include <${1:.h}>
endsnippet
snippet mark "#pragma mark (mark)"
#if 0
${1:#pragma mark -
}#pragma mark $2
#endif
$0
endsnippet
snippet main "main() (main)"
int main(int argc, char *argv[])
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
return 0;
}
endsnippet
# snippet for "for loop (for)"
# for (${2:i} = 0; $2 < ${1:count}; ${3:++$2})
# {
# ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
# }
# endsnippet
snippet for "for int loop (for)"
for ( ${4:int} ${2:i}=0; $2<${1:count}; ${3:$2++} ) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet enum "Enumeration"
enum ${1:name} { $0 };
endsnippet
snippet once "Include header once only guard"
#ifndef ${1:`!p
if not snip.c:
import random, string
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
snip.rv = ('%s_%s' % (name,rand)).upper()
else:
snip.rv = snip.c`}
#define $1
${0}
#endif /* end of include guard: $1 */
endsnippet
snippet td "Typedef"
typedef ${1:int} ${2:MyCustomType};
endsnippet
snippet wh "while loop"
while(${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet do "do...while loop (do)"
do {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
} while(${1:/* condition */});
endsnippet
snippet fprintf "fprintf ..."
fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet
snippet if "if .. (if)"
if (${1:/* condition */})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet el "else .. (else)"
else {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet eli "else if .. (eli)"
else if (${1:/* condition */}) {
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet ife "if .. else (ife)"
if (${1:/* condition */})
{
${2:/* code */}
}
else
{
${3:/* else */}
}
endsnippet
snippet printf "printf .. (printf)"
printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
endsnippet
snippet st "struct"
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`}
{
${0:/* data */}
};
endsnippet
snippet fun "function" b
${1:void} ${2:function_name}(${3})
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}
endsnippet
snippet fund "function declaration" b
${1:void} ${2:function_name}(${3});
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,89 @@
priority -50
extends c
# We want to overwrite everything in parent ft.
priority -49
###########################################################################
# TextMate Snippets #
###########################################################################
snippet beginend "$1.begin(), $1.end() (beginend)"
${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
endsnippet
snippet cl "class .. (class)"
class ${1:`!p snip.rv = snip.basename or "name"`}
{
public:
${1/(\w+).*/$1/} (${2:arguments});
virtual ~${1/(\w+).*/$1/} ();
private:
${0:/* data */}
};
endsnippet
snippet ns "namespace .. (namespace)"
namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
{
${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}}
}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
endsnippet
snippet readfile "read file (readF)"
std::vector<char> v;
if (FILE *fp = fopen(${1:"filename"}, "r"))
{
char buf[1024];
while(size_t len = fread(buf, 1, sizeof(buf), fp))
v.insert(v.end(), buf, buf + len);
fclose(fp);
}
endsnippet
snippet map "std::map (map)"
std::map<${1:key}, ${2:value}> map$0;
endsnippet
snippet vector "std::vector (v)"
std::vector<${1:char}> v$0;
endsnippet
snippet tp "template <typename ..> (template)"
template <typename ${1:_InputIter}>
endsnippet
## my own snippets
snippet dv "debug with var"
std::cout << "$1\n" << ${1:var} << "\n" << std::endl;
endsnippet
snippet dvif "debug with var (if)"
if ( output_ ) std::cout << "$1\n" << ${1:var} << "\n" << std::endl;
endsnippet
snippet pm "debug with message"
std::cout << "${1:message}" << std::endl;
endsnippet
snippet pmif "debug with message (if)"
if ( output_ ) std::cout << "${1:message}" << std::endl;
endsnippet
snippet cb "function comment block" s
// =============================================================================
// ${1:comment}
// =============================================================================
endsnippet
snippet cf "function comment block" s
// == Function =================================================================
// Name : ${1:Name}
// Description: ${2:Description}
// =============================================================================
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,6 @@
priority -50
snippet disp "Display variable" i
disp('${1:${VISUAL:variableName}}')
disp(${2:${VISUAL:variable}})
endsnippet

View File

@ -0,0 +1,92 @@
priority -50
global !p
import vim
# Tests for the existence of a variable declared by Vim's filetype detection
# suggesting the type of shell script of the current file
def testShell(scope, shell):
return vim.eval("exists('" + scope + ":is_" + shell + "')")
# Loops over the possible variables, checking for global variables
# first since they indicate an override by the user.
def getShell():
for scope in ["g", "b"]:
for shell in ["bash", "posix", "sh", "kornshell"]:
if testShell(scope, shell) == "1":
if shell == "kornshell":
return "ksh"
if shell == "posix":
return "sh"
return shell
return "sh"
endglobal
###########################################################################
# TextMate Snippets #
###########################################################################
snippet #!
`!p snip.rv = '#!/bin/' + getShell() + "\n\n" `
endsnippet
snippet !env "#!/usr/bin/env (!env)"
`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
endsnippet
snippet temp "Tempfile"
${1:TMPFILE}="$(mktemp -t ${2:`!p
snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
`})"
${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}}
endsnippet
snippet case "case .. esac (case)"
case ${1:word} in
${2:pattern} )
$0;;
esac
endsnippet
snippet elif "elif .. (elif)"
elif ${2:[[ ${1:condition} ]]}; then
${0:#statements}
endsnippet
snippet for "for ... done (for)"
for (( i = 0; i < ${1:10}; i++ )); do
${0:#statements}
done
endsnippet
snippet forin "for ... in ... done (forin)"
for ${1:i}${2/.+/ in /}${2:words}; do
${0:#statements}
done
endsnippet
snippet here "here document (here)"
<<-${2:'${1:TOKEN}'}
$0
${1/['"`](.+)['"`]/$1/}
endsnippet
snippet if "if ... then (if)"
if ${2:[[ ${1:condition} ]]}; then
${0:#statements}
fi
endsnippet
snippet until "until ... (done)"
until ${2:[[ ${1:condition} ]]}; do
${0:#statements}
done
endsnippet
snippet while "while ... (done)"
while ${2:[[ ${1:condition} ]]}; do
${0:#statements}
done
endsnippet
# vim:ft=snippets:

View File

158
nvim/UltiSnips/tex.snippets Normal file
View File

@ -0,0 +1,158 @@
priority -50
extends texmath
snippet document "document setup"
\documentclass[a4paper]{article}
\usepackage{defaultTex}
% \usepackage[style=alphabetic]{biblatex}
% \addbibresource{lib.bib}
\begin{document}
${1:text}
\end{document}
endsnippet
snippet "b(egin)?" "begin{} / end{}" br
\begin{${1:something}}
${0:${VISUAL}}
\label{${2}}
\end{$1}
endsnippet
snippet bo "bold"
\textbf{${1:${VISUAL}}}$0
endsnippet
snippet tab
\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
$0${2/((?<=.)c|l|r)|./(?1: & )/g}
\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
endsnippet
snippet fig "Figure environment" b
\begin{figure}${2:[htpb]}
\centering
\includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
\caption{${4/(\w+)\.\w+/\u$1/}$0}
\label{fig:${4/(\w+)\.\w+/$1/}}
\end{figure}
endsnippet
snippet enum "Enumerate" b
\begin{enumerate}
\item $1
\end{enumerate}
endsnippet
snippet item "Itemize" b
\begin{itemize}
\item $1
\end{itemize}
endsnippet
snippet desc "Description" b
\begin{description}
\item[$1] $0
\end{description}
endsnippet
snippet eq "equation"
\begin{equation}
${2:${VISUAL}}
\end{equation}
endsnippet
snippet eql "equation with label"
\begin{equation}
${2:${VISUAL}}
\label{$1}
\end{equation}
endsnippet
snippet eqs "aligned equations"
\begin{equation}
\begin{aligned}
${2:${VISUAL}}
\end{aligned}
\end{equation}
endsnippet
snippet eqsl "aligned equations with label"
\begin{equation}
\begin{aligned}
${2:${VISUAL}}
\end{aligned}
\label{$1}
\end{equation}
endsnippet
snippet align "align"
\begin{align}
${2:${VISUAL}}
\label{$1}
\end{align}
endsnippet
snippet it "Individual item" b
\item $1
endsnippet
snippet part "Part" b
\part{${1:part name}}
\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
${0}
endsnippet
snippet cha "Chapter" b
\chapter{${1:chapter name}}
\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet sec "Section" b
\section{${1:section name}}
\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet sub "Subsection" b
\subsection{${1:subsection name}}
\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet ssub "Subsubsection" b
\subsubsection{${1:subsubsection name}}
\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet par "Paragraph" b
\paragraph{${1:paragraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet subp "Subparagraph" b
\subparagraph{${1:subparagraph name}}
\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
${0}
endsnippet
snippet ni "Non-indented paragraph" b
\noindent
${0}
endsnippet
snippet pac "Package" b
\usepackage[${1:options}]{${2:package}}$0
endsnippet
# vim:ft=snippets:

View File

@ -0,0 +1,85 @@
priority -50
##############
# MATH STUFF #
##############
# snippet eq "Equation" b
# \begin{equation}
# $0
# \end{equation}
# endsnippet
# snippet eqnn "Equation without number" b
# \begin{equation*}
# $0
# \end{equation*}
# endsnippet
# snippet eqa "Equation array" b
# \begin{eqnarray}
# $1 & $2 & $0
# \end{eqnarray}
# endsnippet
# snippet eqann "Equation array without numbers" b
# \begin{eqnarray*}
# $1 & $2 & $0
# \end{eqnarray*}
# endsnippet
snippet frac "Fraction" w
\frac{${1:${VISUAL:nom}}}{${2:denom}}
endsnippet
snippet mat "Smart Matrix"
\begin{${1:p/b/v/V/B/small}matrix}
$0
\end{$1matrix}
endsnippet
snippet lrb "left( right)" w
\left( ${1:${VISUAL}} \right)
endsnippet
snippet lrv "left| right|" w
\left| ${1:${VISUAL}} \right|
endsnippet
snippet lrB "left\{ right\}" w
\left\\{ ${1:${VISUAL}} \right\\}
endsnippet
snippet lre "left[ right]" w
\left[ ${1:${VISUAL}} \right]
endsnippet
# my snippets
snippet func "Function" w
\func{${1:${VISUAL}}}{${2}}
endsnippet
snippet funcb "Function with brackets" w
\funcb{${1:${VISUAL}}}{${2}}
endsnippet
snippet int "integral"
\int_{${1}}^{${2}}
endsnippet
snippet sum "sum"
\sum_{${1}}^{${2}}
endsnippet
snippet eqr "eqref"
\eqref{${1}}
endsnippet
snippet v "Vector" w
\vec
endsnippet
snippet bis "bis" w
\bis{${1}}{${2}}
endsnippet
# vim:ft=snippets:

2699
nvim/autoload/plug.vim Normal file

File diff suppressed because it is too large Load Diff

2664
nvim/autoload/plug.vim.old Normal file

File diff suppressed because it is too large Load Diff

438
nvim/init.vim Normal file
View File

@ -0,0 +1,438 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
set mouse=a
set history=1000
set ruler
set number
set showcmd
set ttimeoutlen=100
set backspace=indent,eol,start
set tabstop=4
set expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
set showmatch
set incsearch
set hlsearch
set wrapscan
set ignorecase
set smartcase
set hidden
set splitright
set splitbelow
" set backupdir=~/.config/nvim/backup,/tmp
" set backup
set noswapfile
set wildmode=longest,list
set nospell
set foldmethod=syntax
set foldopen-=block
set foldlevel=99
set lazyredraw
set listchars=eol,tab:\ \ ,trail
set fillchars=vert:\|,fold:\
set list
set laststatus=2
set scrolloff=8
set background=light
" set colorcolumn=100
set wrap
set showbreak=..
set clipboard+=unnamedplus
" set formatoptions+=l
set noerrorbells
set visualbell
set t_vb=
set title
set autoread
syntax on
let g:tex_flavor="latex"
" set listchars=eol:¬,tab:▸\ ,trail:·
" set listchars=eol:¬,tab:>\ ,trail:·
if !has('nvim') | set encoding=utf-8 | endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" plugins
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call plug#begin('~/.local/share/nvim/site/plugins')
Plug 'kien/ctrlp.vim' | Plug 'sgur/ctrlp-extensions.vim'
Plug 'scrooloose/nerdtree'
" Plug 'scrooloose/syntastic'
Plug 'vim-scripts/bufexplorer.zip'
Plug 'majutsushi/tagbar'
Plug 'Shougo/deoplete.nvim'
Plug 'SirVer/ultisnips'
Plug 'Raimondi/delimitMate'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'junegunn/vim-easy-align'
Plug 'maxbrunsfeld/vim-yankstack'
Plug 'tpope/vim-repeat'
Plug 'wellle/targets.vim'
Plug 'benekastah/neomake'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-dispatch'
Plug 'lervag/vimtex'
Plug 'vim-scripts/MatlabFilesEdition'
Plug 'vim-scripts/LanguageTool'
" Plug 'mhinz/neovim-remote'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | Plug 'junegunn/fzf.vim'
Plug 'rking/ag.vim'
Plug 'tpope/vim-obsession'
Plug 'mhinz/vim-startify'
Plug 'wesQ3/vim-windowswap'
Plug 'bling/vim-airline' | Plug 'vim-airline/vim-airline-themes' |Plug 'jonathanfilip/vim-lucius'
Plug 'altercation/vim-colors-solarized'
call plug#end()
filetype plugin indent on
set omnifunc=syntaxcomplete#Complete
set completeopt=menu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" plugin specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" NerdTree
let NERDTreeQuitOnOpen=1
let NERDTreeHijackNetrw=1
" syntastic
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" CtrlP
set wildignore+=main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc
let g:ctrlp_switch_buffer = 'e'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_extensions = [ 'tag', 'buffertag', 'mixed' ]
let g:ctrlp_map = ''
" let g:ctrlp_prompt_mappings = {
" \ 'PrtSelectMove("j")': ['<c-n>', '<down>'],
" \ 'PrtSelectMove("k")': ['<c-p>', '<up>'],
" \}
" tagbar
let g:tagbar_left=1
let g:tagbar_autoclose=1
let g:tagbar_autofocus=1
" deoplete
let g:deoplete#enable_at_startup=1
" if !exists('g:deoplete#omni#input_patterns')
" let g:deoplete#omni#input_patterns = {}
" endif
" DelimitMate
let delimitMate_expand_space=1
let delimitMate_expand_cr=1
" UltiSnips
let g:UltiSnipsSnippetsDir='~/.config/nvim/UltiSnips'
let g:UltiSnipsSnippetsDirectories=["UltiSnips"]
let g:UltiSnipsExpandTrigger="<C-j>"
let g:UltiSnipsJumpForwardTrigger="<C-j>"
let g:UltiSnipsJumpBackwardTrigger="<C-k>"
" YankStack
let g:yankstack_map_keys=0
call yankstack#setup()
" vimtex
let g:vimtex_fold_enabled = 1
let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_mode = 2
" let g:deoplete#omni#input_patterns.tex =
" \ '\v\\%('
" \ . '\a*cite\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)'
" \ . '|hyperref\s*\[[^]]*'
" \ . '|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|%(include%(only)?|input)\s*\{[^}]*'
" \ . '|\a*(gls|Gls|GLS)(pl)?\a*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
" \ . '|includepdf%(\s*\[[^]]*\])?\s*\{[^}]*'
" \ . '|includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*'
" \ . ')'
" Startify
let g:startify_session_dir = '~/.config/nvim/obsessions'
let g:startify_list_order = [[' Sessions'],'sessions',
\ [' Bookmarks'],'bookmarks',
\ [' Recent dirs'],'dir',]
let g:startify_bookmarks = [ {'v': '~/.config/nvim/init.vim'} ]
" \ [' Recent files'],'files',
let g:startify_custom_header = []
" windowswap
let g:windowswap_map_keys=0
" airline
let g:airline_theme='lucius'
if !exists('g:airline_symbols')
let g:airline_symbols={}
endif
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
let g:airline_section_y=''
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#tab_nr_type = 1
let g:airline#extensions#tabline#show_buffers=0
let g:airline#extensions#tabline#show_tab_nr=1
let g:airline#extensions#tabline#show_tab_type=0
let g:airline#extensions#tabline#fnamemod = ':~:.'
" Lucius
colorscheme lucius
LuciusWhite
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" misc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader = "\<Space>"
nnoremap <leader>w :w<CR>
nnoremap <silent> <leader>q :call ToggleList("Quickfix List", 'c')<CR>
nnoremap <silent> <leader>ev :tabnew ~/.config/nvim/init.vim<CR>
nnoremap Y y$
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
" file navigation
nnoremap <silent> <leader>f :Files ~<CR>
nnoremap <silent> <leader>F :e.<CR>
nnoremap <silent> <leader>o :CtrlPBuffer<CR>
nnoremap <silent> <leader>O :BufExplorer<CR>
nnoremap <silent> <leader>t :CtrlPBufTagAll<CR>
nnoremap <silent> <leader>T :TagbarToggle<CR>
nnoremap <leader>p :CtrlPYankring<CR>
nnoremap <C-p> <Plug>yankstack_substitute_newer_paste
nnoremap <C-n> <Plug>yankstack_substitute_older_paste
" command line mappings
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
cnoremap w!! w !sudo tee > /dev/null %
" quickfix mappings
nnoremap <silent> <leader>q :call ToggleList("Quickfix List", 'c')<CR>
nnoremap <silent> [q :cprevious<CR>
nnoremap <silent> ]q :cnext<CR>
" split movement
nnoremap <C-h> <C-w>h
nnoremap <BS> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <leader>s :call WindowSwap#EasyWindowSwap()<CR>
" terminal mappings
tnoremap <Esc> <C-\><C-n>
tnoremap <C-h> <C-\><C-n><C-w>h
tnoremap <C-j> <C-\><C-n><C-w>j
tnoremap <C-k> <C-\><C-n><C-w>k
tnoremap <C-l> <C-\><C-n><C-w>l
" alignment mappings
nnoremap <silent> <leader>= :normal vip<CR> :'<,'>EasyAlign =<CR>
vnoremap <silent> <leader>= :'<,'>EasyAlign =<CR>
vmap <Enter> <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
augroup Terminal
autocmd!
au BufWinEnter,WinEnter term://* startinsert
au TermOpen * call SetMatlabMaps()
augroup END
" no folding on open bracket
augroup Folding
autocmd!
au InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
au InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
augroup END
" Source init.vim on write
augroup VimIntern
autocmd!
au BufWritePost ~/Documents/setup/nvim/init.vim source %
" check for file change
au FocusGained,BufEnter,CursorMoved,CursorMovedI,CursorHold,CursorHoldI * :silent! checktime
" change working directory to current files directory
au BufEnter * silent! lcd %:p:h
augroup END
" tmux window title
augroup TmuxTitle
autocmd!
au VimEnter * call SaveTmuxWindowName()
au SessionLoadPost * call ChangeTmuxToSessionName()
au VimLeave * call system("tmux rename-window '" . g:tmuxWindowName . "'")
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" filetype specific
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" matlab
augroup Matlab
autocmd!
au FileType matlab let b:commentary_format='% %s'
au FileType matlab setlocal listchars=eol,tab:\|\ ,trail
au FileType matlab nnoremap <leader>ml :call OpenMatlabInTerminal()<CR>
" au FileType matlab inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
augroup END
" c/c++
augroup Cpp
autocmd!
au FileType c,cpp setlocal listchars=eol,tab:\|\ ,trail
au FileType c,cpp nnoremap <leader>ml :call OpenMatlabInTerminal()<CR>
" au FileType c,cpp inoremap <silent> = =<Esc>:call <SID>ealign()<CR>a
augroup END
" tex
augroup Tex
autocmd!
au Filetype tex,latex setlocal foldmethod=expr
au Filetype tex,latex setlocal foldlevel=0
au Filetype tex,latex setlocal spell
" au Filetype tex,latex setlocal textwidth=80
au Filetype tex,latex inoremap $ $$<Left>
au BufWritePost *.tex Neomake
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" custom functions
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" open terminal with matlab in bottom right split
function! OpenMatlabInTerminal()
execute "normal \<C-w>l"
split
terminal mlnd
call SetMatlabMaps()
endfunction
function! SetMatlabMaps()
if bufname('') =~? "mlnd"
tnoremap <buffer> <leader><leader>mc close all<CR>
tnoremap <buffer> <leader><leader>mw clear<CR>
tnoremap <buffer> <leader><leader>mf clear functions<CR>
nnoremap <buffer> <C-c> i<C-c>
endif
endfunction
" change tmux window name to session
function! ChangeTmuxToSessionName()
let sessionName = v:this_session
if strlen(sessionName)
let session = substitute(sessionName, ".*/", "", "g")
call system("tmux rename-window '" . session . "'")
else
call system("tmux rename-window 'nvim'")
endif
endfunction
function! SaveTmuxWindowName()
let g:tmuxWindowName = system("tmux display-message -p '#W'")
call system("tmux rename-window 'nvim'")
endfunction
" remove whitespaces
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
" function! s:ealign()
" let p = '^.*=\s.*$'
" if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
" let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
" let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
" Tabularize/=/l1
" normal! 0
" call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
" endif
" endfunction
" toggle the quickfix or location list window.
function! GetBufferList()
redir =>buflist
silent! ls
redir END
return buflist
endfunction
function! ToggleList(bufname, pfx)
let buflist = GetBufferList()
for bufnum in map(filter(split(buflist, '\n'), 'v:val =~ "'.a:bufname.'"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
if bufwinnr(bufnum) != -1
exec(a:pfx.'close')
return
endif
endfor
if a:pfx == 'l' && len(getloclist(0)) == 0
echohl ErrorMsg
echo "Location List is Empty."
return
endif
let winnr = winnr()
exec(a:pfx.'open')
if winnr() != winnr
wincmd p
endif
endfunction
" let neomake_matlab_mlint_maker = {
" \ 'exe': 'mlint',
" \ 'errorformat':
" \ '%+PFile:\ %f,' .
" \ 'L\ %l\ (C\ %c):\ %m,' .
" \ 'L\ %l\ (C\ %c-%.):\ %m,',
" \ }
" neomake matlab maker
let neomake_matlab_mlint_maker = {
\ 'exe': 'mlint',
\ 'errorformat':
\ '%+PFile:\ %f,' .
\ 'L\ %l\ (C\ %c):\ %*[a-zA-Z0-9]:\ %m,'.
\ 'L\ %l\ (C\ %c-%*[0-9]):\ %*[a-zA-Z0-9]:\ %m'
\ }

2
nvim/obsessions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
nvim/plugins/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
nvim/pluginstuff/yankring/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

1
nvim/pluginstuff/ycm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

View File

@ -0,0 +1,117 @@
import os
import ycm_core
from clang_helpers import PrepareClangFlags
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-pendantic',
'-std=c++11',
'-x',
'c++',
'-I',
'.',
'-isystem',
'/usr/include/',
'-isystem',
'/usr/local/include/',
'-isystem',
'/Library/Developer/CommandLineTools/usr/include',
'-isystem',
'/Library/Developer/CommandLineTools/usr/lib/c++/v1'
]
compilation_database_folder = ''
if os.path.exists( compilation_database_folder ):
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def IsHeaderFile( filename ):
extension = os.path.splitext( filename )[ 1 ]
return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
def GetCompilationInfoForFile( filename ):
# The compilation_commands.json file generated by CMake does not have entries
# for header files. So we do our best by asking the db for flags for a
# corresponding source file, if any. If one exists, the flags for that file
# should be good enough.
if IsHeaderFile( filename ):
basename = os.path.splitext( filename )[ 0 ]
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists( replacement_file ):
compilation_info = database.GetCompilationInfoForFile(
replacement_file )
if compilation_info.compiler_flags_:
return compilation_info
return None
return database.GetCompilationInfoForFile( filename )
def FlagsForFile( filename, **kwargs ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = GetCompilationInfoForFile( filename )
if not compilation_info:
return None
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
try:
final_flags.remove( '-stdlib=libc++' )
except ValueError:
pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}

BIN
nvim/spell/de.utf-8.spl Normal file

Binary file not shown.

4
nvim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,4 @@
resampling
reweighted
reweighting
Kalman

BIN
nvim/spell/en.utf-8.add.spl Normal file

Binary file not shown.

BIN
nvim/spell/en.utf-8.spl Normal file

Binary file not shown.

BIN
nvim/spell/en.utf-8.sug Normal file

Binary file not shown.