diff --git a/nvim/nvim.symlink/init.vim b/nvim/nvim.symlink/init.vim index 97c48ad..ac14a67 100644 --- a/nvim/nvim.symlink/init.vim +++ b/nvim/nvim.symlink/init.vim @@ -49,6 +49,8 @@ Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'} Plug 'rust-lang/rust.vim' Plug 'sebastianmarkow/deoplete-rust' +" CSV +Plug 'chrisbra/csv.vim' call plug#end() " Theme configuration @@ -87,7 +89,7 @@ tnoremap hhh h let mapleader = "\" " FUzzy finding -nnoremap t :FZF +nnoremap o :FZF " Don't wrap lines " @@ -188,6 +190,26 @@ set shiftwidth=4 set softtabstop=4 set autoindent +function! RunTypeScript() + silent !clear + execute "!tsc % --outFile /dev/stdout | node" +endfunction + +function! RunJavaScript() + silent !clear + execute "!node %" +endfunction + +function! RunPython() + silent !clear + execute "!python %" +endfunction + +function! RunRust() + silent !clear + execute "!cargo run" +endfunction + augroup vimrcEx " Clear all autocmds in the group autocmd! @@ -195,6 +217,11 @@ augroup vimrcEx " Language whitespace settings autocmd FileType make setl noet sw=8 sts=8 ts=8 + autocmd FileType typescript nnoremap r :call RunTypeScript() + autocmd FileType javascript nnoremap r :call RunJavaScript() + autocmd FileType python nnoremap r :call RunPython() + autocmd FileType rust nnoremap r :call RunRust() + " Hard wrap prose " " This will automatically insert a new line in insert mode when a