Migrate neovim setup

I managed my setup manually.
This commit ports the existing setup to home-manager.

The program module is used to install neovim together with plugins.
Custom plugins are now maintained at Gitea / GitHub and loaded via nix as well.
This commit is contained in:
Daniel Siepmann 2022-03-11 14:03:07 +01:00
parent 7c47df37fc
commit 082ad58af1
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
28 changed files with 1128 additions and 2 deletions

View file

@ -95,6 +95,9 @@
];
programs = {
neovim = import ./home/programs/neovim.nix {
inherit pkgs;
};
git = import ./home/programs/git.nix {
inherit pkgs;
};

280
home/programs/neovim.nix Normal file
View file

@ -0,0 +1,280 @@
{ pkgs }:
let
configuration = pkgs.vimUtils.buildVimPlugin {
name = "configuration";
src = pkgs.fetchgit {
url = "https://gitea.daniel-siepmann.de/danielsiepmann/vim-configuration.git";
rev = "53736aec92e92dc600694e90de9a8b7dabc90dd0";
sha256 = "9hRXvgtKknFd4Rng+BsedJvwU7sFBDLZmSEGteMroGc=";
};
};
colorscheme-smyckblue = pkgs.vimUtils.buildVimPlugin {
name = "colorscheme-smyckblue";
src = pkgs.fetchgit {
url = "https://gitea.daniel-siepmann.de/danielsiepmann/vim-colorscheme-smyckblue.git";
rev = "v1.0.0";
sha256 = "UPh15fMTq/HHnunq+xy8YGOlqfgUaqHuTEE5kQ3j3bM=";
};
};
snippets = pkgs.vimUtils.buildVimPlugin {
name = "snippets";
src = pkgs.fetchgit {
url = "https://gitea.daniel-siepmann.de/danielsiepmann/vim-snippets.git";
rev = "v1.0.0";
sha256 = "23XR2YysdgUW+xKS79tAYP+Hjka0YolLaHlYiD0Hyx8=";
};
};
neotags = pkgs.vimUtils.buildVimPlugin {
name = "neotags";
src = pkgs.fetchgit {
url = "https://gitea.daniel-siepmann.de/danielsiepmann/neotags.git";
rev = "v0.3.0";
sha256 = "uJ7cl+1Ngff0FKzjmh1i7O/PkNjPvPT+ZEHgceeZcz0=";
};
};
# TODO: Update, compare with other forks, move to Gitea
syntax-typoscript = pkgs.vimUtils.buildVimPlugin {
name = "syntax-typoscript";
src = pkgs.fetchFromGitHub {
owner = "DanielSiepmann";
repo = "vim.typoscript";
rev = "286bc376b55b0d0d0adc6e7ccfa6a75719437120";
sha256 = "BPvKwcTo/OL9VkNJ9dv8hs4nlVkxMI6pdkZXXAKBMWs=";
};
};
syntax-nix = pkgs.vimUtils.buildVimPlugin {
name = "syntax-nix";
src = pkgs.fetchFromGitHub {
owner = "LnL7";
repo = "vim-nix";
rev = "63b47b39c8d481ebca3092822ca8972e08df769b";
sha256 = "wQzNXfE7JFalgiCQ2ksPAUyFKacmJV7mNKmKDe9jySI=";
};
};
syntax-php = pkgs.vimUtils.buildVimPlugin {
name = "syntax-php";
src = pkgs.fetchFromGitHub {
owner = "StanAngeloff";
repo = "php.vim";
rev = "2ec2ab9fcc65bfc47c7ba6b3846903528188ceea";
sha256 = "lgsaCU6Rzzynkd9SID0chjKaxgEWznrmEl133Syc6cY=";
};
};
syntax-fluid = pkgs.vimUtils.buildVimPlugin {
name = "syntax-fluid";
src = pkgs.fetchFromGitHub {
owner = "mipmip";
repo = "vim-fluid";
rev = "cedc4ad871941e8f7134d1d71f9434f1bc3d93d5";
sha256 = "LiS2Dqw1K1Fu5VfHQnxIBDxDzEarmSAUUavQcwHRDsQ=";
};
};
ag = pkgs.vimUtils.buildVimPlugin {
name = "ag";
src = pkgs.fetchFromGitHub {
owner = "rking";
repo = "ag.vim";
rev = "c478f7973074f15bbf82c298a1678b4e23f1767a";
sha256 = "jlR8NFG7IRCYiQ7ocQQCI2npAPujgQFZ6RpFX8zwTAA=";
};
};
vdebug = pkgs.vimUtils.buildVimPlugin {
name = "vdebug";
src = pkgs.fetchFromGitHub {
owner = "joonty";
repo = "vdebug";
rev = "v2.0.0";
sha256 = "kobMC6TRFZcEbgFdOaBgXUzoeWQUrVzUKylN1N9nEnc=";
};
};
sqlformat = pkgs.vimUtils.buildVimPlugin {
name = "sqlformat";
src = pkgs.fetchFromGitHub {
owner = "mpyatishev";
repo = "vim-sqlformat";
rev = "2a2a57d75865526f85d94bf769f4fd54d61c426b";
sha256 = "LPnHcuh+jxEL8CZ1wizHqi3uzYYtIxzMqnE7y7mTrbE=";
};
};
diff-fold = pkgs.vimUtils.buildVimPlugin {
name = "diff-fold";
src = pkgs.fetchFromGitHub {
owner = "sgeb";
repo = "vim-diff-fold";
rev = "48b4505c1b6f14ceb4e4be732aad337147ef36cd";
sha256 = "M3CAUueEhLD0J6sLUpRkFv+vK4aGYO+Xnokxmn+VxqU=";
};
};
phpactor = pkgs.vimUtils.buildVimPlugin {
name = "phpactor";
src = pkgs.fetchzip {
url = "https://daniel-siepmann.de/fileadmin/phpactor-0.18.0.tar.gz";
sha256 = "1XHqKxBXcFPt2P/N2drr8EkBsg0Hu94Vjq0my+aj614=";
};
};
neoterm = pkgs.vimUtils.buildVimPlugin {
name = "neoterm";
src = pkgs.fetchFromGitHub {
owner = "kassio";
repo = "neoterm";
rev = "e78179a9ceb98de8d0c37bdda435a5deab4d5e71";
sha256 = "0w962xfcgigdw41wblrv1l55xki0kl5vwkdbm6jlr44hzii0nhgz";
};
patches = [
./neovim/patches/disable_neoterm_repl.patch
];
};
tagbar = pkgs.vimUtils.buildVimPlugin {
name = "tagbar";
src = pkgs.fetchFromGitHub {
owner = "majutsushi";
repo = "tagbar";
rev = "v2.7";
sha256 = "Eg6xRwisopmBexqkWjRbSi9aQC4uCXbFO6SCK1LY+Ow=";
};
};
in {
enable = true;
extraConfig = pkgs.lib.concatMapStringsSep "\n" (file: pkgs.lib.fileContents file) [
./neovim/init.vim
./neovim/config/functions.vim
./neovim/config/grepping.vim
./neovim/config/indentation.vim
./neovim/config/mappings.vim
./neovim/config/searching.vim
./neovim/config/statusline.vim
./neovim/config/undo.vim
./neovim/config/wildignore.vim
./neovim/config/autocommands/basics.vim
./neovim/config/autocommands/gitdiff.vim
./neovim/config/autocommands/typo3.vim
./neovim/config/autocommands/vdebug.vim
./neovim/config/folderspecific/reuter.vim
];
plugins = [
# My own plugins
colorscheme-smyckblue
neotags
configuration
snippets
syntax-typoscript
# More UI related
{
plugin = pkgs.vimPlugins.nerdtree;
config = pkgs.lib.fileContents ./neovim/plugins/nerdtree.vim;
}
{
plugin = pkgs.vimPlugins.undotree;
config = pkgs.lib.fileContents ./neovim/plugins/undotree.vim;
}
{
# Use pinned to 2.7 as I don't need any of the new features.
# Instead they make it hard to only show what I'm interested in within PHP files.
# As they changed the building with nested structures.
plugin = tagbar;
config = pkgs.lib.fileContents ./neovim/plugins/tagbar.vim;
}
{
plugin = pkgs.vimPlugins.ctrlp-vim;
config = pkgs.lib.fileContents ./neovim/plugins/ctrlp.vim;
}
# Syntax
syntax-nix
syntax-fluid
{
plugin = syntax-php;
config = pkgs.lib.fileContents ./neovim/plugins/php.vim;
}
# Adding features
ag
sqlformat
diff-fold
{
plugin = pkgs.vimPlugins.vim-snipmate;
config = ''
let g:snipMate = { 'snippet_version' : 1 }
'';
}
pkgs.vimPlugins.vim-fugitive
pkgs.vimPlugins.vim-commentary
pkgs.vimPlugins.vim-indent-object
pkgs.vimPlugins.vim-textobj-comment
{
plugin = vdebug;
config = pkgs.lib.fileContents ./neovim/plugins/vdebug.vim;
}
{
# Seems to be broken: https://github.com/kassio/neoterm/issues/338
# Therefore I install my own version where this bug is disabled
plugin = neoterm;
config = pkgs.lib.fileContents ./neovim/plugins/neoterm.vim;
}
{
plugin = phpactor;
config = ''
let g:phpactorOmniError = v:true
let g:phpactorPhpBin = "${pkgs.php80}/bin/php"
'';
}
# More related to testing, linting, …
{
plugin = pkgs.vimPlugins.ale;
config = pkgs.lib.fileContents ./neovim/plugins/ale.vim;
}
{
plugin = pkgs.vimPlugins.syntastic;
config = pkgs.lib.fileContents ./neovim/plugins/syntastic.vim;
}
{
plugin = pkgs.vimPlugins.vim-test;
config = pkgs.lib.fileContents ./neovim/plugins/test.vim;
}
# Dependencies for other plugins
pkgs.vimPlugins.vim-addon-mw-utils
pkgs.vimPlugins.vim-textobj-user
];
}

View file

@ -0,0 +1,20 @@
augroup general
autocmd!
" What does this do?! Were does it come from?
" autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Delete fugitive buffer on leave
autocmd BufReadPost fugitive://* set bufhidden=delete
" To prevent ui from switching back and forth, always activate gutter
" Doesn't seem to work anymore, not too important
" sign define dummy
" autocmd BufEnter *.* :execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('')
" Remove whitespace at end of line
autocmd BufWritePre,BufRead *.xlf,*.xml,*.html,*.php,*.js,*.css,*.scss,*.vim,*.vimrc :call StripTrailingWhitespace()
" I'm working to much on foreign code, so do not retab on read or prior write anymore
" autocmd BufWritePre,BufRead *.xlf,*.xml,*.html,*.php,*.js,*.css,*.scss,*.vim,*.vimrc :retab!
augroup END

View file

@ -0,0 +1,5 @@
augroup gitdiff
autocmd!
" Mark buffers as not modifiable, to make diffput work
autocmd BufReadPost *_REMOTE_*,*_LOCAL_*,*_BASE_* setlocal nomodifiable
augroup END

View file

@ -0,0 +1,37 @@
augroup typo3
autocmd!
" Clear some caches depending on files saved. Only works if cwd is document root
autocmd BufWritePost **/sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost **/local_packages/**/Sites/**/*.yaml :silent !rm */**/cache/**/sites-configuration.php
autocmd BufWritePost **/Configuration/RequestMiddlewares.php :silent !rm */**/cache/**/middlewares_*
autocmd BufWritePost **/Configuration/Backend/Routes.php :silent !rm */**/cache/**/BackendRoutesFromPackages_*
autocmd BufWritePost **/Configuration/Services.yaml,**/Configuration/Services/*.yaml,**/Configuration/Services.php :silent !rm */**/cache/**/DependencyInjectionContainer_*
" Extbase
" Performance issues for extbase, keep an eye
" autocmd BufWritePost **/Classes/**/*.php :silent !rm -rf */**/cache*/**/extbase/*
autocmd BufWritePost **/Configuration/Extbase/Persistence/Classes.php :silent !rm */**/cache*/**/extbase/PersistenceClasses_*
autocmd BufWritePost **/ext_tables.php :silent !rm */**/cache*/**/ext_tables_*
autocmd BufWritePost **/ext_localconf.php :silent !rm */**/cache*/**/ext_localconf_*
autocmd BufWritePost **/Configuration/TCA/** :silent !rm */**/cache*/**/tca_base_*
autocmd BufWritePost **/*.xlf :silent !rm */**/cache/**/l10n/*
autocmd BufWritePost **/*.yml,**/*.yaml :silent !rm */**/cache/**/yamlsettings_form*
" Performance issues for typoscript, keep an eye
autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :silent !rm -rf */**/var/**/pages/*
autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :silent !rm -rf */**/var/**/pagesection/*
autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :silent !rm -rf */**/var/**/cache_pages/*
autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :silent !rm -rf */**/var/**/cache_pagesection/*
" ext:news
autocmd BufWritePost **/Classes/Domain/Model/News.php :silent !rm -rf */**/var/cache/code/news/*
" Also update ftdetect/typoscript.vim for detection of Typoscript
" autocmd BufWritePost *.tsconfig,*.typoscript,*.ts,*/TypoScript/*.ts,*/TypoScript/*.txt :redraw!
" Fix draw issue after potential error message in tmux environment
" => Should fix output instead of forcing redraw, just workaround.
" autocmd BufWritePost **/*.xlf,**/*.yml,**/*.yaml,**/ext_localconf.php,**/ext_tables.php,**/TCA/**,**/*.php :redraw!
autocmd BufEnter,BufRead **/de.*.xlf :setlocal spelllang=de
augroup END

View file

@ -0,0 +1,6 @@
augroup vdebug
autocmd!
" Don't fold in debugger as he uses his own collapse feature.
autocmd BufEnter Debugger* setlocal foldlevel=99
augroup END

View file

@ -0,0 +1,30 @@
augroup reuterFolder
autocmd!
autocmd BufEnter **/emoto2/**/Unit/** execute "call ReuterSetupPhpUnitUnit()"
autocmd BufEnter **/emoto2/**/Functional/** execute "call ReuterSetupPhpUnitFunctional()"
autocmd BufEnter **/microservices/cms/**/*.js :setlocal tabstop=2 shiftwidth=2
augroup END
" As long as we use older phpunit which does not provider proper testdox output
function! ReuterSetupPhpUnitUnit()
let g:test#php#phpunit#options = {
\ 'file': '',
\ 'nearest': '',
\}
endfunction
function! ReuterSetupPhpUnitFunctional()
" TYPO3 v8
let g:test#php#phpunit#options = {
\ 'file': '-c phpunit.functional.xml.dist --stop-on-error --stop-on-failure',
\ 'nearest': '-c phpunit.functional.xml.dist',
\}
" TYPO3 v10
let g:test#php#phpunit#options = {
\ 'file': '--stop-on-error --stop-on-failure --testdox',
\ 'nearest': '--testdox',
\}
endfunction

