...
 
Commits (5)
autocmd BufRead,BufNewFile *.dot setlocal filetype=dot
autocmd BufRead,BufNewFile *.gv setlocal filetype=dot
let b:ml_commentstring = '; %s'
setlocal noexpandtab
" This has been replaced by the bindzone filetype
:runtime! ftplugin/bindzone.vim
" Set the modeline to use a single line comment
let b:ml_commentstring = '// %s'
" Only set the b:ml_commentstring if it hasn't already been set
if !exists("b:ml_commentstring")
" Add whitespace to the modeline commentstring
let b:ml_commentstring = '<!-- %s -->'
end
" Set the modeline to use a single line comment
let b:ml_commentstring = '// %s'
setlocal commentstring=#%s
setlocal commentstring=#\ %s
" Make vim turn *off* expandtab for Make files. We need the tab literal
setlocal noexpandtab
setlocal wrap
" Set a custom commentstring for the modeline
let b:ml_commentstring = '[_modeline]: # (%s )'
let b:ml_commentstring = '[_modeline]: # ( %s )'
" Set the modeline to use a single line comment
let b:ml_commentstring = '// %s'
setlocal commentstring=#%s
setlocal commentstring=#\ %s
" Set the modeline to use a single line comment
let b:ml_commentstring = '// %s'
" Set the modeline to use a single line comment
let b:ml_commentstring = '-- %s'
" Set the modeline to use a single line comment
let b:ml_commentstring = '// %s'
" Set the modeline to use a single line comment
let b:ml_commentstring = '-- %s'
" Set the modeline to use a single line comment
let b:ml_commentstring = '" %s'
setlocal shiftwidth=2
setlocal tabstop=2
setlocal softtabstop=2
ghmarkdown.vim
\ No newline at end of file
" This has been replaced by the ghmarkdown syntax
:runtime! syntax/ghmarkdown.vim
......@@ -17,7 +17,6 @@ set backspace=2 " Make Backspace work like you expect
set formatoptions+=ro " Automatically insert the comment character when you
" hit <Enter> (r) or o/O (o) in a comment block
set showbreak=└\ " Prefix wrapped continuation lines with '└ '
set commentstring=#%s " The default comment style for line comments
let mapleader='\' " The <leader> key for key maps
syntax enable " Syntax highlighting
filetype plugin on " Enable the filetype plugin
......@@ -38,9 +37,9 @@ set incsearch " Begin matching query as you type it
set hlsearch " Highlight search matches
" Enable modeline
set modeline
set modelines=5
" Modeline options
set modeline " Enable the Vim modeline in files
set modelines=5 " The number of lines to check for :set commands
" Code folding
......@@ -57,13 +56,13 @@ colorscheme solarized
cmap w!! w !sudo tee > /dev/null %
" Show invisible characters with `:set list!` or <F10>
" Show invisible characters. Toggle with <F10>
set nolist
set listchars=tab:\|·,trail:·,nbsp:¤,extends:>,precedes:<,eol:¬
nnoremap <F10> :set list!<CR>
" Put a vertical ruler in columns 81 and 121
" Put a vertical ruler in columns 81 and 121. Toggle with <F9>
highlight ColorColumn ctermbg=magenta
nnoremap <F9> :call ToggleColorColumn()<CR>
function! ToggleColorColumn()
......@@ -75,16 +74,12 @@ function! ToggleColorColumn()
endfunction
" Associate extensions to filetypes
autocmd BufRead,BufNewFile *.gv setlocal filetype=dot
" Set the terminal title to reflect the open file. Even works with Vim tabs.
autocmd BufEnter * let &titlestring = expand("%:t") . " - %{$USER}@" . hostname() | setlocal title
autocmd VimLeave * let &titleold = $USER . "@" . hostname() | setlocal title
" Append a modeline at the end of a file.
" Append a modeline at the end of a file. Call with `<leader>ml`
"
" By default, it formats the modeline as a line comment so it gets ignored by
" anything that isn't Vim. You can override the commentstring by setting
......@@ -93,60 +88,9 @@ nnoremap <leader>ml :call AppendModeline()<CR>
function! AppendModeline()
" Prefer b:ml_commentstring if it is set, otherwise use commentstring
let l:commentstring = get(b:, 'ml_commentstring', &commentstring)
let l:modeline = printf(l:commentstring, printf(" vi: set ts=%d sw=%d %set %sft=%s:", &ts, &sw, &et ? '' : 'no', &wrap ? 'wrap ' : '', &ft))
let l:modeline = printf(l:commentstring, printf("vi: set ts=%d sw=%d %set %sft=%s:", &ts, &sw, &et ? '' : 'no', &wrap ? 'wrap ' : '', &ft))
call append(line("$"), l:modeline)
endfunction
" Filetype specific settings
autocmd FileType diff setlocal noet
autocmd FileType dot setlocal commentstring=//%s
autocmd FileType dns setlocal commentstring=;%s
autocmd FileType gitconfig setlocal commentstring=;%s
autocmd FileType go setlocal commentstring=//%s
autocmd FileType html setlocal commentstring=<!--%s-->
autocmd FileType less setlocal commentstring=/*%s*/
autocmd FileType php setlocal commentstring=//%s
autocmd FileType plsql setlocal commentstring=--%s
autocmd FileType sass setlocal commentstring=//%s
autocmd FileType sql setlocal commentstring=--%s
autocmd FileType vim setlocal commentstring=\"%s
autocmd FileType yaml,ansible setlocal tabstop=2 shiftwidth=2 softtabstop=2
" Map numpad keys in insert and command-line mode
"noremap! <Esc>Oq 1
"noremap! <Esc>Or 2
"noremap! <Esc>Os 3
"noremap! <Esc>Ot 4
"noremap! <Esc>Ou 5
"noremap! <Esc>Ov 6
"noremap! <Esc>Ow 7
"noremap! <Esc>Ox 8
"noremap! <Esc>Oy 9
"noremap! <Esc>Op 0
"noremap! <Esc>On .
"noremap! <Esc>OQ /
"noremap! <Esc>OR *
"noremap! <Esc>Ol +
"noremap! <Esc>OS -
"noremap! <Esc>OM <Enter>
" Map numpad keys in all other modes
"noremap <Esc>Oq 1
"noremap <Esc>Or 2
"noremap <Esc>Os 3
"noremap <Esc>Ot 4
"noremap <Esc>Ou 5
"noremap <Esc>Ov 6
"noremap <Esc>Ow 7
"noremap <Esc>Ox 8
"noremap <Esc>Oy 9
"noremap <Esc>Op 0
"noremap <Esc>On .
"noremap <Esc>OQ /
"noremap <Esc>OR *
"noremap <Esc>Ol +
"noremap <Esc>OS -
"noremap <Esc>OM <Enter>
" vi: set ts=4 sw=4 et ft=vim: