Make vim happier in general.

This commit is contained in:
Max Bucknell 2017-02-01 23:57:13 +00:00
parent 1cc0d135ec
commit 14c46b12ae
2 changed files with 43 additions and 3 deletions

View file

@ -85,6 +85,10 @@ hi jsDocParam cterm=NONE ctermfg=2 ctermbg=NONE
hi jsDocTypeNoParam cterm=NONE ctermfg=2 ctermbg=NONE hi jsDocTypeNoParam cterm=NONE ctermfg=2 ctermbg=NONE
hi jsDocSeeTag cterm=NONE ctermfg=2 ctermbg=NONE hi jsDocSeeTag cterm=NONE ctermfg=2 ctermbg=NONE
" PHPDoc comments are comments.
hi phpDocTags cterm=NONE ctermfg=2 ctermbg=NONE
hi phpDocCustomTags cterm=NONE ctermfg=2 ctermbg=NONE
" Line numbers are grey " Line numbers are grey
hi LineNr cterm=NONE ctermfg=7 ctermbg=NONE hi LineNr cterm=NONE ctermfg=7 ctermbg=NONE

View file

@ -66,9 +66,23 @@ set shell=bash
" I want to use this to manage my ascii drawings " I want to use this to manage my ascii drawings
set virtualedit=block set virtualedit=block
" Swap block and visual block
nnoremap v <C-V>
nnoremap <C-V> v
vnoremap v <C-V>
vnoremap <C-V> v
" Automatically read on update
set autoread
" I am always adding /g. No longer, suckers! " I am always adding /g. No longer, suckers!
set gdefault set gdefault
" Set comment line length
set tw=72
set fo=c
" Navigate to test, and back " Navigate to test, and back
" Find test counterpart. " Find test counterpart.
@ -375,15 +389,37 @@ augroup vimrcEx
" This will automatically insert a new line in insert mode when a " This will automatically insert a new line in insert mode when a
" line gets too long (above 80 characters). I can also run gqap " line gets too long (above 80 characters). I can also run gqap
" in normal mode to reflow a paragraph. " in normal mode to reflow a paragraph.
"
" I would like to have a customised version of this work with
" comments in code, but I haven't gotten that far yet.
autocmd FileType autocmd FileType
\ markdown, \ markdown,
\ setl tw=80 fo=t1 \ setl tw=80 fo=t1
augroup END augroup END
" Make directories in a filename if they don't exist.
function! AskQuit (msg, options, quit_option)
if confirm(a:msg, a:options) == a:quit_option
exit
endif
endfunction
function! EnsureDirExists ()
let required_dir = expand("%:h")
if !isdirectory(required_dir)
try
call mkdir( required_dir, 'p' )
catch
echom "Could not create directory"
exit
endtry
endif
endfunction
augroup AutoMkdir
autocmd!
autocmd BufNewFile * :call EnsureDirExists()
augroup END
" Set the statusline. " Set the statusline.
" This shows something like: " This shows something like:
" "