View file

@ -0,0 +1,116 @@
" Function to test a specific URL.
" Will output the response + response headers for the given URL.
function! TestUrl(url)
execute ":!wget -q -O - --no-check-certificate --server-response '" . a:url . "'"
endfunction
" Copy the current file name to clipboard
function! CopyFileName()
execute ':let @+ = expand("%:t")'
endfunction
" Copy the current relative file path to clipboard
function! CopyRelativeFilePath()
execute ':let @+ = expand("%")'
endfunction
" Copy the current full file path to clipboard
function! CopyFullFilePath()
execute ':let @+ = expand("%:p")'
endfunction
" Remove trailing whitespace
function! StripTrailingWhitespace()
execute ':%s/\s\+$//e'
endfunction
function! RemoveEmptyLines()
execute ':g/^\s*$/d'
endfunction
function! ReplaceLineBreaks()
execute ':%s/ /\r/g'
endfunction
function! SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
function! StartDebugging()
call DebuggingConfiguration()
VdebugStart
endfunc
function! HiColors()
let num = 255
while num >= 0
exec 'hi col_'.num.' ctermbg='.num.' ctermfg=white'
exec 'syn match col_'.num.' "ctermbg='.num.':...." containedIn=ALL'
call append(0, 'ctermbg='.num.':....')
let num = num - 1
endwhile
endfunction
" Author: http://vimrcfu.com/snippet/116
function! Reg()
reg
echo "Register: "
let char = nr2char(getchar())
if char != "\<Esc>"
execute "normal! \"".char."p"
endif
redraw
endfunction
function! SortParagraph()
execute ":normal! vip:'<,'>sort\<esc>"
endfunction
" Generate .. _: anchor for headline. Cursor have to be on line with headline.
function! SphinxAnchor()
normal yyOPI.. _lguuA:V:s/ /-/g llr jj
endfunction
function! OpenUrl()
if !exists('b:url')
let b:commandToOpen = exists('b:commandToOpen') ? b:commandToOpen : 'open'
let b:domain = exists('b:domain') ? b:domain : 'http://phptraining.local'
let b:documentRoot = exists('b:documentRoot') ? b:documentRoot : getcwd()
let b:path = exists('b:path') ? b:path : expand("%:p")
let b:url = substitute(b:path, b:documentRoot, b:domain, "")
endif
silent! execute "!" . b:commandToOpen . " " . b:url
endfunction
nnoremap <leader>t :call OpenUrl()<cr>
function! ConvertToTestFilename()
let l:string = @r
let l:testName = system('php /home/daniels/Projects/company/emoto2/reuterTypo3/htdocs/test.php "' . l:string . '"')
execute(':normal i' . l:testName)
endfunction
function! OpenPHPUnitTestFilename()
let l:fileExtension = expand('%:e')
let l:filePath = expand('%:r:s?Classes?Tests/Unit?')
execute(':vsplit ' . l:filePath . 'Test.' . l:fileExtension)
execute(':normal ]]')
endfunction
function! StartProfiling()
execute(':profile start profile.log')
execute(':profile func *')
execute(':profile file *')
endfunc
command! -nargs=0 Reg call Reg()

