myconfig

my config files
git clone https://a3nm.net/git/myconfig/
Log | Files | Refs | README

vimrc (4134B)


      1 call pathogen#infect('bundle/{}')
      2 call pathogen#helptags()
      3 
      4 " personal stuff
      5 source ~/.vim/perso
      6 
      7 set synmaxcol=200
      8 
      9 set nocompatible
     10 
     11 set autoindent
     12 set expandtab
     13 set softtabstop=2
     14 set shiftwidth=2
     15 " set softtabstop=4
     16 " set shiftwidth=4
     17 
     18 set iskeyword+=-
     19 
     20 set incsearch
     21 syntax on
     22 set background=dark
     23 
     24 filetype on
     25 filetype plugin on
     26 filetype indent on
     27 
     28 " autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
     29 " autocmd FileType html,xhtml,xml,htmldjango,jinjahtml,eruby,mako source ~/.vim/bundle/closetag/plugin/closetag.vim
     30 
     31 set ofu=syntaxcomplete#Complete
     32 let g:SuperTabDefaultCompletionType = "context"
     33 
     34 set ignorecase
     35 set smartcase
     36 
     37 set scrolloff=4
     38 
     39 set notitle
     40 
     41 set wildmenu
     42 set wildmode=longest,list
     43 set ttyfast
     44 set lbr
     45 
     46 set encoding=utf8
     47 
     48 set hidden
     49 nnoremap ' `
     50 nnoremap ` '
     51 set history=1000
     52 runtime macros/matchit.vim
     53 
     54 set shortmess=atI
     55 
     56 set viminfo='100,n~/.viminfo
     57 
     58 set tw=80
     59 
     60 
     61 map ZW :w<CR>
     62 map ZM :w<CR>:make<CR>
     63 map ZO :CommandT<CR>
     64 map ZB :CommandTBuffer<CR>
     65 
     66 
     67 :nnoremap <F8> :setl noai nocin nosi inde=<CR>
     68 
     69 :cnoreabbrev W w
     70 
     71 " map c :CommandTBuffer<CR>
     72 
     73 " TODO don't steal focus
     74 map ZE :exe "silent !my_evince_forward_search " . expand("%:p") . " " . line(".") . "&"<CR><C-l>
     75 
     76 " TODO a mapping to reindent decently
     77 
     78 set nojoinspaces
     79 set showcmd
     80 
     81 " makes vim very slow on emails
     82 " http://vi.stackexchange.com/q/5128/4819
     83 "set matchpairs+=<:> 
     84 
     85 set nomodeline
     86 
     87 set backup
     88 set backupdir=~/temp/vim/temp
     89 set directory=~/temp/vim/backup
     90 
     91 "let g:solarized_termtrans=1
     92 "let g:solarized_termcolors=256
     93 "let g:solarized_contrast="high"
     94 "let g:solarized_visibility="high"
     95 "colorscheme solarized
     96 
     97 nnoremap <F5> :GundoToggle<CR>
     98 
     99 " au BufNewFile,BufRead *.py
    100 "     \ set tabstop=4
    101 "     \ set softtabstop=4
    102 "     \ set shiftwidth=4
    103 "     \ set textwidth=80
    104 "     \ set smarttab
    105 "     \ set expandtab
    106 " 
    107 
    108 set noesckeys
    109 
    110 " joining lines shouldn't move cursor
    111 " http://stackoverflow.com/a/9506063/414272
    112 "nnoremap <silent> J :let p=getpos('.')<bar>join<bar>call setpos('.', p)<cr>
    113 
    114 
    115 let g:vim_markdown_math=1
    116 
    117 set nofoldenable
    118 
    119 " regenerate spell files at startup, in case they were modified elsewhere
    120 " http://vi.stackexchange.com/a/5052/4819
    121 for d in glob('~/.vim/spell/*.add', 1, 1)
    122     if filereadable(d) && (!filereadable(d . '.spl') || getftime(d) > getftime(d . '.spl'))
    123         silent exec 'mkspell! ' . fnameescape(d)
    124     endif
    125 endfor
    126 
    127 " avoid https://vi.stackexchange.com/questions/5128/matchpairs-makes-vim-slow
    128 let g:matchparen_timeout = 20
    129 let g:matchparen_insert_timeout = 20
    130 
    131 if has('persistent_undo')
    132   set undofile
    133   set undodir=$HOME/temp/vim/undo
    134 endif
    135 
    136 " unnamedplus or unnamed
    137 set clipboard=unnamedplus
    138 
    139 " no mouse
    140 set mouse=
    141 
    142 " nmap Q q:
    143 
    144 set hlsearch
    145 
    146 noremap <silent> <Leader>w :call ToggleWrap()<CR>
    147 function ToggleWrap()
    148   if &tw
    149     echo "Wrap ON"
    150     setlocal tw=0
    151     setlocal linebreak nolist
    152     setlocal display+=lastline
    153     noremap  <buffer> <silent> <Up>   gk
    154     noremap  <buffer> <silent> k   gk
    155     noremap  <buffer> <silent> <Down> gj
    156     noremap  <buffer> <silent> j gj
    157     noremap  <buffer> <silent> <Home> g<Home>
    158     noremap  <buffer> <silent> 0 g0
    159     noremap  <buffer> <silent> ^ g^
    160     noremap  <buffer> <silent> <End>  g<End>
    161     noremap  <buffer> <silent> $  g$
    162   else
    163     echo "Wrap OFF"
    164     setlocal tw=80
    165     silent! nunmap <buffer> <Up>
    166     silent! nunmap <buffer> <Down>
    167     silent! nunmap <buffer> <Home>
    168     silent! nunmap <buffer> <End>
    169     silent! nunmap <buffer> j
    170     silent! nunmap <buffer> k
    171     silent! nunmap <buffer> ^
    172     silent! nunmap <buffer> 0
    173     silent! nunmap <buffer> $
    174   endif
    175 endfunction
    176 
    177 " add .tex when doing gf
    178 set suffixesadd+=.tex
    179 
    180 "Uncomment to override defaults:
    181 "let g:instant_markdown_slow = 1
    182 "let g:instant_markdown_autostart = 0
    183 "let g:instant_markdown_open_to_the_world = 1
    184 "let g:instant_markdown_allow_unsafe_content = 1
    185 "let g:instant_markdown_allow_external_content = 0
    186 "let g:instant_markdown_mathjax = 1
    187 "let g:instant_markdown_mermaid = 1
    188 "let g:instant_markdown_logfile = '/tmp/instant_markdown.log'
    189 let g:instant_markdown_autoscroll = 1
    190 "let g:instant_markdown_port = 8888
    191 let g:instant_markdown_python = 1