diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index e69de29..a6b0a1c 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -0,0 +1,155 @@ +"-------------------------------------------------------------------------- +" General settings +"-------------------------------------------------------------------------- + +set expandtab +set shiftwidth=4 +set tabstop=4 +set hidden +set signcolumn=yes:2 +set relativenumber +set number +set termguicolors +set undofile +set spell +set title +set ignorecase +set smartcase +set wildmode=longest:full,full +set nowrap +set list +set mouse=a +set scrolloff=8 +set sidescrolloff=8 +set nojoinspaces +set splitright +set clipboard=unnamedplus +set confirm +set exrc +set backup +set backupdir=~/.local/share/nvim/backup// +set updatetime=300 " Reduce time for highlighting other references +set redrawtime=10000 " Allow more time for loading syntax on large files +set cc=80 +set cursorline + +"-------------------------------------------------------------------------- +" Key maps +"-------------------------------------------------------------------------- + +let mapleader = "\" + +nmap ve :edit ~/.config/nvim/init.vim +nmap vc :edit ~/.config/nvim/coc-settings.json +nmap vr :source ~/.config/nvim/init.vim + +nmap k :nohlsearch +nmap Q :bufdo bdelete + +" Allow gf to open non-existent files +map gf :edit + +" Reselect visual selection after indenting +vnoremap < >gv + +" Maintain the cursor position when yanking a visual selection +" http://ddrscott.github.io/blog/2016/yank-without-jank/ +vnoremap y myy`y +vnoremap Y myY`y + +" When text is wrapped, move by terminal rows, not lines, unless a count is provided +noremap j (v:count == 0 ? 'gj' : 'j') +noremap k (v:count == 0 ? 'gk' : 'k') + +" Paste replace visual selection without copying it +vnoremap p "_dP + +" Make Y behave like the other capitals +nnoremap Y y$ + +" Keep it centered +nnoremap n nzzzv +nnoremap N Nzzzv +nnoremap J mzJ`z + +" Open the current file in the default program +nmap x :!xdg-open % + +" Quicky escape to normal mode +imap jj + +" Easy insertion of a trailing ; or , from insert mode +imap ;; A; +imap ,, A, + +cmap w!! %!sudo tee > /dev/null % + +"-------------------------------------------------------------------------- +" Plugins +"-------------------------------------------------------------------------- + +" Automatically install vim-plug +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +call plug#begin(data_dir . '/plugins') + +" source ~/.config/nvim/plugins/abolish.vim +source ~/.config/nvim/plugins/airline.vim +source ~/.config/nvim/plugins/arduino.vim +source ~/.config/nvim/plugins/coc.vim +source ~/.config/nvim/plugins/commentary.vim +source ~/.config/nvim/plugins/context-commentstring.vim +source ~/.config/nvim/plugins/dispatch.vim +source ~/.config/nvim/plugins/dracula.vim +source ~/.config/nvim/plugins/editorconfig.vim +source ~/.config/nvim/plugins/eunuch.vim +source ~/.config/nvim/plugins/exchange.vim +source ~/.config/nvim/plugins/firenvim.vim +source ~/.config/nvim/plugins/floaterm.vim +source ~/.config/nvim/plugins/fugitive.vim +source ~/.config/nvim/plugins/fzf.vim +source ~/.config/nvim/plugins/heritage.vim +source ~/.config/nvim/plugins/lastplace.vim +source ~/.config/nvim/plugins/lion.vim +source ~/.config/nvim/plugins/markdown-preview.vim +source ~/.config/nvim/plugins/nerdtree.vim +source ~/.config/nvim/plugins/pasta.vim +source ~/.config/nvim/plugins/peekaboo.vim +source ~/.config/nvim/plugins/phpactor.vim +source ~/.config/nvim/plugins/polyglot.vim +source ~/.config/nvim/plugins/projectionist.vim +source ~/.config/nvim/plugins/quickscope.vim +source ~/.config/nvim/plugins/repeat.vim +source ~/.config/nvim/plugins/rooter.vim +source ~/.config/nvim/plugins/sayonara.vim +source ~/.config/nvim/plugins/sensible.vim +source ~/.config/nvim/plugins/smooth-scroll.vim +source ~/.config/nvim/plugins/splitjoin.vim +source ~/.config/nvim/plugins/surround.vim +source ~/.config/nvim/plugins/targets.vim +source ~/.config/nvim/plugins/textobj-xmlattr.vim +source ~/.config/nvim/plugins/tmux-navigator.vim +source ~/.config/nvim/plugins/unimpaired.vim +source ~/.config/nvim/plugins/vim-test.vim +source ~/.config/nvim/plugins/visual-multi.vim +source ~/.config/nvim/plugins/visual-star-search.vim +source ~/.config/nvim/plugins/which-key.vim + +call plug#end() +doautocmd User PlugLoaded + +"-------------------------------------------------------------------------- +" Miscellaneous +"-------------------------------------------------------------------------- + +augroup FileTypeOverrides + autocmd! + " Use '//' instead of '/* */' comments + autocmd FileType php setlocal commentstring=//%s + autocmd TermOpen * setlocal nospell +augroup END diff --git a/.config/nvim/plugins/airline.vim b/.config/nvim/plugins/airline.vim new file mode 100644 index 0000000..8549456 --- /dev/null +++ b/.config/nvim/plugins/airline.vim @@ -0,0 +1,15 @@ +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' + +let g:airline_theme = 'dracula' +let g:airline_powerline_fonts = 1 +let g:airline_skip_empty_sections = 1 + +let g:airline_left_sep = '' +let g:airline_right_sep = '' + +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#left_sep = ' ' +let g:airline#extensions#tabline#left_alt_sep = ' ' + +set noshowmode diff --git a/.config/nvim/plugins/arduino.vim b/.config/nvim/plugins/arduino.vim new file mode 100644 index 0000000..cab60df --- /dev/null +++ b/.config/nvim/plugins/arduino.vim @@ -0,0 +1,5 @@ +Plug 'stevearc/vim-arduino' + +" let g:arduino_dir = '/usr/share/arduino/hardware/arduino/avr' +" let g:arduino_home_dir = $HOME . '.arduino15' +let g:arduino_serial_cmd = 'picocom {port} -b {baud} -l' diff --git a/.config/nvim/plugins/coc-settings.json b/.config/nvim/plugins/coc-settings.json new file mode 100644 index 0000000..c50c7af --- /dev/null +++ b/.config/nvim/plugins/coc-settings.json @@ -0,0 +1,33 @@ +{ + "coc.preferences.extensionUpdateCheck": "daily", + "coc.preferences.formatOnType": true, + "diagnostic.checkCurrentLine": true, + "diagnostic.virtualText": true, + "diagnostic.enableMessage": "jump", + "diagnostic.errorSign": "✖", + "diagnostic.warningSign": "⚠", + "diagnostic.infoSign": "•", + "diagnostic.hintSign": "•", + "diagnostic-languageserver.filetypes": { + "php": ["phpstan", "phpcs"] + }, + "diagnostic-languageserver.mergeConfig": true, + "diagnostic-languageserver.linters": { + "phpcs": { + "args": [ "--standard=PSR12", "--exclude=Generic.Files.LineLength.TooLong", "--report=emacs", "-s", "-" ] + } + }, + "git.enableGutters": true, + "git.addedSign.text": "┃", + "git.changedSign.text": "┃", + "git.removedSign.text": "▁", + "git.topRemovedSign.text": "▔", + "git.changeRemovedSign.text": "▔", + "phpls.path": "/usr/local/bin/intelephense", + "php-cs-fixer.config": ".php-cs-fixer.dist.php", + "php-cs-fixer.enableFormatProvider": true, + "intelephense.environment.phpVersion": "8", + "tailwindCSS.validate": true, + "tailwindCSS.emmetCompletions": true, + "prettier.requireConfig": true +} diff --git a/.config/nvim/plugins/coc.vim b/.config/nvim/plugins/coc.vim new file mode 100644 index 0000000..1668df2 --- /dev/null +++ b/.config/nvim/plugins/coc.vim @@ -0,0 +1,135 @@ +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'antoinemadec/coc-fzf' + +let g:coc_global_extensions = [ + \ 'coc-cmake', + \ 'coc-clangd', + \ 'coc-css', + \ 'coc-cssmodules', + \ 'coc-diagnostic', + \ 'coc-emmet', + \ 'coc-eslint', + \ 'coc-git', + \ 'coc-go', + \ 'coc-html', + \ 'coc-htmldjango', + \ 'coc-json', + \ 'coc-ltex', + \ 'coc-markdownlint', + \ 'coc-pairs', + \ 'coc-prettier', + \ 'coc-pydocstring', + \ 'coc-python', + \ 'coc-sh', + \ 'coc-snippets', + \ 'coc-sql', + \ 'coc-svg', + \ 'coc-swagger', + \ 'coc-texlab', + \ 'coc-thrift-syntax-support', + \ 'coc-toml', + \ 'coc-tsserver', + \ 'coc-yaml', + \ '@yaegassy/coc-ansible', +\ ] + +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" " Use to trigger completion. +" if has('nvim') +" inoremap coc#refresh() +" else +" inoremap coc#refresh() +" endif + +" Make auto-select the first completion item and notify coc.nvim to +" format on enter, could be remapped by other vim plugin +inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + +" Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) +nmap d (coc-diagnostic-info) + +" GoTo code navigation. +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +nmap ]h (coc-git-nextchunk) +nmap [h (coc-git-prevchunk) + +" apply autofix to problem on the current line. +nmap af (coc-fix-current) +nmap am (coc-format-selected) +xmap am (coc-format-selected) +nmap ac (coc-codeaction) +" Applying codeAction to the selected region. +" Example: `aap` for current paragraph +xmap a (coc-codeaction-selected) +nmap a (coc-codeaction-selected) +nmap ga (coc-codeaction-line) + +" Map function and class text objects +" NOTE: Requires 'textDocument.documentSymbol' support from the language server. +xmap if (coc-funcobj-i) +omap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap af (coc-funcobj-a) +xmap ic (coc-classobj-i) +omap ic (coc-classobj-i) +xmap ac (coc-classobj-a) +omap ac (coc-classobj-a) + +" Use K to show documentation in preview window. +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif +endfunction + +" Highlight the symbol and its references when holding the cursor. +autocmd CursorHold * silent call CocActionAsync('highlight') + +" Symbol renaming. +nmap rn (coc-rename) + +" Remap and for scroll float windows/popups. +nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" +inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + +" Add `:Format` command to format current buffer. +command! -nargs=0 Format :call CocAction('format') + +" Add `:Fold` command to fold current buffer. +command! -nargs=? Fold :call CocAction('fold', ) + +" Add `:OR` command for organize imports of the current buffer. +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + +nmap l :CocFzfList diff --git a/.config/nvim/plugins/commentary.vim b/.config/nvim/plugins/commentary.vim new file mode 100644 index 0000000..8c9a7a1 --- /dev/null +++ b/.config/nvim/plugins/commentary.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-commentary' diff --git a/.config/nvim/plugins/context-commentstring.vim b/.config/nvim/plugins/context-commentstring.vim new file mode 100644 index 0000000..f9a67ed --- /dev/null +++ b/.config/nvim/plugins/context-commentstring.vim @@ -0,0 +1 @@ +Plug 'jessarcher/vim-context-commentstring' diff --git a/.config/nvim/plugins/dispatch.vim b/.config/nvim/plugins/dispatch.vim new file mode 100644 index 0000000..ce4a797 --- /dev/null +++ b/.config/nvim/plugins/dispatch.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-dispatch' diff --git a/.config/nvim/plugins/dracula.vim b/.config/nvim/plugins/dracula.vim new file mode 100644 index 0000000..32d3f8e --- /dev/null +++ b/.config/nvim/plugins/dracula.vim @@ -0,0 +1,9 @@ +Plug 'dracula/vim', { 'as': 'dracula' } + +augroup DraculaOverrides + autocmd! + autocmd ColorScheme dracula highlight DraculaBoundary guibg=none + autocmd ColorScheme dracula highlight DraculaDiffDelete ctermbg=none guibg=none + autocmd ColorScheme dracula highlight DraculaComment cterm=italic gui=italic + autocmd User PlugLoaded ++nested colorscheme dracula +augroup end diff --git a/.config/nvim/plugins/editorconfig.vim b/.config/nvim/plugins/editorconfig.vim new file mode 100644 index 0000000..29e216b --- /dev/null +++ b/.config/nvim/plugins/editorconfig.vim @@ -0,0 +1,3 @@ +Plug 'editorconfig/editorconfig-vim' + +let g:EditorConfig_exclude_patterns = ['fugitive://.*'] diff --git a/.config/nvim/plugins/eunuch.vim b/.config/nvim/plugins/eunuch.vim new file mode 100644 index 0000000..d0f9912 --- /dev/null +++ b/.config/nvim/plugins/eunuch.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-eunuch' diff --git a/.config/nvim/plugins/exchange.vim b/.config/nvim/plugins/exchange.vim new file mode 100644 index 0000000..1b760b2 --- /dev/null +++ b/.config/nvim/plugins/exchange.vim @@ -0,0 +1 @@ +Plug 'tommcdo/vim-exchange' diff --git a/.config/nvim/plugins/firenvim.vim b/.config/nvim/plugins/firenvim.vim new file mode 100644 index 0000000..615be4b --- /dev/null +++ b/.config/nvim/plugins/firenvim.vim @@ -0,0 +1,24 @@ +Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } + +let g:firenvim_config = { + \ 'globalSettings': { + \ 'alt': 'all', + \ }, + \ 'localSettings': { + \ '.*': { + \ 'cmdline': 'neovim', + \ 'content': 'text', + \ 'priority': 0, + \ 'selector': 'textarea', + \ 'takeover': 'never', + \ }, + \ } +\ } + +let fc = g:firenvim_config['localSettings'] +let fc['https?://github\.com'] = { 'takeover': 'always', 'priority': 1 } + +augroup FirenvimOverrides + autocmd! + autocmd BufEnter github.com_*.txt set filetype=markdown +augroup END diff --git a/.config/nvim/plugins/floaterm.vim b/.config/nvim/plugins/floaterm.vim new file mode 100644 index 0000000..b1c56e5 --- /dev/null +++ b/.config/nvim/plugins/floaterm.vim @@ -0,0 +1,18 @@ +Plug 'voldikss/vim-floaterm' + +let g:floaterm_keymap_toggle = '' +let g:floaterm_keymap_next = '' +let g:floaterm_keymap_prev = '' +let g:floaterm_keymap_new = '' + +let g:floaterm_gitcommit='floaterm' +let g:floaterm_autoinsert=1 +let g:floaterm_width=0.8 +let g:floaterm_height=0.8 +let g:floaterm_wintitle=0 +let g:floaterm_autoclose=1 + +augroup FloatermCustomisations + autocmd! + autocmd ColorScheme * highlight FloatermBorder guibg=none +augroup END diff --git a/.config/nvim/plugins/fugitive.vim b/.config/nvim/plugins/fugitive.vim new file mode 100644 index 0000000..58e784a --- /dev/null +++ b/.config/nvim/plugins/fugitive.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-fugitive' | Plug 'tpope/vim-rhubarb' diff --git a/.config/nvim/plugins/fzf.vim b/.config/nvim/plugins/fzf.vim new file mode 100644 index 0000000..1839a2d --- /dev/null +++ b/.config/nvim/plugins/fzf.vim @@ -0,0 +1,22 @@ +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +Plug 'stsewd/fzf-checkout.vim' + +let g:fzf_layout = { 'up': '~90%', 'window': { 'width': 0.8, 'height': 0.8, 'yoffset':0.5, 'xoffset': 0.5 } } +let $FZF_DEFAULT_OPTS = '--layout=reverse --info=inline' + +" Customise the Files command to use rg which respects .gitignore files +command! -bang -nargs=? -complete=dir Files + \ call fzf#run(fzf#wrap('files', fzf#vim#with_preview({ 'dir': , 'sink': 'e', 'source': 'rg --files --hidden' }), 0)) + +" Add an AllFiles variation that ignores .gitignore files +command! -bang -nargs=? -complete=dir AllFiles + \ call fzf#run(fzf#wrap('allfiles', fzf#vim#with_preview({ 'dir': , 'sink': 'e', 'source': 'rg --files --hidden --no-ignore' }), 0)) + +nmap f :Files +nmap F :AllFiles +nmap b :Buffers +nmap h :History +nmap r :Rg +nmap R :Rg +nmap gb :GBranches diff --git a/.config/nvim/plugins/heritage.vim b/.config/nvim/plugins/heritage.vim new file mode 100644 index 0000000..90387cf --- /dev/null +++ b/.config/nvim/plugins/heritage.vim @@ -0,0 +1 @@ +Plug 'jessarcher/vim-heritage' diff --git a/.config/nvim/plugins/lastplace.vim b/.config/nvim/plugins/lastplace.vim new file mode 100644 index 0000000..2e55029 --- /dev/null +++ b/.config/nvim/plugins/lastplace.vim @@ -0,0 +1 @@ +Plug 'farmergreg/vim-lastplace' diff --git a/.config/nvim/plugins/lion.vim b/.config/nvim/plugins/lion.vim new file mode 100644 index 0000000..7af2471 --- /dev/null +++ b/.config/nvim/plugins/lion.vim @@ -0,0 +1,3 @@ +Plug 'tommcdo/vim-lion' + +let g:lion_squeeze_spaces = 1 " Remove as many spaces as possible when aligning diff --git a/.config/nvim/plugins/markdown-preview.vim b/.config/nvim/plugins/markdown-preview.vim new file mode 100644 index 0000000..e14c485 --- /dev/null +++ b/.config/nvim/plugins/markdown-preview.vim @@ -0,0 +1 @@ +Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} diff --git a/.config/nvim/plugins/nerdtree.vim b/.config/nvim/plugins/nerdtree.vim new file mode 100644 index 0000000..08fe8af --- /dev/null +++ b/.config/nvim/plugins/nerdtree.vim @@ -0,0 +1,23 @@ +Plug 'preservim/nerdtree' +Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'ryanoasis/vim-devicons' +Plug 'tiagofumo/vim-nerdtree-syntax-highlight' + +let NERDTreeShowHidden=1 +let NERDTreeMinimalUI=1 + +let g:NERDTreeDirArrowExpandable = '▹' +let g:NERDTreeDirArrowCollapsible = '▿' + +nnoremap n g:NERDTree.IsOpen() ? ':NERDTreeClose' : @% == '' ? ':NERDTree' : ':NERDTreeFind' +nmap N :NERDTreeFind + +" If more than one window and previous buffer was NERDTree, go back to it. +autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif + +" avoid crashes when calling vim-plug functions while the cursor is on the NERDTree window +let g:plug_window = 'noautocmd vertical topleft new' + +let g:WebDevIconsUnicodeDecorateFolderNodes = 1 +let g:DevIconsEnableFoldersOpenClose = 1 +let g:DevIconsEnableFolderExtensionPatternMatching = 1 diff --git a/.config/nvim/plugins/pasta.vim b/.config/nvim/plugins/pasta.vim new file mode 100644 index 0000000..f495405 --- /dev/null +++ b/.config/nvim/plugins/pasta.vim @@ -0,0 +1,3 @@ +Plug 'sickill/vim-pasta' + +let g:pasta_disabled_filetypes = ['fugitive'] diff --git a/.config/nvim/plugins/peekaboo.vim b/.config/nvim/plugins/peekaboo.vim new file mode 100644 index 0000000..28d4306 --- /dev/null +++ b/.config/nvim/plugins/peekaboo.vim @@ -0,0 +1 @@ +Plug 'junegunn/vim-peekaboo' diff --git a/.config/nvim/plugins/phpactor.vim b/.config/nvim/plugins/phpactor.vim new file mode 100644 index 0000000..bed1aaa --- /dev/null +++ b/.config/nvim/plugins/phpactor.vim @@ -0,0 +1,6 @@ +Plug 'phpactor/phpactor', {'for': 'php', 'branch': 'master', 'do': 'composer install --no-dev -o'} + +augroup PhpactorMappings + au! + au FileType php nmap mm :PhpactorContextMenu +augroup END diff --git a/.config/nvim/plugins/polyglot.vim b/.config/nvim/plugins/polyglot.vim new file mode 100644 index 0000000..4864b4d --- /dev/null +++ b/.config/nvim/plugins/polyglot.vim @@ -0,0 +1,6 @@ +let g:polyglot_disabled = ['arduino'] + +Plug 'sheerun/vim-polyglot' + +let g:PHP_noArrowMatching = 1 +let g:vim_markdown_new_list_item_indent = 0 diff --git a/.config/nvim/plugins/projectionist.vim b/.config/nvim/plugins/projectionist.vim new file mode 100644 index 0000000..8ac978a --- /dev/null +++ b/.config/nvim/plugins/projectionist.vim @@ -0,0 +1,42 @@ +Plug 'tpope/vim-projectionist' + +let g:projectionist_heuristics = { + \ "artisan": { + \ "*": { + \ "start": "sail up", + \ "console": "sail tinker", + \ }, + \ "app/*Controller.php": { + \ "type": "source", + \ "alternate": "tests/Feature/{}ControllerTest.php", + \ }, + \ "app/**/Models/*.php": { + \ "type": "source", + \ "alternate": [ + \ "tests/Unit/{dirname}/Models/{basename}Test.php", + \ "tests/Unit/{dirname}/{basename}Test.php", + \ ], + \ }, + \ "app/**/Listeners/*.php": { + \ "type": "source", + \ "alternate": "tests/Unit/{dirname}/Listeners/{basename}Test.php", + \ }, + \ "app/*.php": { + \ "type": "source", + \ "alternate": [ + \ "tests/Unit/{}Test.php", + \ "tests/Feature/{}Test.php", + \ ] + \ }, + \ "tests/Feature/*Test.php": { + \ "type": "test", + \ "alternate": "app/{}.php", + \ }, + \ "tests/Unit/*Test.php": { + \ "type": "test", + \ "alternate": [ + \ "app/{}.php", + \ "app/Models/{}.php", + \ ], + \ }, + \ }} diff --git a/.config/nvim/plugins/quickscope.vim b/.config/nvim/plugins/quickscope.vim new file mode 100644 index 0000000..96a2766 --- /dev/null +++ b/.config/nvim/plugins/quickscope.vim @@ -0,0 +1,4 @@ +Plug 'unblevable/quick-scope' + +let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] +let g:qs_max_chars=150 diff --git a/.config/nvim/plugins/repeat.vim b/.config/nvim/plugins/repeat.vim new file mode 100644 index 0000000..7407b74 --- /dev/null +++ b/.config/nvim/plugins/repeat.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-repeat' diff --git a/.config/nvim/plugins/rooter.vim b/.config/nvim/plugins/rooter.vim new file mode 100644 index 0000000..7aa1279 --- /dev/null +++ b/.config/nvim/plugins/rooter.vim @@ -0,0 +1 @@ +Plug 'airblade/vim-rooter' diff --git a/.config/nvim/plugins/sayonara.vim b/.config/nvim/plugins/sayonara.vim new file mode 100644 index 0000000..8d1324e --- /dev/null +++ b/.config/nvim/plugins/sayonara.vim @@ -0,0 +1,3 @@ +Plug 'jessarcher/vim-sayonara', { 'on': 'Sayonara' } + +nmap q :Sayonara! diff --git a/.config/nvim/plugins/sensible.vim b/.config/nvim/plugins/sensible.vim new file mode 100644 index 0000000..80b28d8 --- /dev/null +++ b/.config/nvim/plugins/sensible.vim @@ -0,0 +1,4 @@ +Plug 'tpope/vim-sensible' + +set listchars=tab:▸\ ,trail:· + diff --git a/.config/nvim/plugins/smooth-scroll.vim b/.config/nvim/plugins/smooth-scroll.vim new file mode 100644 index 0000000..0250a4e --- /dev/null +++ b/.config/nvim/plugins/smooth-scroll.vim @@ -0,0 +1,6 @@ +Plug 'terryma/vim-smooth-scroll' + +noremap :call smooth_scroll#up(&scroll, 0, 4) +noremap :call smooth_scroll#down(&scroll, 0, 4) +noremap :call smooth_scroll#up(&scroll*2, 0, 8) +noremap :call smooth_scroll#down(&scroll*2, 0, 8) diff --git a/.config/nvim/plugins/splitjoin.vim b/.config/nvim/plugins/splitjoin.vim new file mode 100644 index 0000000..0b22ff4 --- /dev/null +++ b/.config/nvim/plugins/splitjoin.vim @@ -0,0 +1,3 @@ +Plug 'AndrewRadev/splitjoin.vim' + +let g:splitjoin_html_attributes_bracket_on_new_line = 1 diff --git a/.config/nvim/plugins/surround.vim b/.config/nvim/plugins/surround.vim new file mode 100644 index 0000000..f64cebe --- /dev/null +++ b/.config/nvim/plugins/surround.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-surround' diff --git a/.config/nvim/plugins/targets.vim b/.config/nvim/plugins/targets.vim new file mode 100644 index 0000000..8620d7a --- /dev/null +++ b/.config/nvim/plugins/targets.vim @@ -0,0 +1 @@ +Plug 'wellle/targets.vim' diff --git a/.config/nvim/plugins/textobj-xmlattr.vim b/.config/nvim/plugins/textobj-xmlattr.vim new file mode 100644 index 0000000..674726f --- /dev/null +++ b/.config/nvim/plugins/textobj-xmlattr.vim @@ -0,0 +1 @@ +Plug 'kana/vim-textobj-user' | Plug 'whatyouhide/vim-textobj-xmlattr' diff --git a/.config/nvim/plugins/tmux-navigator.vim b/.config/nvim/plugins/tmux-navigator.vim new file mode 100644 index 0000000..cea33cf --- /dev/null +++ b/.config/nvim/plugins/tmux-navigator.vim @@ -0,0 +1 @@ +Plug 'christoomey/vim-tmux-navigator' diff --git a/.config/nvim/plugins/unimpaired.vim b/.config/nvim/plugins/unimpaired.vim new file mode 100644 index 0000000..f3fd08f --- /dev/null +++ b/.config/nvim/plugins/unimpaired.vim @@ -0,0 +1 @@ +Plug 'tpope/vim-unimpaired' diff --git a/.config/nvim/plugins/vim-test.vim b/.config/nvim/plugins/vim-test.vim new file mode 100644 index 0000000..2e1b96c --- /dev/null +++ b/.config/nvim/plugins/vim-test.vim @@ -0,0 +1,15 @@ +Plug 'vim-test/vim-test' + +let test#php#phpunit#executable = 'deliver vendor/bin/phpunit' + +nmap tn :TestNearest +nmap tf :TestFile +nmap ts :TestSuite +nmap tl :TestLast +nmap tv :TestVisit + +augroup AutoDeleteTestTermBuffers + autocmd! + autocmd BufLeave term://*artisan\stest* bdelete! + autocmd BufLeave term://*phpunit* bdelete! +augroup END diff --git a/.config/nvim/plugins/visual-multi.vim b/.config/nvim/plugins/visual-multi.vim new file mode 100644 index 0000000..961304e --- /dev/null +++ b/.config/nvim/plugins/visual-multi.vim @@ -0,0 +1 @@ +Plug 'mg979/vim-visual-multi', {'branch': 'master'} diff --git a/.config/nvim/plugins/visual-star-search.vim b/.config/nvim/plugins/visual-star-search.vim new file mode 100644 index 0000000..16a461f --- /dev/null +++ b/.config/nvim/plugins/visual-star-search.vim @@ -0,0 +1 @@ +Plug 'nelstrom/vim-visual-star-search' diff --git a/.config/nvim/plugins/which-key.vim b/.config/nvim/plugins/which-key.vim new file mode 100644 index 0000000..796d53a --- /dev/null +++ b/.config/nvim/plugins/which-key.vim @@ -0,0 +1,12 @@ +Plug 'folke/which-key.nvim' + +function WhichKeySetup() +lua << EOF +require("which-key").setup {} +EOF +endfunction + +augroup WhichKeySetup + autocmd! + autocmd User PlugLoaded call WhichKeySetup() +augroup END