View file

@ -0,0 +1,58 @@
" Switch vim to use fastes possible tool for grepping
" Use ack over grep
if executable('ack')
set grepprg=ack\ --nogroup\ --nocolor
command! -nargs=+ Ag execute 'silent grep! <args>' | copen | redraw!
endif
" Use ag over ack. The Silver Searcher
if executable('ag')
" Use ag over grep and ack
set grepprg=ag\ --vimgrep\ --ignore\ tags
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
" -U ignores .gitignore and such
" The command to use, can be used to build g:ctrlp_user_command dynamic,
" see configs/folderspecific/sphinx.vim
let g:dsiepmann_user_command = 'ag %s -l --nocolor -U -f -g ""'
" TODO: Improve auto ignore, e.g. on wildignore?
" See: :h variables
" See: :h :for
" Also show hidden files and folders
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --hidden"
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \".git\""
" Node
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"node_modules\""
" PHPUnit reports
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"report\""
" Codeception
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"_output\""
" TYPO3 doc render result
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"Documentation-GENERATED-temp\""
" TYPO3
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"typo3temp\""
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"/var\""
" TYPO3 - clients (emoto2_
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"typo3conf/ext/e2_*\""
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"typo3export\""
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"app/cache\""
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"compiledDocs\""
let g:dsiepmann_user_command = g:dsiepmann_user_command . " --ignore \"Data\""
let g:ctrlp_user_command = g:dsiepmann_user_command
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
" Disable "intelegent" working path mode, instead use vim one.
" This way you can search the whole project, even if you are inside a
" composer subpackage
let g:ctrlp_working_path_mode = ''
command! -nargs=+ Ag execute 'silent grep! <args>' | copen | redraw!
endif

