Commit 403f7f39 authored by Murukesh Mohanan's avatar Murukesh Mohanan

Several changes

 * Settings for using Vim as pager for man
 * Cleanup and re-arrangement of files following
   http://vim.wikia.com/wiki/Keep_your_vimrc_file_clean
parent df77f7ae
......@@ -45,3 +45,6 @@
[submodule "bundle/vim-fugitive"]
path = bundle/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git
[submodule "bundle/AnsiEsc.vim"]
path = bundle/AnsiEsc.vim
url = https://github.com/vim-scripts/AnsiEsc.vim
setlocal nolist
setlocal readonly
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
setlocal nomodifiable
function! PrepManPager()
setlocal modifiable
if !empty ($MAN_PN)
silent %! col -b
file $MAN_PN
endif
setlocal nomodified
setlocal nomodifiable
endfunction
autocmd BufEnter $MAN_PN call PrepManPager()
nnoremap q :q!<CR>
AnsiEsc.vim @ d2bb7878
Subproject commit d2bb7878622e4c16203acf1c92a0f4bc7ac58003
diffchar.vim @ 890b3fd9
Subproject commit 5a124d56a2684dea1d37d26dd4a2d90d56399a88
Subproject commit 890b3fd9918ee6ce9a8cf930a8eaa9c3b29b7d2e
supertab @ 43b98dd2
Subproject commit feb2a5f837f6ece9967863a4fb427fec33702aa7
Subproject commit 43b98dd2c74977a02473d923c159d4110c94273e
syntastic @ 47c70b3e
Subproject commit 7014a52acefa594d45c40b3eaefee70549bdcaeb
Subproject commit 47c70b3e1e388d8f9cc7c6d9687efc047df843ac
autocmd BufNewFile,BufRead *.pro set filetype=prolog
autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd BufNewFile,BufRead */debian/rules.d/* set filetype=make
setlocal spell textwidth=72
......@@ -62,10 +62,10 @@ noremap > :tabn<CR>
noremap <leader>, :bp<CR>
noremap <leader>. :bn<CR>
command! C let @/=""
cmap w!! w !sudo tee >/dev/null %
noremap cy "*y
noremap cp "*p
cnoremap w!! w !sudo tee >/dev/null %
noremap <leader>P "*p
noremap <leader>p "+p
noremap <leader>Y "*y
noremap <leader>y "+y
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
......@@ -73,17 +73,17 @@ nnoremap <Down> gj
nnoremap <Up> gk
execute pathogen#infect()
autocmd BufNewFile,BufRead *.pro set syntax=prolog
autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd BufNewFile,BufRead */debian/rules.d/* set filetype=make
autocmd Filetype gitcommit setlocal spell textwidth=72
autocmd Bufenter *.hs compiler ghc
colorscheme molokai
if !empty($MAN_PN)
autocmd StdinReadPost * set ft=man | file $MAN_PN
endif
" From http://vi.stackexchange.com/questions/258/
autocmd BufWritePre *.sh if !filereadable(expand('%')) | let b:is_new = 1 | endif
autocmd BufWritePost *.sh if get(b:, 'is_new', 0) | silent execute '!chmod +x %' | endif
autocmd FileType help wincmd L
let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabClosePreviewOnPopupClose = 1
......@@ -101,32 +101,33 @@ let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ }
if has('cscope')
set cscopetag cscopeverbose
if has('quickfix')
set cscopequickfix=s-,c-,d-,i-,t-,e-
endif
cnoreabbrev csa cs add
cnoreabbrev csf cs find
cnoreabbrev csk cs kill
cnoreabbrev csr cs reset
" cnoreabbrev css cs show
cnoreabbrev csh cs help
command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src
endif
let g:DiffColors = 100
let g:DiffUnit="Word3"
let g:DiffUpdate=1
" if has('cscope')
" set cscopetag cscopeverbose
"
" if has('quickfix')
" set cscopequickfix=s-,c-,d-,i-,t-,e-
" endif
"
" cnoreabbrev csa cs add
" cnoreabbrev csf cs find
" cnoreabbrev csk cs kill
" cnoreabbrev csr cs reset
" " cnoreabbrev css cs show
" cnoreabbrev csh cs help
"
" command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src
" endif
" From http://vi.stackexchange.com/questions/239/
if @% == "" && getcwd() == "/tmp"
:silent edit test.sh
" with exception for reading manpages
if empty($MAN_PN) && @% == "" && getcwd() == "/tmp"
silent find test.*
endif
let g:DiffColors = 100
let g:DiffUnit="Word1"
" function LookupFiles ()
" python <<EOF
" from os.path import *
......@@ -151,6 +152,10 @@ let g:DiffUnit="Word1"
" From http://vi.stackexchange.com/questions/2009/
function! FindInPath(name)
" Force creation of new file for paths beginning with ./
if a:name =~ './*'
return 0
endif
let path=&path
" Add any extra directories to the normal search path
set path+=~,~/.vim,/etc
......@@ -170,6 +175,4 @@ autocmd FileType * exec("setlocal dictionary+=".$HOME."/.vim/dictionary/".expand
set completeopt+=menuone,longest,preview
set complete+=k
if !empty($CONFLOCAL)
source $HOME/.vim/local/$CONFLOCAL.vim
endif
runtime local/$CONFLOCAL.vim
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment