" This gives us better results for Nit
set noignorecase
- set completeopt=longest,menuone,preview
+ set completeopt=longest,menuone
" Do not predict small 3 letters keywords (or their prefix), they slow down
" prediction and some also require double-enter on end of line.
redraw!
endfun
+" Call `nit` on the current file
+fun NitExecute()
+ let path = expand('%')
+
+ if &modified
+ let path = tempname() . '.nit'
+ execute '%write '. path
+ endif
+
+ execute '!nit "' . path . '"'
+endfun
+command NitExecute call NitExecute()
+
if !exists("g:nit_disable_omnifunc") || !g:nit_disable_omnifunc
" Activate the omnifunc on Nit files
autocmd FileType nit set omnifunc=NitOmnifunc