View file

@ -0,0 +1,11 @@
set smartindent
set autoindent
" Tab control
set expandtab " insert spaces rather than tabs for <Tab>
set smarttab " tab respects 'tabstop', 'shiftwidth', and 'softtabstop'
set tabstop=4 " the visible width of tabs
set softtabstop=4 " edit as if the tabs are 4 characters wide
set shiftwidth=4 " number of spaces to use for indent and unindent
set shiftround " round indent to a multiple of 'shiftwidth'
" Show tabs as ">-
set list listchars=tab:>-,trail:.,extends:>

View file

@ -0,0 +1,41 @@
" Custom Mapping / Key bindings
let mapleader = ","
nnoremap H ^
nnoremap L $
" Toggle paste mode
nnoremap <leader>v :set paste!<cr>
" Stop highlighting of search results.
nnoremap <leader>nh :nohlsearch<cr>
" Configure navigation, e.g. go to buffer, file, ...
nnoremap <leader>p :CtrlP<cr>
nnoremap <leader>l :CtrlPBuffer<cr>
nnoremap <leader>r :CtrlPBufTag<cr>
nnoremap <leader>k :NERDTreeToggle<cr>
nnoremap <leader>f :NERDTreeFind<cr>
nnoremap <leader>b :TagbarToggle<cr>
nnoremap <leader>u :UndotreeToggle<cr>
nnoremap <leader>a :PhpactorContextMenu<cr>
nnoremap <leader>au :PhpactorImportClass<cr>
nnoremap <leader>ag :PhpactorGotoDefinition<cr>
nnoremap <leader>ah :PhpactorHover<cr>
nnoremap <silent> <leader>tn :TestNearest<cr>
nnoremap <silent> <leader>tl :TestLast<cr>
nnoremap <silent> <leader>tf :TestFile<cr>
nnoremap <leader>so :call SortParagraph()<cr>
nnoremap <silent> <leader>gtt :call OpenPHPUnitTestFilename()<cr>
" Terminal helpers
nnoremap <silent> <leader>e :TREPLSendLine<cr>
vnoremap <silent> <leader>e :TREPLSendSelection<cr>
nmap <leader>db :python3 debugger.run()<cr>
" Escape of terminal more esily.
tnoremap <Esc> <C-\><C-n>

