Add more refinements.

This commit is contained in:
Thomas Gideon 2015-10-13 21:35:19 -04:00
parent e148ba3363
commit 73c84169ff
4 changed files with 68 additions and 32 deletions

2
gvimrc
View file

@ -8,7 +8,7 @@ set lines=9999
" from the help, recommended for widest possible
set columns=9999
set background=dark
" enable antialiasing for environments supporting it
"" enable antialiasing for environments supporting it
set anti
set guioptions-=r
set guioptions-=b

View file

@ -1,9 +1,17 @@
" set a smaller indent
autocmd filetype markdown set ts=2
autocmd filetype markdown set sw=2
autocmd filetype markdown set expandtab
autocmd filetype markdown set nolinebreak
autocmd filetype markdown set fdm=indent
autocmd filetype markdown set tw=0
autocmd filetype markdown set smarttab
autocmd filetype markdown set smartindent
autocmd FileType javascript set spell
" like text files, don't break
"autocmd filetype markdown set tw=0
"" keep soft breaks between words
"autocmd filetype markdown set nolinebreak
"" fold on what indents there are
"autocmd filetype markdown set fdm=indent
"" smarten indent handling
"autocmd filetype markdown set smartindent
"" turn off line width hint
"autocmd FileType markdown set colorcolumn=0
"
"if has("gui_running")
" " narrow the gui window for text wrangling
" autocmd FileType markdown set columns=120
"endif

View file

@ -1 +1,23 @@
set tw=0
" don't hard break text
autocmd FileType text set tw=0
" keep soft breaks between words
autocmd FileType text set linebreak
" turn list off as it interferes with soft wrapping
autocmd FileType text set nolist!
" pull the wrap margin in given my preference for wide terms and windows
autocmd FileType text set wrapmargin=20
" turn off breaking when typing new text
autocmd FileType text set formatoptions-=t
" turn off line width hint
autocmd FileType text set colorcolumn=0
" open full screen with macvim
if has("gui_macvim")
set fuoptions=maxvert,maxhorz
au GUIEnter * set fullscreen
endif
if has("gui_running")
" narrow the gui window for text wrangling
autocmd FileType text set columns=80
endif

50
vimrc
View file

@ -1,9 +1,25 @@
" set the directory where my vimrc git project is located
source ~/.vimrc_local
" N.B. put settings that file type specific configs will override here
"
" even with the nice space/tab autodetect, prefer 4 for tab stops
" but let file type specifics override (for instance a setting of 2 for markdown
set ts=4
" default to folding on syntax
set fdm=syntax
" set a readable width
set textwidth=80
" make white space visible, where that matters
set list
" set up folding preferences
set fde=1
" vim's spelling is smart enough for code, to only check comments
set spell
" add a hint for long lines
set colorcolumn=120
" default to expanding tabs, I'm not insane
set expandtab
" source aux files also under git control
let oldwd = getcwd()
@ -26,9 +42,6 @@ syntax on
set number
set relativenumber
" make white space visible, where that matters
set list
" it is a big fat key, after all
let mapleader = "\<Space>"
@ -55,20 +68,13 @@ set sbr=+
" always on status line
set laststatus=2
" set up folding preferences
set fde=1
set fdm=syntax
" let backspace work more naturally
set backspace=start,indent,eol
" set a readable width
set textwidth=80
" favor modern encoding
set enc=utf-8
" more readable config for list mode
set listchars+=nbsp,tab:»·,trail
set listchars-=eol:$
" add a hint for long lines
set colorcolumn=120
" smarter handling of case during search
set ignorecase
set smartcase
@ -133,19 +139,19 @@ nnoremap <Leader>f :Unite -start-insert file_rec/async:!<CR>
" open is OS X only, the closest equiv in line, xdg-open, doesn't allow an
" argument for speciying a particular app
if has('gui_macvim')
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Open current file with app given
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:OpenWith(appname)
noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p")
if v:shell_error
echohl Error
echon "Problem opening the file."
echohl Normal
endif
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Open current file with app given
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:OpenWith(appname)
noautocmd silent execute "!open -a \"" . a:appname . "\" " . expand("%:p")
if v:shell_error
echohl Error
echon "Problem opening the file."
echohl Normal
endif
endfunction
command! -bar -nargs=1 OpenWith call s:OpenWith(<f-args>)
command! -bar -nargs=1 OpenWith call s:OpenWith(<f-args>)
endif
" make sure to set TERM to xterm-256color in terminal program or app