diff --git a/SpaceVim.d/autoload/paiyou.vim b/SpaceVim.d/autoload/paiyou.vim index 8f24e26..096a164 100644 --- a/SpaceVim.d/autoload/paiyou.vim +++ b/SpaceVim.d/autoload/paiyou.vim @@ -1,3 +1,59 @@ +function! paiyou#before() abort + set virtualedit=onemore " Allow for cursor beyond last character + set splitright + + " open a NERDTree automatically when vim starts up if no files were specified + autocmd StdinReadPre * let s:std_in=1 + autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif + " }}} + + let g:neoformat_javascript_jsbeautify = { + \ 'exe': 'js-beautify', + \ 'stdin': 1, + \ } + let g:neoformat_typescript_prettier = { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'], + \ 'stdin': 1 + \ } + let g:neoformat_enabled_typescript = ['tsfmt', 'prettier'] + + + " show all uncompliable symbols + set listchars=tab:>-,trail:~,extends:>,precedes:< + set list + + + " javascript + let g:tern#command = ["tern"] + let g:tern#arguments = ["--persistent"] + + let g:spacevim_custom_plugins = [ + \ ['peitalin/vim-jsx-typescript'], + \ ['leafgarland/typescript-vim'], + \ ] + + " typescript + let g:tagbar_type_typescript = { + \ 'ctagstype': 'typescript', + \ 'kinds': [ + \ 'c:classes', + \ 'n:modules', + \ 'f:functions', + \ 'v:variables', + \ 'v:varlambdas', + \ 'm:members', + \ 'i:interfaces', + \ 'e:enums', + \ 's:statics', + \ ] + \ } + + + " disable ctags + let g:gutentags_ctags_exclude = [ "*.js", "*.jsx", "*.ts", "*.tsx", "*.css", "build", "vendor", ".git", "node_modules", "*.vim/bundle/*", "out" ] +endfunction + function! paiyou#after() abort let g:ale_fixers = { \ 'javascript': ['eslint'], diff --git a/SpaceVim.d/autoload/settings/out_of_usage/easymotion.vim b/SpaceVim.d/autoload/settings/out_of_usage/easymotion.vim index a7d4821..91d4511 100644 --- a/SpaceVim.d/autoload/settings/out_of_usage/easymotion.vim +++ b/SpaceVim.d/autoload/settings/out_of_usage/easymotion.vim @@ -2,7 +2,7 @@ " We exclude semicolon because it's hard to read and " i and l are too easy to mistake for each other slowing " down recognition. The home keys and the immediate keys -" accessible by middle fingers are available +" accessible by middle fingers are available let g:EasyMotion_keys='asdfjkoweriop' nmap , ,,w nmap , ,,b diff --git a/SpaceVim.d/init.toml b/SpaceVim.d/init.toml index 80e6d77..3da712f 100644 --- a/SpaceVim.d/init.toml +++ b/SpaceVim.d/init.toml @@ -32,6 +32,7 @@ filemanager = "nerdtree" enable_neomake = false enable_ale = true + bootstrap_before = "paiyou#before" bootstrap_after = "paiyou#after" project_rooter_automatically = 0 @@ -58,6 +59,9 @@ name = "tmux" [[layers]] name = "lang#javascript" +[[layers]] +name = "lang#typescript" + [[layers]] name = "colorscheme"