Skip to content

Commit

Permalink
Added new kotlin vim + ctags plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
tdickman-rmn committed Feb 6, 2018
1 parent 60d954c commit 38c9663
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--langdef=kotlin
--langmap=kotlin:.kt
--langmap=kotlin:+.kts
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/o,objects/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*data class[ \t]+([a-zA-Z0-9_]+)/\6/c,data classes/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private[^ ]*|protected)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\4/i,interfaces/
--regex-kotlin=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*(\[[a-z]*\])*|protected)[ \t]*)*fun[ \t]+([a-zA-Z0-9_]+)/\4/m,methods/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*val[ \t]+([a-zA-Z0-9_]+)/\3/co,constants/
--regex-kotlin=/^[ \t]*((abstract|final|sealed|implicit|lazy|private[^ ]*|protected)[ \t]*)*var[ \t]+([a-zA-Z0-9_]+)/\3/va,variables/
--regex-kotlin=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/
--regex-kotlin=/^[ \t]*import[ \t]+([a-zA-Z0-9_.]+)/\1/p,imports/
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,33 @@ ctags -R --fields=+l --languages=python --python-kinds=-iv -f ./tags $(python -c

# Git config
git config --global commit.gpgsign true # Sign commits

# Kotlin

This project includes a few plugins to help with kotlin + vim. To use syntastic
with a kotlin project you need to to the following to enable sytastic:

https://github.com/francis36012/ktsyntastic

Add the following to build.gradle:

```
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.fagyapong.ktsyntastic:ktsyntastic:0.3.1"
}
}
apply plugin: "com.fagyapong.ktsyntastic"
```

Then run the following to generate a .syntastic_kotlinc_config file:

```
./gradlew kotlinSyntastic
```
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ln -s $SCRIPTPATH/tmux.conf ~/.tmux.conf
ln -s $SCRIPTPATH/bash_aliases.sh ~/.bash_aliases.sh
ln -s $SCRIPTPATH/bash_shared.sh ~/.bash_shared.sh
ln -s $SCRIPTPATH/.jshintrc ~/.jshintrc
ln -s $SCRIPTPATH/.ctags ~/.ctags
sudo ln -s $SCRIPTPATH/pykub.py /usr/local/bin/pykub
sudo chmod +x /usr/local/bin/pykub
ln -s ~/.vim/vimrc ~/.vimrc
Expand Down
4 changes: 4 additions & 0 deletions vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Plug 'https://github.com/tomlion/vim-solidity.git'
Plug 'https://github.com/kballard/vim-swift.git'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'udalov/kotlin-vim'

call plug#end()

Expand Down Expand Up @@ -85,8 +86,11 @@ let g:syntastic_python_python_exec = '/Library/Frameworks/Python.framework/Versi
let g:syntastic_python_checkers=['flake8']
let g:syntastic_python_flake8_args='--ignore=E501,E225'
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_kotlin_checkers = ['kotlinc']
let g:syntastic_error_symbol = ""
let g:syntastic_warning_symbol = ""
" Kotlin
let g:syntastic_kotlin_kotlinc_config_file_enabled=1

" Allow swapping of panes via ,mw and ,pw
function! MarkWindowSwap()
Expand Down

0 comments on commit 38c9663

Please sign in to comment.