summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vim/ftplugin/perl.vim2
-rw-r--r--vim/ftplugin/ruby.vim17
-rw-r--r--vim/ftplugin/rust.vim2
-rw-r--r--vimrc24
4 files changed, 21 insertions, 24 deletions
diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim
index 94f3c1d..9492f1d 100644
--- a/vim/ftplugin/perl.vim
+++ b/vim/ftplugin/perl.vim
@@ -1,3 +1,5 @@
+let b:ale_linters = { 'perl': ['perlcritic'] }
+
" :make does a syntax check
if expand("%:e") == "psgi"
exe 'setlocal makeprg=plackup\ -Ilib\ -a\ ' . expand("%")
diff --git a/vim/ftplugin/ruby.vim b/vim/ftplugin/ruby.vim
new file mode 100644
index 0000000..fa735f8
--- /dev/null
+++ b/vim/ftplugin/ruby.vim
@@ -0,0 +1,17 @@
+function! s:rubocop_in_bundler()
+ let gemfiles = glob("*.gemspec", 1, 1)
+ if filereadable("Gemfile")
+ let gemfiles += ["Gemfile"]
+ endif
+ for file in gemfiles
+ for line in readfile(file)
+ if line =~ 'gem.*rubocop'
+ return 1
+ endif
+ endfor
+ endfor
+ return 0
+endfunction
+if s:rubocop_in_bundler()
+ let b:ale_ruby_rubocop_executable = 'bundle'
+endif
diff --git a/vim/ftplugin/rust.vim b/vim/ftplugin/rust.vim
index 03d90d4..b899d50 100644
--- a/vim/ftplugin/rust.vim
+++ b/vim/ftplugin/rust.vim
@@ -4,3 +4,5 @@ if filereadable("Cargo.toml")
else
setlocal makeprg=rustc\ %
endif
+
+let b:ale_rust_cargo_use_check = 1
diff --git a/vimrc b/vimrc
index 9b6c8ad..191bfdd 100644
--- a/vimrc
+++ b/vimrc
@@ -658,30 +658,6 @@ let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
let g:ale_history_enabled = 0
let g:ale_history_log_output = 0
-
-let g:ale_linters = {
-\ 'perl': ['perlcritic']
-\}
-
-let g:ale_rust_cargo_use_check = 1
-
-function! s:rubocop_in_bundler()
- let gemfiles = glob("*.gemspec", 1, 1)
- if filereadable("Gemfile")
- let gemfiles += ["Gemfile"]
- endif
- for file in gemfiles
- for line in readfile(file)
- if line =~ 'gem.*rubocop'
- return 1
- endif
- endfor
- endfor
- return 0
-endfunction
-if s:rubocop_in_bundler()
- let g:ale_ruby_rubocop_executable = 'bundle'
-endif
" }}}
" airline
" commentary {{{