View file

@ -0,0 +1,9 @@
" Show corresponding brackets
set showmatch
" Set incremental searching
set incsearch
" Highlight searching
set hlsearch
" Case insensitive search
set ignorecase
set smartcase

View file

@ -0,0 +1,34 @@
set statusline=%h%w "Show modi, help, preview.
set statusline+=\ %f "Show file name
set statusline+=%= "Switch to right side.
set statusline+=%m "Show modification of file
set statusline+=%r "Show readonly mode of file
if exists("SyntasticStatuslineFlag")
set statusline+=%{SyntasticStatuslineFlag()}
endif
function! LinterStatus() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf(
\ '[%dW %dE]',
\ all_non_errors,
\ all_errors
\)
endfunction
if exists("ale#statusline#Count")
set statusline+=%{LinterStatus()}
endif
set statusline+=%*
" Proceed with status line
set statusline+=%y "Show filetype
set statusline+=[%{&fileencoding?&fileencoding:&encoding}] " Show encoding
set statusline+=[%{&ff}] "Show lineendings
set statusline+=\ %c "Show current column.
set statusline+=,%4l "Show current line.
set statusline+=/%L "Show total line count.
set statusline+=\ %3p%% "Show percentage of file.

View file

@ -0,0 +1,5 @@
" Use undo file (Persist history through restart)
set undofile
" Directory to use for undo files
set undodir=~/.vimundo

View file

@ -0,0 +1,62 @@
" NOTE: Also keep grepping.vim in sync for CtrlP
" Ignore some files and folders
set wildignore+=tags.bak
" Version and other general unimportant files.
set wildignore+=*.rej
set wildignore+=*.orig
set wildignore+=*.resolve
set wildignore+=*.swp
" Docs
set wildignore+=*/compiledDocs*
" Python
set wildignore+=*.pyc
set wildignore+=*.egg*
set wildignore+=*/venv*
" Ruby on Rails
set wildignore+=*/tmp
" Node.js
set wildignore+=*/node_modules
set wildignore+=*/bower_components
" Python Projects
set wildignore+=*/venv
set wildignore+=*/__pycache__
" PHP Projects
set wildignore+=composer.lock
" PHP Codeception
set wildignore+=*/_output
" TYPO3 doc render result
set wildignore+=*/Documentation-GENERATED-temp
" Not possible in TYPO3 installations
" set wildignore+=Web
" set wildignore+=bin
set wildignore+=**/*.bat
" TYPO3
" set wildignore+=*/typo3
" set wildignore+=*/typo3_src
set wildignore+=*/_migrated
set wildignore+=*/_processed_
set wildignore+=*/_temp_
" set wildignore+=*/fileadmin
set wildignore+=*/fileadmin/images
set wildignore+=*/fileadmin/mediapool
set wildignore+=*/fileadmin/user_upload
set wildignore+=*/typo3conf/l10n
set wildignore+=*/typo3temp
set wildignore+=*/var
set wildignore+=*/uploads
" Symfony
set wildignore+=*/app/cache
set wildignore+=*__CG__*

