From 638801a44b93babd8d9ac42d641be7d91b4d6e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Krej=C4=8D=C3=AD?= Date: Fri, 12 Oct 2018 10:45:34 +0200 Subject: [PATCH] Update 12/10/18 --- .nvimrc | 155 ++++++++++++++++++++++++------------ com.googlecode.iterm2.plist | 22 ++--- git/.gitignore | 4 +- 3 files changed, 120 insertions(+), 61 deletions(-) diff --git a/.nvimrc b/.nvimrc index bb3b3e8..59be4ca 100644 --- a/.nvimrc +++ b/.nvimrc @@ -30,8 +30,8 @@ Plug 'troydm/zoomwintab.vim' Plug 'Lokaltog/vim-easymotion' Plug 'mhinz/vim-grepper' Plug 'osyo-manga/vim-over' -" Plug 'dkprice/vim-easygrep' Plug 'nelstrom/vim-qargs' +Plug '/usr/local/opt/fzf' " Autocomplete Plug 'Shougo/context_filetype.vim' @@ -45,7 +45,7 @@ Plug 'Shougo/neopairs.vim' Plug 'Yggdroot/indentLine' Plug 'alvan/vim-closetag' Plug 'jiangmiao/auto-pairs' -Plug 'andymass/vim-matchup' +" Plug 'andymass/vim-matchup' " Plug 'edsono/vim-matchit' Plug 'gorkunov/smartpairs.vim' Plug 'junegunn/vim-easy-align' @@ -72,11 +72,12 @@ Plug 'tpope/vim-git' Plug 'jreybert/vimagit' Plug 'idanarye/vim-merginal' Plug 'lambdalisue/gina.vim' +Plug 'danishprakash/vim-githubinator' " Building, Linters, Test Runners -Plug 'w0rp/ale', { 'for': ['ruby', 'javascript'] } +Plug 'w0rp/ale' Plug 'sbdchd/neoformat' -Plug 'janko-m/vim-test', { 'for': 'ruby' } +Plug 'janko-m/vim-test' " Ruby Integration Plug 'AmaiSaeta/vim-ruby-sinatra', { 'for': 'ruby' } @@ -87,7 +88,6 @@ Plug 'tpope/vim-bundler', { 'for': 'ruby' } Plug 'tpope/vim-rails' Plug 'vim-ruby/vim-ruby', { 'for': 'ruby' } Plug 'tpope/vim-rvm', { 'for': 'ruby' } -Plug 'gorkunov/smartgf.vim', { 'for': 'ruby' } " JavaScript Integration Plug 'elzr/vim-json', { 'for': 'json' } @@ -99,6 +99,13 @@ Plug 'flowtype/vim-flow', { 'for': 'javascript' } Plug 'othree/jspc.vim', { 'for': 'javascript' } Plug 'jparise/vim-graphql', { 'for': 'javascript' } Plug 'heavenshell/vim-jsdoc', { 'for': 'javascript' } +" Plug 'leafgarland/typescript-vim' +Plug 'HerringtonDarkholme/yats.vim' +" Plug 'Quramy/tsuquyomi' +" Plug 'rudism/deoplete-tsuquyomi' +" Plug 'mhartington/nvim-typescript', {'do': './install.sh'} +" Plug 'peitalin/vim-jsx-typescript' +" Plug 'Shougo/vimproc.vim', {'do' : 'make'} " Dep of tsuquyomi? " Elixir integration Plug 'slashmili/alchemist.vim' @@ -268,17 +275,13 @@ nnoremap w v nnoremap e :vnew nmap w +" When joining lines do not insert space between +" nnoremap J :j! +" TODO + " Resize splits when the window is resized autocmd VimResized * wincmd = -" Tabs -nmap :tabm 1 -nmap :tabm 2 -nmap :tabm 3 -nmap :tabm 4 -nmap :tabm 5 -nmap :tabm 6 - " Make horizontal scrolling less horrible. set sidescroll=1 set sidescrolloff=10 @@ -287,6 +290,9 @@ cnoreabbrev W w cnoreabbrev Q q cnoreabbrev E e +cnoreabbrev GW Gwrite! +cnoreabbrev GW! Gwrite! + colorscheme mikekreeki set guicursor+=a:blinkon0 @@ -425,6 +431,7 @@ augroup nerdtree_config let g:NERDTreeExtensionHighlightColor['css'] = 'AAAAAA' let g:NERDTreeExtensionHighlightColor['less'] = 'AAAAAA' let g:NERDTreeExtensionHighlightColor['scss'] = 'AAAAAA' + let g:NERDTreeExtensionHighlightColor['test.js'] = 'AAAAAA' let g:NERDTreeDisableExactMatchHighlight = 1 let g:NERDTreeDisablePatternMatchHighlight = 1 @@ -445,6 +452,7 @@ augroup ctrlp_config let g:ctrlp_extensions = [] let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' + let g:ctrlp_user_command_async = 1 let g:ctrlp_match_window = 'bottom,order:ttb' let g:ctrlp_reuse_window = 'netrw' @@ -452,7 +460,7 @@ augroup ctrlp_config let g:ctrlp_working_path_mode = 0 let g:ctrlp_show_hidden = 1 - let g:ctrlp_use_caching=1 + let g:ctrlp_use_caching = 1 " nmap .. :CtrlPBranch " nmap -- :CtrlPBranch @@ -525,8 +533,6 @@ augroup neovim_config tnoremap l tnoremap " autocmd BufEnter term://* startinsert - - let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 1 endif augroup END @@ -579,25 +585,29 @@ augroup END augroup test_config autocmd! - " nmap R :TestNearest - " nmap r :TestFile - " nmap a :TestSuite - " nmap l :TestLast - " nmap g :TestVisit + nmap R :TestNearest + nmap r :TestFile + nmap a :TestSuite + nmap l :TestLast + nmap g :TestVisit - let test#base#no_colors = 0 - let test#strategy = 'neoterm' - let g:test#preserve_screen = 0 + let g:test#enabled_runners = ["javascript#jest", "ruby#rspec"] - function! RunTest(cmd) - call neoterm#open() " Opens the neoterm window - call neoterm#normal('G') " Scroll to the end of the neoterm window - call neoterm#clear() - exec a:cmd - endfunction + " let g:test#javascript#jest#file_pattern = '.*-(spec|test)\.(js|jsx|coffee|ts|tsx)$' + + " let test#base#no_colors = 0 + " let test#strategy = 'neoterm' + " let g:test#preserve_screen = 0 - nmap R :call RunTest('TestNearest') - nmap r f :call RunTest('TestFile') + " function! RunTest(cmd) + " call neoterm#open() " Opens the neoterm window + " call neoterm#normal('G') " Scroll to the end of the neoterm window + " call neoterm#clear() + " exec a:cmd + " endfunction + + " nmap R :call RunTest('TestNearest') + " nmap r f :call RunTest('TestFile') augroup END augroup trailing_whitespace_config @@ -618,6 +628,7 @@ augroup ale_config let g:ale_linters = { \ 'javascript': ['eslint', 'flow'], \ 'ruby': ['rubocop'], + \ 'typescript': ['tsserver', 'tslint'] \} let g:ale_ruby_rubocop_options = '-R' @@ -735,7 +746,7 @@ augroup neoterm_config autocmd! if has('nvim') - let g:neoterm_position = 'vertical' + let g:neoterm_default_mod = 'right' autocmd TermOpen * set nonumber autocmd TermOpen * set wfw @@ -749,27 +760,44 @@ augroup neoterm_config endfunction :command! TT call OpenTerminal() - function! NeovimTerminalToggleTerm() - bo 15 split - try - exe s:neovim_visor_termbuf . 'buffer' - startinsert - catch - terminal - let s:neovim_visor_termbuf=bufnr('%') - execute 'tnoremap ' . '' . ' :hide' - endtry - endfunction - - com! NeovimTerminalToggleTerm call NeovimTerminalToggleTerm() - nmap :NeovimTerminalToggleTerm + " function! NeovimTerminalToggleTerm() + " bo 15 split + " try + " exe s:neovim_visor_termbuf . 'buffer' + " startinsert + " catch + " terminal + " let s:neovim_visor_termbuf=bufnr('%') + " execute 'tnoremap ' . '' . ' :hide' + " execute 'tnoremap ' . '' . ' :hide' + " endtry + " endfunction + + " autocmd TermOpen * nnoremap :hide + + " com! NeovimTerminalToggleTerm call NeovimTerminalToggleTerm() + " nmap :NeovimTerminalToggleTerm + + " Readline cheatsheet: + " ctrl-a - jump to start of line + " ctrl-e - jump to end of line + " ctrl-k - kill forwards to the end of line + " ctrl-u - kill backwards to the start of line + autocmd TermOpen * nnoremap I I + autocmd TermOpen * nnoremap A A + autocmd TermOpen * nnoremap C A + autocmd TermOpen * nnoremap D A + autocmd TermOpen * nnoremap cc A + autocmd TermOpen * nnoremap dd A endif + + augroup END augroup closetag_config autocmd! - let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.xml,*.jsx,*.react.js,*.js" + let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.xml,*.jsx,*.react.js,*.js,*.tsx" augroup END augroup matchup_config @@ -863,13 +891,38 @@ augroup neoformat_config \ } endfunction - autocmd BufWritePre src/**/*.js,cypress/**/*.js silent Neoformat + function! neoformat#formatters#typescript#prettier() abort + return { + \ 'exe': './node_modules/.bin/prettier', + \ 'args': ['--stdin --config .prettierrc --parser typescript'], + \ 'stdin': 1, + \ } + endfunction + + autocmd BufWritePre apps/**/*.js,src/**/*.js,cypress/**/*.js silent Neoformat + autocmd BufWritePre apps/**/*.ts,src/**/*.ts,cypress/**/*.ts silent Neoformat + autocmd BufWritePre apps/**/*.tsx,src/**/*.tsx,cypress/**/*.tsx silent Neoformat augroup END augroup syntax_attr_config autocmd! - map x :call SyntaxAttr() + map x :call SyntaxAttr#SyntaxAttr() +augroup END + +augroup typescript_config + autocmd! + + " autocmd FileType typescript nmap : echo tsuquyomi#hint() + " autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.jsx + + " autocmd FileType typescript nnoremap :TsuDefinition + " autocmd FileType javascript.jsx nnoremap ¨ :FlowType + + autocmd FileType typescript nnoremap :TSDef + " autocmd FileType typescript syntax match typescriptSemicolons /;/ + + let g:nvim_typescript#diagnostics_enable = 0 augroup END augroup elixir_config @@ -907,7 +960,7 @@ augroup END augroup polyglot_config autocmd! - let g:polyglot_disabled = ['javascript', 'jsx', 'ruby', 'elixir'] + let g:polyglot_disabled = ['javascript', 'jsx', 'ruby', 'elixir', 'typescript'] augroup END augroup cursorword_config diff --git a/com.googlecode.iterm2.plist b/com.googlecode.iterm2.plist index b1a6798..bca261d 100644 --- a/com.googlecode.iterm2.plist +++ b/com.googlecode.iterm2.plist @@ -281,30 +281,32 @@ 1 NSWindow Frame NSFontPanel - 404 91 467 77 0 0 1440 877 + 91 1074 467 77 0 0 3440 1417 NSWindow Frame Preferences 127 444 606 456 0 0 1440 900 NSWindow Frame ProfilesPanel - 533 957 735 382 0 0 2560 1417 + 790 978 735 382 0 0 3440 1440 NSWindow Frame SUAutomaticUpdateAlert - 412 545 616 174 0 0 1440 900 + 1412 950 616 174 0 0 3440 1440 NSWindow Frame SUStatusFrame 760 804 400 129 0 0 1920 1200 NSWindow Frame SUUpdateAlert - 970 787 620 392 0 0 2560 1417 + 1410 787 620 392 0 0 3440 1440 NSWindow Frame SessionsPreferences 630 10 606 469 0 0 2560 1417 NSWindow Frame SharedPreferences - 367 312 796 473 0 0 1440 900 + 528 321 796 486 0 0 3440 1417 NSWindow Frame UKCrashReporter 534 4 592 584 0 0 1440 900 NSWindow Frame iTerm Window 0 - 0 0 1440 900 0 0 1440 877 + 0 0 3440 1440 0 0 3440 1417 New Bookmarks ASCII Anti Aliased + ASCII Ligatures + Allow Title Reporting Ambiguous Double Width @@ -851,7 +853,7 @@ Screen -1 Scrollback Lines - 1000 + 0 Scrollback With Status Bar Scrollback in Alternate Screen @@ -1132,7 +1134,7 @@ SUHasLaunchedBefore SULastCheckTime - 2018-03-07T10:57:04Z + 2018-10-11T09:23:21Z SavePasteHistory ShowBookmarkName @@ -1157,6 +1159,8 @@ 6 TabStyle 1 + TabStyleWithAutomaticOption + 1 TabViewType 1 ThreeFingerEmulates @@ -8661,7 +8665,7 @@ findRegex_iTerm iTerm Version - 3.1.6beta3 + 3.2.3beta2 kCommandHistoryHasEverBeenUsed diff --git a/git/.gitignore b/git/.gitignore index e469205..3e5b48c 100644 --- a/git/.gitignore +++ b/git/.gitignore @@ -29,7 +29,6 @@ npm-debug.log # VIM .swp *.swp -tags .smartgf_tags .smartgf_tags_date .nvimrc @@ -53,3 +52,6 @@ git_stats/ # Yarn yarn-error.log + +# Custom scripts +relativize_imports_in_module