Skip to content

Commit

Permalink
Add Typescript support
Browse files Browse the repository at this point in the history
  • Loading branch information
L0stSoul committed Jun 18, 2018
1 parent 0775ead commit de350f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ if (has("python") || has("python3")) && isNpmInstalled
\ }
endif

" Advanced features support for typescript editing
NeoBundle 'Quramy/tsuquyomi'

" Add smart commands for comments like:
" gcc - Toggle comment for the current line
" gc - Toggle comments for selected region or number of strings
Expand Down Expand Up @@ -151,6 +154,9 @@ NeoBundle 'elzr/vim-json'
" Syntax highlighting for .jsx (js files for react js)
NeoBundle 'mxw/vim-jsx'

" Syntax highlighting for typescript
NeoBundle 'leafgarland/typescript-vim'

" Add Support css3 property
NeoBundle 'hail2u/vim-css3-syntax'

Expand Down Expand Up @@ -317,6 +323,7 @@ endfunction
" setting up jshint csslint and jscs if available
let g:syntastic_javascript_jshint_exec = s:FindSyntasticExecPath('jshint')
let g:syntastic_javascript_jscs_exec = s:FindSyntasticExecPath('jscs')
let g:syntastic_typescript_checkers = ['tsuquyomi']
let g:syntastic_css_csslint_exec= s:FindSyntasticExecPath('csslint')

" Enable autochecks
Expand Down Expand Up @@ -397,6 +404,18 @@ nmap <silent> <leader>tr :TernRefs<CR>
" Smart variable rename
nmap <silent> <leader>tn :TernRename<CR>
"-------------------------
" Tsuquyomi

let g:tsuquyomi_disable_quickfix = 1

" Go to definition
nmap <silent> <leader>td :TsuDefinition<cr>
" Go to type definition
vmap <silent> <leader>tdt :TsuTypeDefinition<cr>
" find all references
nmap <silent> <leader>tr :TsuReferences<cr>
"-------------------------
" Solarized

Expand Down Expand Up @@ -495,6 +514,7 @@ inoremap <expr><C-e> neocomplcache#undo_completion()
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType typescript setlocal omnifunc=typescriptcomlete#CompleteTS

" For cursor moving in insert mode
inoremap <expr><Left> neocomplcache#close_popup() . "\<Left>"
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ Provides smart autocompletion.
#### Integration with git &mdash;[Fugitive](https://github.com/tpope/vim-fugitive)
Provides full integration wit git.

#### Advanced javascript features &mdash;[Tern for Vim](https://github.com/marijnh/tern_for_vim)
Provides advanced javascript features like Smart variable rename, Find variable references, and Go to variable. If you use `.ternconf` &mdash; it'll improve autocompletion in your js files as well.
#### Advanced typescript integration &mdash;[tsuquyomi](https://github.com/Quramy/tsuquyomi)
Provides advanced javascript features - like contextaware typescript autocompletion, immediately show type errors and semantic errors, adwanced navigation ability etc

#### Advanced javascript integration &mdash;[Tern for Vim](https://github.com/marijnh/tern_for_vim)
Provides advanced javascript features - like context aware javascript code completion, variable rename, Find variable references, and Go to variable.

#### Improved syntax higlighting
* *Typescript* &mdash; [leafgarland/typescript-vim](https://github.com/leafgarland/typescript-vim)
* *Javascript* &mdash; [vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax)
* *JSX* &mdash; [vim-jsx](https://github.com/mxw/vim-jsx)
* *JSON* &mdash; [vim-json](https://github.com/elzr/vim-json)
Expand Down

0 comments on commit de350f5

Please sign in to comment.