View file

@ -0,0 +1,50 @@
set background=dark
set t_Co=256
colorscheme smyckblue
set timeoutlen=1000
set ttimeoutlen=1000
set nonumber
set cursorline
set foldcolumn=0
set foldmethod=indent
set foldlevelstart=1
set laststatus=2
" Don't jump to first line, e.g. on buffer switch
set nostartofline
" Extend completion using spelling if enabled for buffer.
set complete+=kspell
" Allow syntax highlighting and other file / language specific things
syntax enable
" Activate filetype detection and auto indent
filetype plugin indent on
" Show command in bottom of the screen
set showcmd
set showmode
" More useful command-line completion
set wildmenu
" Auto-completion menu
set wildmode=longest,list:full
" Adjust splitting
set splitbelow
set splitright
" Disable wrap of line
set nowrap
" Test line for wrapping: This should be a very long line with many characters and words so I can test whether this Line get's wrapped or not and how other settings like sidescroll are applied.
set sidescrolloff=5
" Show current line in middle of screen
set scrolloff=1000
" Custom highlighting
" Highlight whitespace at end of line as error
" match Error /\s\+$/
match Todo /TODO\|NOTE\|todo\|TASK/
match ERROR /♥/
" match ERROR /!.*!/

View file

@ -0,0 +1,29 @@
diff --git a/ftdetect/set_repl_cmd.vim b/ftdetect/set_repl_cmd.vim
index db6f819..08193ed 100644
--- a/ftdetect/set_repl_cmd.vim
+++ b/ftdetect/set_repl_cmd.vim
@@ -81,15 +81,15 @@ if has('nvim') || has('terminal')
\ elseif executable('ghci') |
\ call neoterm#repl#set('ghci') |
\ end
- au FileType php
- \ let s:argList = split(g:neoterm_repl_php) |
- \ if len(s:argList) > 0 && executable(s:argList[0]) |
- \ call neoterm#repl#set(g:neoterm_repl_php) |
- \ elseif executable('psysh') |
- \ call neoterm#repl#set('psysh') |
- \ elseif executable('php') |
- \ call neoterm#repl#set('php -a') |
- \ end
+ " au FileType php
+ " \ let s:argList = split(g:neoterm_repl_php) |
+ " \ if len(s:argList) > 0 && executable(s:argList[0]) |
+ " \ call neoterm#repl#set(g:neoterm_repl_php) |
+ " \ elseif executable('psysh') |
+ " \ call neoterm#repl#set('psysh') |
+ " \ elseif executable('php') |
+ " \ call neoterm#repl#set('php -a') |
+ " \ end
" Clojure
au FileType clojure
\ if executable('lein') |

View file

@ -0,0 +1,51 @@
let g:ale_set_quickfix = 0
let g:ale_set_loclist = 1
let g:ale_set_highlights = 1
let g:ale_set_signs = 1
let g:ale_echo_cursor = 1
let g:ale_virtualtext_cursor = 1
let g:ale_cursor_detail = 0
let g:ale_virtualtext_prefix = "! "
" Does not work with 3.0.0 and newer, due to:
" nvim/bundle/ale/autoload/ale/linter.vim
" for l:linter in reverse(l:possibly_duplicated_linters)
" if index(l:name_list, l:linter.name) < 0
" call add(l:name_list, l:linter.name)
" call add(l:combined_linters, l:linter)
" endif
" endfor
" let g:ale_pattern_options = {
" \ '\.tsconfig$': {
" \ 'ale_enabled': 0
" \ },
" \ '\.typoscript$': {
" \ 'ale_enabled': 0
" \ }
" \ }
function! DSConfigurePhpStan()
let g:ale_php_phpstan_executable = 'vendor/bin/phpstan'
endfunction
call DSConfigurePhpStan()
" Do not lint when open a file
let g:ale_lint_on_enter = 0
" Do not lint when chaning file type
let g:ale_lint_on_filetype_changed = 0
" Do not interrupt writing to much, wait longer for start linting.
let g:ale_lint_delay = 1000
" Turn auto linting while writing off
let g:ale_lint_on_text_changed = 'never'
" Configure signs to use
let g:ale_sign_error = '>'
let g:ale_sign_warning = '!'
" let g:ale_sign_info = '-'
" let g:ale_sign_style_error = '>'
" let g:ale_sign_style_warning = '!'
let g:ale_php_phpcs_standard = 'PSR12'
let g:ale_languagetool_executable = 'languagetool-commandline'

