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 @@ ...@@ -45,3 +45,6 @@
[submodule "bundle/vim-fugitive"] [submodule "bundle/vim-fugitive"]
path = bundle/vim-fugitive path = bundle/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git 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> ...@@ -62,10 +62,10 @@ noremap > :tabn<CR>
noremap <leader>, :bp<CR> noremap <leader>, :bp<CR>
noremap <leader>. :bn<CR> noremap <leader>. :bn<CR>
command! C let @/="" command! C let @/=""
cmap w!! w !sudo tee >/dev/null % cnoremap w!! w !sudo tee >/dev/null %
noremap cy "*y noremap <leader>P "*p
noremap cp "*p
noremap <leader>p "+p noremap <leader>p "+p
noremap <leader>Y "*y
noremap <leader>y "+y noremap <leader>y "+y
inoremap <Down> <C-o>gj inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk inoremap <Up> <C-o>gk
...@@ -73,17 +73,17 @@ nnoremap <Down> gj ...@@ -73,17 +73,17 @@ nnoremap <Down> gj
nnoremap <Up> gk nnoremap <Up> gk
execute pathogen#infect() 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 colorscheme molokai
if !empty($MAN_PN)
autocmd StdinReadPost * set ft=man | file $MAN_PN
endif
" From http://vi.stackexchange.com/questions/258/ " From http://vi.stackexchange.com/questions/258/
autocmd BufWritePre *.sh if !filereadable(expand('%')) | let b:is_new = 1 | endif 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 BufWritePost *.sh if get(b:, 'is_new', 0) | silent execute '!chmod +x %' | endif
autocmd FileType help wincmd L
let g:SuperTabDefaultCompletionType = "context" let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabClosePreviewOnPopupClose = 1 let g:SuperTabClosePreviewOnPopupClose = 1
...@@ -101,32 +101,33 @@ let g:ctrlp_prompt_mappings = { ...@@ -101,32 +101,33 @@ let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'], \ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'], \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ } \ }
let g:DiffColors = 100
if has('cscope') let g:DiffUnit="Word3"
set cscopetag cscopeverbose let g:DiffUpdate=1
if has('quickfix') " if has('cscope')
set cscopequickfix=s-,c-,d-,i-,t-,e- " set cscopetag cscopeverbose
endif "
" if has('quickfix')
cnoreabbrev csa cs add " set cscopequickfix=s-,c-,d-,i-,t-,e-
cnoreabbrev csf cs find " endif
cnoreabbrev csk cs kill "
cnoreabbrev csr cs reset " cnoreabbrev csa cs add
" cnoreabbrev css cs show " cnoreabbrev csf cs find
cnoreabbrev csh cs help " cnoreabbrev csk cs kill
" cnoreabbrev csr cs reset
command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src " " cnoreabbrev css cs show
endif " cnoreabbrev csh cs help
"
" command -nargs=0 Cscope cs add $VIMSRC/src/cscope.out $VIMSRC/src
" endif
" From http://vi.stackexchange.com/questions/239/ " From http://vi.stackexchange.com/questions/239/
if @% == "" && getcwd() == "/tmp" " with exception for reading manpages
:silent edit test.sh if empty($MAN_PN) && @% == "" && getcwd() == "/tmp"
silent find test.*
endif endif
let g:DiffColors = 100
let g:DiffUnit="Word1"
" function LookupFiles () " function LookupFiles ()
" python <<EOF " python <<EOF
" from os.path import * " from os.path import *
...@@ -151,6 +152,10 @@ let g:DiffUnit="Word1" ...@@ -151,6 +152,10 @@ let g:DiffUnit="Word1"
" From http://vi.stackexchange.com/questions/2009/ " From http://vi.stackexchange.com/questions/2009/
function! FindInPath(name) function! FindInPath(name)
" Force creation of new file for paths beginning with ./
if a:name =~ './*'
return 0
endif
let path=&path let path=&path
" Add any extra directories to the normal search path " Add any extra directories to the normal search path
set path+=~,~/.vim,/etc set path+=~,~/.vim,/etc
...@@ -170,6 +175,4 @@ autocmd FileType * exec("setlocal dictionary+=".$HOME."/.vim/dictionary/".expand ...@@ -170,6 +175,4 @@ autocmd FileType * exec("setlocal dictionary+=".$HOME."/.vim/dictionary/".expand
set completeopt+=menuone,longest,preview set completeopt+=menuone,longest,preview
set complete+=k set complete+=k
if !empty($CONFLOCAL) runtime local/$CONFLOCAL.vim
source $HOME/.vim/local/$CONFLOCAL.vim
endif
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