Improve Vim configuration

This commit is contained in:
Max Bucknell 2019-03-10 11:11:58 +00:00
parent 515628459f
commit 4017e91a64

View file

@ -49,6 +49,8 @@ Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'}
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'sebastianmarkow/deoplete-rust' Plug 'sebastianmarkow/deoplete-rust'
" CSV
Plug 'chrisbra/csv.vim'
call plug#end() call plug#end()
" Theme configuration " Theme configuration
@ -87,7 +89,7 @@ tnoremap hhh h<C-\><C-n>
let mapleader = "\<space>" let mapleader = "\<space>"
" FUzzy finding " FUzzy finding
nnoremap <leader>t :FZF<cr> nnoremap <leader>o :FZF<cr>
" Don't wrap lines " Don't wrap lines
" "
@ -188,6 +190,26 @@ set shiftwidth=4
set softtabstop=4 set softtabstop=4
set autoindent 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 augroup vimrcEx
" Clear all autocmds in the group " Clear all autocmds in the group
autocmd! autocmd!
@ -195,6 +217,11 @@ augroup vimrcEx
" Language whitespace settings " Language whitespace settings
autocmd FileType make setl noet sw=8 sts=8 ts=8 autocmd FileType make setl noet sw=8 sts=8 ts=8
autocmd FileType typescript nnoremap <leader>r :call RunTypeScript()<cr>
autocmd FileType javascript nnoremap <leader>r :call RunJavaScript()<cr>
autocmd FileType python nnoremap <leader>r :call RunPython()<cr>
autocmd FileType rust nnoremap <leader>r :call RunRust()<cr>
" Hard wrap prose " Hard wrap prose
" "
" This will automatically insert a new line in insert mode when a " This will automatically insert a new line in insert mode when a