htg-public/shell/vimrc

176 lines
5.3 KiB
VimL
Raw Normal View History

2017-05-12 05:15:39 +02:00
set nocompatible " be iMproved, required
"~ filetype off " required
"~
"~ " set the runtime path to include Vundle and initialize
"~ set rtp+=~/.vim/bundle/Vundle.vim
"~ call vundle#begin()
"~ " alternatively, pass a path where Vundle should install plugins
"~ "call vundle#begin('~/some/path/here')
"~
"~ " let Vundle manage Vundle, required
"~ Plugin 'VundleVim/Vundle.vim'
"~
"~ " The following are examples of different formats supported.
"~ " Keep Plugin commands between vundle#begin/end.
"~ " plugin on GitHub repo
"~ "##Plugin 'tpope/vim-fugitive'
"~ " plugin from http://vim-scripts.org/vim/scripts.html
"~ "##Plugin 'L9'
"~ " Git plugin not hosted on GitHub
"~ "##Plugin 'git://git.wincent.com/command-t.git'
"~ " git repos on your local machine (i.e. when working on your own plugin)
"~ ""Plugin 'file:///home/gmarik/path/to/plugin'
"~ " The sparkup vim script is in a subdirectory of this repo called vim.
"~ " Pass the path to set the runtimepath properly.
"~ "##Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"~ " Install L9 and avoid a Naming conflict if you've already installed a
"~ " different version somewhere else.
"~ ""Plugin 'ascenator/L9', {'name': 'newL9'}
"~
"~ " ça va pas, il casse tout
"~ "Plugin 'leafgarland/typescript-vim'
"~
"~ " All of your Plugins must be added before the following line
"~ call vundle#end() " required
"~ filetype plugin indent on " required
"~ " To ignore plugin indent changes, instead use:
"~ "filetype plugin on
"~ "
"~ " Brief help
"~ " :PluginList - lists configured plugins
"~ " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
"~ " :PluginSearch foo - searches for foo; append `!` to refresh local cache
"~ " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"~ "
"~ " see :h vundle for more details or wiki for FAQ
"~ " Put your non-Plugin stuff after this line
2017-05-12 05:15:39 +02:00
set nocompatible
set showcmd
set wildmenu
set backspace=eol,start,indent
syntax on
filetype plugin indent on
2017-05-12 05:15:39 +02:00
set mouse=v
set number
colorscheme zellner
highlight LineNr ctermfg=yellow
"set autoindent
set smartindent
set cindent
set expandtab
set tabstop=4
retab
set shiftwidth=4
set ruler
set softtabstop=4
" warn > 79
highlight OverLength ctermbg=black ctermfg=gray guibg=#592929
match OverLength /\%80v.\+/
""highlight ColorColumn ctermbg=gray
""set colorcolumn=80
" language
""set spell spelllang=en_us
set spell spelllang=fr
set complete+=k
" save
inoremap <F3> <c-o>:up<cr>
" remove trailing spaces
nnoremap <silent> <F5> :let _s=@/ <Bar> :%s/\s\+$//e <Bar> :let @/=_s <Bar> :nohl <Bar> :unlet _s <CR>
" hit <enter> by mistake
inoremap <F7> <C-C>"_dd<bs>a
2017-05-12 05:15:39 +02:00
" j but create newline
inoremap <F9> <c-c>o
set nospell
" quick diff buffer vs save
command D :w !colordiff -u % -
command L :w !colordiff -u % - | less -R
2017-05-12 05:15:39 +02:00
" force unix mode on write
""set ff=unix
2017-05-12 05:15:39 +02:00
" copy-paste using X buffers
map <F7> :w !xclip<CR><CR>
vmap <F7> "*y
map <S-F7> :r!xclip -o<CR>
" line numbers in netrw file explorer
let g:netrw_bufsettings = 'noma nomod nu nobl nowrap ro'
" status line
set laststatus=2
2017-06-05 12:48:30 +02:00
" netrw ignore pyc
let g:netrw_list_hide= '.*\.pyc$,.*\.o$,.*\.out$'
" no wildmenu completion for
set wildignore+=*.a,*.o
set wildignore+=*.bmp,*.gif,*.ico,*.jpg,*.png
set wildignore+=.DS_Store,.git,.hg,.svn
set wildignore+=*~,*.swp,*.swo,*.tmp
" drop undo/redo history
command Z :set undoreload=0|edit
2017-06-08 17:10:20 +02:00
" show/hide special chars with :set (un)list
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
2017-05-12 05:15:39 +02:00
highlight ExtraWhitespace ctermbg=red guibg=red
augroup WhitespaceMatch
" Remove ALL autocommands for the WhitespaceMatch group.
autocmd!
autocmd BufWinEnter * let w:whitespace_match_number =
\ matchadd('ExtraWhitespace', '\s\+$')
autocmd InsertEnter * call s:ToggleWhitespaceMatch('i')
autocmd InsertLeave * call s:ToggleWhitespaceMatch('n')
augroup END
function! s:ToggleWhitespaceMatch(mode)
let pattern = (a:mode == 'i') ? '\s\+\%#\@<!$' : '\s\+$'
if exists('w:whitespace_match_number')
call matchdelete(w:whitespace_match_number)
call matchadd('ExtraWhitespace', pattern, 10, w:whitespace_match_number)
else
" Something went wrong, try to be graceful.
let w:whitespace_match_number = matchadd('ExtraWhitespace', pattern)
endif
endfunction
""" move
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
""" tell vim where to place new split
set splitbelow
set splitright
" spelling mistakes colors
hi clear SpellBad
hi SpellBad ctermfg=yellow
hi SpellBad ctermbg=red
" tabline color
hi TabLineFill ctermfg=DarkGreen ctermbg=DarkGreen
hi TabLine ctermfg=Blue ctermbg=Yellow
hi TabLineSel ctermfg=Red ctermbg=Yellow
"
command T :tabedit
command B :buffers
" current line number
hi cursorline cterm=none ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
hi CursorLineNr cterm=none
set cursorline
2018-11-04 19:44:29 +01:00
" pageup pagedown
nnoremap <PageUp> :echo ""<CR>
vnoremap <PageUp> :<C-u>echo ""<CR>
inoremap <PageUp> <C-o>:echo ""<CR>
nnoremap <PageDown> :echo ""<CR>
vnoremap <PageDown> :<C-u>echo ""<CR>
inoremap <PageDown> <C-o>:echo ""<CR>
nnoremap <S-PageUp> :echo ""<CR>
vnoremap <S-PageUp> :<C-u>echo ""<CR>
inoremap <S-PageUp> <C-o>:echo ""<CR>
nnoremap <S-PageDown> :echo ""<CR>
vnoremap <S-PageDown> :<C-u>echo ""<CR>
inoremap <S-PageDown> <C-o>:echo ""<CR>