View file

@ -0,0 +1,20 @@
let g:ctrlp_follow_symlinks = 2
" Default to regex mode
let g:ctrlp_regexp = 1
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:10'
" let g:ctrlp_open_new_file = '0'
" let g:ctrlp_lazy_update = 1
let g:ctrlp_show_hidden = 1
" Configure completion for tags in buffer,
" e.g. configure which kinds to complete for css.
let g:ctrlp_buftag_types = {
\ 'css' : '--css-types=vcit',
\ 'typescript' : '--typescript-types=cnfvmitesod',
\ 'xml' : '--xml-types=ci',
\ 'rst' : '--reStructuredText-types=csSt',
\ 'markdown' : '--Markdown-types=csStT',
\ 'fluid' : '--xml-types=si',
\ 'apache' : '--apache-types=s',
\ 'yaml' : '--yaml-types=t',
\ }

View file

@ -0,0 +1,12 @@
let g:neoterm_default_mod = 'botright'
" Source: https://github.com/kassio/neoterm/issues/81
" Allow rerun of last terminal command.
let g:my_last_t_command = ''
function! MyT(args)
let g:my_last_t_command = a:args
silent call neoterm#do(g:my_last_t_command)
endfunction
command! -bar -complete=shellcmd -nargs=+ T silent call MyT(<q-args>)
command! -bar ReT silent call MyT(g:my_last_t_command)

View file

@ -0,0 +1,14 @@
" Set cwd to NERDTree root
let g:NERDTreeChDirMode = 2
" Keep current line centered
let g:NERDTreeAutoCenterThreshold = 1000
" Remove disturbing elements
let g:NERDTreeMinimalUI = 1
" Hide ignored files
let g:NERDTreeRespectWildIgnore = 1
" Don't draw fancy arrows (5.0.0)
let g:NERDTreeDirArrows = 0
" Don't draw fancy arrows (6.x)
let g:NERDTreeDirArrowCollapsible = "~"
let g:NERDTreeDirArrowExpandable = "+"

View file

@ -0,0 +1,16 @@
" match Function /\s__.*(/
let php_sql_query=0
let php_sql_heredoc=0
let php_sql_nowdoc=0
let php_xml_heredoc=0
let php_xml_nowdoc=0
let php_html_in_strings=0
let php_html_in_heredoc=0
let php_html_in_nowdoc=0
let php_html_load=0
let php_ignore_phpdoc=0
let php_parent_error_close=1
let php_parent_error_open=1
let g:PHP_IndentFunctionCallParameters = 0
let g:PHP_IndentFunctionDeclarationParameters = 0

View file

@ -0,0 +1,38 @@
" Configure when to check
let g:syntastic_check_on_open = 0
" let g:syntastic_check_on_wq = 0
" Configure how to check
let g:syntastic_aggregate_errors = 1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_enable_signs = 1
let g:syntastic_stl_format = "[E:%F %t]"
" Checkers
let g:syntastic_mode_map={ 'mode': 'active' }
let g:syntastic_filetype_map = { 'json': 'javascript' }
let g:syntastic_javascript_checkers = ["jshint"]
let g:syntastic_typoscript_checkers = ["lint"]
let g:syntastic_yaml_checkers = ["yamllint"]
let g:syntastic_json_checkers = ["jshint"]
let g:syntastic_python_checkers = ["python","pep8"]
let g:syntastic_php_checkers = ["php", "phpcs", "phpstan", "phpmd"]
" Temporarily disable xmllint, as it is really slow
" let g:syntastic_xml_checkers = []
" let g:syntastic_yaml_yamllint_exec = 'python3 -m yamllint'
let g:syntastic_html_tidy_exec = 'tidy5'
let g:syntastic_php_phpstan_args = '--level=max'
let g:syntastic_php_phpcs_args = '--standard=PSR12'
let g:syntastic_php_phpmd_post_args='cleancode,codesize,controversial,design,naming,unusedcode'
" let g:syntastic_typoscript_lint_exec='~/Projects/opensource/typo3-typoscript-lint/typoscript-lint'
" let g:syntastic_typoscript_lint_post_args='-c ./tslint.yaml'
" let g:syntastic_yaml_yamllint_args = '-c ~/.dotfiles/yamllint.yaml'
" Activate debugging:
let g:syntastic_debug = 0

View file

