diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 8d4947d..31c7dd0 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -127,20 +127,22 @@ syntax enable highlight! link MatchParen SpellBad "### Autocmds #################################### -autocmd TermOpen * setlocal nonu nornu -autocmd TermOpen * IndentLinesDisable -autocmd TermOpen * startinsert -autocmd BufWritePre * %s:\s\+$::e -autocmd BufNewFile,BufRead * set formatoptions-=o conceallevel=0 +autocmd BufWritePre * %s:\s\+$::e +autocmd TermOpen * setlocal nonu nornu | IndentLinesDisable | startinsert -autocmd BufNewFile,BufRead Jenkinsfile setlocal filetype=groovy -autocmd BufNewFile,BufRead *.mom setlocal filetype=groff -autocmd BufNewFile,BufRead *.avsc setlocal filetype=json -autocmd BufNewFile,BufRead calcurse-note* setlocal filetype=markdown +autocmd BufNewFile,BufRead * set formatoptions-=o conceallevel=0 +autocmd BufNewFile,BufRead Jenkinsfile setlocal filetype=groovy +autocmd BufNewFile,BufRead *.mom setlocal filetype=groff +autocmd BufNewFile,BufRead *.avsc setlocal filetype=json +autocmd BufNewFile,BufRead calcurse-note* setlocal filetype=markdown -autocmd FileType yaml,json set ts=2 sw=2 -autocmd FileType json,markdown,text,help IndentLinesDisable -autocmd FileType markdown,text setlocal spell lbr +autocmd FileType yaml,json set ts=2 sw=2 +autocmd FileType json,markdown,text,help IndentLinesDisable +autocmd FileType markdown,text setlocal spell lbr + +let g:loaded_netrw = 1 +" autocmd VimEnter * silent! autocmd! FileExplorer * +autocmd BufEnter * if isdirectory(expand('%')) | call NetrwReplacement("lf") "### Functions ################################## function! ResizeMode() @@ -237,8 +239,26 @@ endfunction function! TempTerm(...) let command = get(a:, 1) - exe "au TermClose * ++once :b#|bd!#" + exe "autocmd TermClose * ++once b#|bd!#" + exe "terminal ".command + return "" +endfunction + +function! DelBufferOrQuit() + if len(getbufinfo({"buflisted":1})) == 1 + exe "q" + else + exe "b#|bw!#" + endif + return "" +endfunction + +function! NetrwReplacement(...) + let command = get(a:, 1) exe "terminal ".command + exe "bw #" + exe "autocmd TermClose * ++once call DelBufferOrQuit()" + exe "setlocal nonu nornu | IndentLinesDisable | startinsert" return "" endfunction diff --git a/home/.config/zsh/nonest_nvim/main.go b/home/.config/zsh/nonest_nvim/main.go index badae23..464b4b8 100644 --- a/home/.config/zsh/nonest_nvim/main.go +++ b/home/.config/zsh/nonest_nvim/main.go @@ -40,18 +40,14 @@ func main() { fmt.Println(err) os.Exit(1) } - defer v.Close() b := v.NewBatch() - b.Command(":file temp_terminal") - for _, filePath := range filePaths { b.Command(":e " + filePath) } - - b.Command(":b temp_terminal") - b.Command(":bd!") + b.Command(":b term://") + b.Command(":bw!") // fix airline statusbar b.Command(":if exists(':AirlineRefresh') == 2 | AirlineRefresh | endif") diff --git a/home/.config/zsh/nonest_nvim/nonest_nvim b/home/.config/zsh/nonest_nvim/nonest_nvim index 36535af..4006491 100755 Binary files a/home/.config/zsh/nonest_nvim/nonest_nvim and b/home/.config/zsh/nonest_nvim/nonest_nvim differ