From 32c4f82c3088d2822112da87f2512b691d37cb95 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Sun, 20 Jun 2021 13:44:32 +0200 Subject: [PATCH] nvim: added js support --- .config/nvim/init.vim | 2 ++ .local/bin/tools/nvim/compiler | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 3f4e0a3..5602b99 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -127,6 +127,7 @@ let g:coc_global_extensions = [ \ 'coc-markdownlint', \ 'coc-pyright', \ 'coc-sh', + \ 'coc-tsserver', \ 'coc-vimtex', \ ] @@ -333,6 +334,7 @@ autocmd BufRead,BufNewFile *.nim set filetype=nim " formatting options autocmd FileType java setlocal shiftwidth=2 softtabstop=2 +autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2 autocmd FileType markdown setlocal shiftwidth=2 softtabstop=2 " formatting programs diff --git a/.local/bin/tools/nvim/compiler b/.local/bin/tools/nvim/compiler index 537c0ee..f4747df 100755 --- a/.local/bin/tools/nvim/compiler +++ b/.local/bin/tools/nvim/compiler @@ -31,9 +31,10 @@ case "$file" in *\.m) octave -qW "$file" ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *config.h) sudo make install ;; + *\.js) node "$file" ;; *\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;; *\.nim) nim c -r -d:noColors "$file" ;; - *\.py) python "$file" ;; + *\.py) python3 "$file" ;; *\.go) go run "$file" ;; *\.sent) setsid sent "$file" 2>/dev/null & ;; *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;