Add neo-vim configuration

This commit is contained in:
Anthony Oteri
2022-02-04 08:28:07 -05:00
parent 862b793a0b
commit f9ca22de6f
42 changed files with 568 additions and 0 deletions
+15
View File
@@ -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
+5
View File
@@ -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'
+33
View File
@@ -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
}
+135
View File
@@ -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 <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" " Use <c-space> to trigger completion.
" if has('nvim')
" inoremap <silent><expr> <c-tab> coc#refresh()
" else
" inoremap <silent><expr> <c-@> coc#refresh()
" endif
" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
nmap <silent> <leader>d <Plug>(coc-diagnostic-info)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
nmap <silent> ]h <Plug>(coc-git-nextchunk)
nmap <silent> [h <Plug>(coc-git-prevchunk)
" apply autofix to problem on the current line.
nmap <leader>af <plug>(coc-fix-current)
nmap <leader>am <plug>(coc-format-selected)
xmap <leader>am <plug>(coc-format-selected)
nmap <leader>ac <Plug>(coc-codeaction)
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>ga <Plug>(coc-codeaction-line)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Remap <C-f> and <C-b> for scroll float windows/popups.
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
" 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', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
nmap <leader>l :CocFzfList<cr>
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-commentary'
@@ -0,0 +1 @@
Plug 'jessarcher/vim-context-commentstring'
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-dispatch'
+9
View File
@@ -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
+3
View File
@@ -0,0 +1,3 @@
Plug 'editorconfig/editorconfig-vim'
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-eunuch'
+1
View File
@@ -0,0 +1 @@
Plug 'tommcdo/vim-exchange'
+24
View File
@@ -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
+18
View File
@@ -0,0 +1,18 @@
Plug 'voldikss/vim-floaterm'
let g:floaterm_keymap_toggle = '<F1>'
let g:floaterm_keymap_next = '<F2>'
let g:floaterm_keymap_prev = '<F3>'
let g:floaterm_keymap_new = '<F4>'
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
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-fugitive' | Plug 'tpope/vim-rhubarb'
+22
View File
@@ -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': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden' }), <bang>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': <q-args>, 'sink': 'e', 'source': 'rg --files --hidden --no-ignore' }), <bang>0))
nmap <leader>f :Files<cr>
nmap <leader>F :AllFiles<cr>
nmap <leader>b :Buffers<cr>
nmap <leader>h :History<cr>
nmap <leader>r :Rg<cr>
nmap <leader>R :Rg<space>
nmap <leader>gb :GBranches<cr>
+1
View File
@@ -0,0 +1 @@
Plug 'jessarcher/vim-heritage'
+1
View File
@@ -0,0 +1 @@
Plug 'farmergreg/vim-lastplace'
+3
View File
@@ -0,0 +1,3 @@
Plug 'tommcdo/vim-lion'
let g:lion_squeeze_spaces = 1 " Remove as many spaces as possible when aligning
@@ -0,0 +1 @@
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
+23
View File
@@ -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 <expr> <leader>n g:NERDTree.IsOpen() ? ':NERDTreeClose<CR>' : @% == '' ? ':NERDTree<CR>' : ':NERDTreeFind<CR>'
nmap <leader>N :NERDTreeFind<CR>
" 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
+3
View File
@@ -0,0 +1,3 @@
Plug 'sickill/vim-pasta'
let g:pasta_disabled_filetypes = ['fugitive']
+1
View File
@@ -0,0 +1 @@
Plug 'junegunn/vim-peekaboo'
+6
View File
@@ -0,0 +1,6 @@
Plug 'phpactor/phpactor', {'for': 'php', 'branch': 'master', 'do': 'composer install --no-dev -o'}
augroup PhpactorMappings
au!
au FileType php nmap <buffer> <Leader>mm :PhpactorContextMenu<CR>
augroup END
+6
View File
@@ -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
+42
View File
@@ -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",
\ ],
\ },
\ }}
+4
View File
@@ -0,0 +1,4 @@
Plug 'unblevable/quick-scope'
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
let g:qs_max_chars=150
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-repeat'
+1
View File
@@ -0,0 +1 @@
Plug 'airblade/vim-rooter'
+3
View File
@@ -0,0 +1,3 @@
Plug 'jessarcher/vim-sayonara', { 'on': 'Sayonara' }
nmap <leader>q :Sayonara!<cr>
+4
View File
@@ -0,0 +1,4 @@
Plug 'tpope/vim-sensible'
set listchars=tab:▸\ ,trail
+6
View File
@@ -0,0 +1,6 @@
Plug 'terryma/vim-smooth-scroll'
noremap <silent> <c-u> :call smooth_scroll#up(&scroll, 0, 4)<CR>
noremap <silent> <c-d> :call smooth_scroll#down(&scroll, 0, 4)<CR>
noremap <silent> <c-b> :call smooth_scroll#up(&scroll*2, 0, 8)<CR>
noremap <silent> <c-f> :call smooth_scroll#down(&scroll*2, 0, 8)<CR>
+3
View File
@@ -0,0 +1,3 @@
Plug 'AndrewRadev/splitjoin.vim'
let g:splitjoin_html_attributes_bracket_on_new_line = 1
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-surround'
+1
View File
@@ -0,0 +1 @@
Plug 'wellle/targets.vim'
+1
View File
@@ -0,0 +1 @@
Plug 'kana/vim-textobj-user' | Plug 'whatyouhide/vim-textobj-xmlattr'
+1
View File
@@ -0,0 +1 @@
Plug 'christoomey/vim-tmux-navigator'
+1
View File
@@ -0,0 +1 @@
Plug 'tpope/vim-unimpaired'
+15
View File
@@ -0,0 +1,15 @@
Plug 'vim-test/vim-test'
let test#php#phpunit#executable = 'deliver vendor/bin/phpunit'
nmap <leader>tn :TestNearest<CR>
nmap <leader>tf :TestFile<CR>
nmap <leader>ts :TestSuite<CR>
nmap <leader>tl :TestLast<CR>
nmap <leader>tv :TestVisit<CR>
augroup AutoDeleteTestTermBuffers
autocmd!
autocmd BufLeave term://*artisan\stest* bdelete!
autocmd BufLeave term://*phpunit* bdelete!
augroup END
+1
View File
@@ -0,0 +1 @@
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
@@ -0,0 +1 @@
Plug 'nelstrom/vim-visual-star-search'
+12
View File
@@ -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