@ -0,0 +1,123 @@
" Remove quick help etc.
let g:tagbar_compact = 1
let g:tagbar_iconchars = ['+', '-']
" Slows down rendering and is not that helpfull most of the time.
" let g:tagbar_autopreview = 1
let g:tagbar_type_php = {
\ 'ctagstype' : 'php',
\ 'sort' : 0,
\ 'kinds' : [
\ 'n:namespaces:1',
\ 'i:interfaces:1',
\ 't:traits:1',
\ 'c:classes:1',
\ 'd:constantDefinitions:1',
\ 'f:functions:0',
\ ]
\ }
" Show headlines within markdown files
let g:tagbar_type_markdown = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'c:chapters:0',
\ 's:sections:0',
\ 'S:level 2 Sections:0',
\ 't:level 3 Section:0',
\ 'T:level 4 Sections:0',
\ ],
\ 'sort' : 0,
\ }
let g:tagbar_type_fluid = {
\ 'ctagstype' : 'html',
\ 'kinds' : [
\ 's:sections:0',
\ 'i:ids:1',
\ ],
\ 'sort' : 0,
\ }
" Provided by yats bundle
let g:tagbar_type_typescript = {
\ 'ctagstype' : 'typescript',
\ 'kinds' : [
\ 'i:interfaces:0',
\ 'e:enums:0',
\ 'c:classes:0',
\ 'm:members:0',
\ 'f:functions:0',
\ 'v:variables:0',
\ 'd:describe:0',
\ 's:test:0',
\ 'o:test todo:0',
\ ],
\ 'sort' : 0,
\ }
let g:tagbar_type_apache = {
\ 'ctagstype' : 'apache',
\ 'kinds' : [
\ 's:servers:0',
\ ],
\ 'sort' : 0,
\ }
" Configure xliff translation files
let g:tagbar_type_xml = {
\ 'ctagstype' : 'xml',
\ 'kinds' : [
\ 'c:comments:0',
\ 'i:ids:1',
\ ],
\ 'sort' : 0,
\ }
" " Show outline of rst files
" let g:tagbar_type_rst = {
" \ 'ctagstype': 'rst',
" \ 'ctagsbin' : '~/.dotfiles/bin/rst2ctags/rst2ctags.py',
" \ 'ctagsargs' : '-f - --sort=yes',
" \ 'kinds' : [
" \ 's:sections',
" \ 'i:images'
" \ ],
" \ 'sro' : '|',
" \ 'kind2scope' : {
" \ 's' : 'section',
" \ },
" \ 'sort': 0,
" \ }
" SOURCE: https://github.com/mtscout6/vim-tagbar-css/blob/master/plugin/tagbar-css.vim
let g:tagbar_type_css = {
\ 'ctagstype' : 'css',
\ 'kinds' : [
\ 'v:variables',
\ 'c:classes',
\ 'i:IDs',
\ 't:tags',
\ 'm:medias',
\ 'k:comments',
\ ]
\}
" E.g. gitlab yaml
let g:tagbar_type_yaml = {
\ 'ctagstype': 'yaml',
\ 'kinds' : [
\'t:toplevel',
\]
\}
let g:tagbar_type_go = {
\ 'ctagstype': 'go',
\ 'kinds' : [
\'p:package',
\'f:function',
\'v:variables',
\'t:type',
\'c:const'
\]
\}

View file

@ -0,0 +1,23 @@
let g:test#strategy = 'neoterm'
" configure additional options per test kind.
" e.g. add --debug for nearest to get additional information during
" development of the test.
let g:test#php#codeception#options = {
\ 'nearest': '--env local --html --debug',
\ 'file': '--env local --html --debug',
\}
let g:test#php#codeception#options = {
\ 'nearest': '--env production --debug',
\ 'file': '--env production --debug',
\}
let g:test#php#phpunit#options = {
\ 'nearest': '--testdox',
\ 'file': '--testdox',
\}
if !exists('g:test#php#codeception#suite')
let g:test#php#codeception#suite = 'acceptance'
endif

View file

@ -0,0 +1,4 @@
let g:undotree_WindowLayout = 3
let g:undotree_DiffpanelHeight = 10
let g:undotree_SetFocusWhenToggle = 1
let g:undotree_HighlightChangedText = 0

View file

@ -0,0 +1,31 @@
if !exists('g:vdebug_options')
let g:vdebug_options = {}
endif
" Connection infos
" Wait 1 minute for connection
let g:vdebug_options.timeout = 60
let g:vdebug_options.continuous_mode = 1
let g:vdebug_options.ide_key = "vim"
let g:vdebug_options.server = "127.0.0.1"
let g:vdebug_options.port = 9000
" Plugin options
let g:vdebug_options.break_on_open = 0
let g:vdebug_options.watch_window_style = "compact"
" Do not use fancy icons
let g:vdebug_options.marker_default = '*'
let g:vdebug_options.marker_closed_tree = '+'
let g:vdebug_options.marker_open_tree = '-'
" As I don't like to switch FN
let g:vdebug_keymap = {
\ "run" : "<Leader>5",
\ "step_over" : "<Leader>2",
\ "step_into" : "<Leader>3",
\ "step_out" : "<Leader>4",
\ "close" : "<Leader>6",
\ "eval_visual" : "",
\}
" https://github.com/vim-vdebug/vdebug/issues/369
" let g:vdebug_features = {'extended_properties': 1}

View file

@ -85,8 +85,6 @@ List of manual needed changes for various reasons.
Todos
-----
* Migrate neovim
* Migrate ssh config (I don't really like to expose customer server names and configs to outer world, how to handle?)
* Migrate PGP?