From f3f4fd8db822c4d12eba440f171bce0f1beeac5d Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Fri, 27 Nov 2020 12:40:22 +0000 Subject: [PATCH] vim: misc, including some filetype changes New Elixir maps Move syntax stuff to EOF Set 'nasm' for assembler files. --- vimrc | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/vimrc b/vimrc index 27f4586..b06f858 100644 --- a/vimrc +++ b/vimrc @@ -128,8 +128,6 @@ set complete=.,b,u,] set wildignore+=deps/*,node_modules/*,*.sw? -syntax on - " Turn off the beeping ('cause it's annoying) set noerrorbells set visualbell @@ -164,8 +162,8 @@ map ,t3 :echo TabSize(3) map ,t4 :echo TabSize(4) map ,t8 :echo TabSize(8) -" treat C preprocessed assembler files as C -augroup filetype +" Explicitly set certain filetypes. +augroup filetypedetect au! au BufRead,BufNewFile *.S set filetype=c au bufRead,BufNewFile *.cc set filetype=cpp @@ -173,6 +171,7 @@ augroup filetype au bufRead,BufNewFile *.inc set filetype=make au BufRead,BufNewFile *.eex set filetype=html au BufRead,BufNewFile *.bss set filetype=vb + au BufRead,BufNewFile *.asm set filetype=nasm augroup END augroup java @@ -185,13 +184,11 @@ augroup cppprog au BufRead,BufNewFile *.h set cindent au BufRead,BufNewFile *.cc set cindent au BufRead,BufNewFile *.cpp set cindent - call TabSize(4) augroup END augroup cprog au! au BufRead,BufNewFile *.[ch] set cindent - call TabSize(4) augroup END augroup xml @@ -205,11 +202,11 @@ augroup END " Apply the muttrc colouring to mutt setup files: au BufNewFile,BufRead .mutt.* set ft=muttrc -" augroup filetype elixir -" autocmd! -" autocmd BufRead * imap ii IO.inspect( -" autocmd BufRead * imap ip IO.puts( -" augroup END +augroup elixir + autocmd! + autocmd BufRead,BufNewFile *.ex,*.exs inoremap ii IO.inspect( + autocmd BufRead,BufNewFile *.ex,*.exs inoremap ip IO.puts( +augroup END augroup filetype vue autocmd! @@ -239,6 +236,7 @@ augroup END " Automatic typo fixing iab compomemt component +iab seahores seahorse " Disable the command 'K' (keyword lookup) " map K @@ -434,7 +432,6 @@ if has("cscope") map ,sc :cs find c map ,sa :cs find t endif -filetype plugin indent on " Avoids printing anything by accident... set printexpr=PrintFile(v:fname_in) @@ -628,5 +625,18 @@ else echom "Don't know how to open on this platform." endif + +let g:startify_session_before_save = [ + \ 'echo "Cleaning up before saving.."', + \ 'silent! NERDTreeTabsClose' + \ ] + +match Todo /\s\+$/ + " Markdown folding let g:markdown_fold_style = 'nested' + +syntax on +filetype on +filetype plugin on +filetype plugin indent on