1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 17:25:23 +02:00

[vim] Clean up vimrc, and fix cursor line highlight

This commit is contained in:
Hyacinthe Cartiaux 2014-01-01 17:41:28 +01:00
parent 9e0438762b
commit 008cd08aa3

View file

@ -1,6 +1,23 @@
" vundle """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" https://github.com/shingara/vim-conf/blob/master/vimrc "
" http://blog.shingara.fr/vundle-ou-le-bundler-de-vim.html " .bashrc -- my personal VIM configuration
" see https://github.com/hcartiaux/dotfiles
"
" Copyright (c) 2013 Hyacinthe Cartiaux <Hyacinthe.Cartiaux@uni.lu>
" _
" __ _(_)_ __ ___ _ __ ___
" \ \ / / | '_ ` _ \| '__/ __|
" \ V /| | | | | | | | | (__
" (_)_/ |_|_| |_| |_|_| \___|
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Resources:
" * https://github.com/shingara/vim-conf/blob/master/vimrc
" * http://blog.shingara.fr/vundle-ou-le-bundler-de-vim.html
" * http://vim.wikia.com/wiki/Configuring_the_cursor
" * http://ftp.vim.org/pub/vim/runtime/spell/
" * http://stackoverflow.com/questions/6496778/vim-run-autocmd-on-all-filetypes-except
" * http://vim.wikia.com/wiki/Omni_completion
set rtp+=~/.vim/bundle/vundle/ set rtp+=~/.vim/bundle/vundle/
call vundle#rc() call vundle#rc()
@ -9,10 +26,6 @@ call vundle#rc()
Bundle 'tpope/vim-git' Bundle 'tpope/vim-git'
Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-fugitive'
Bundle 'gregsexton/gitv' Bundle 'gregsexton/gitv'
" nerd plugins
" Bundle 'scrooloose/nerdtree'
" Bundle 'scrooloose/nerdcommenter'
" Bundle 'scrooloose/nerdsnippets'
" syntax highlighting " syntax highlighting
Bundle 'tpope/vim-markdown' Bundle 'tpope/vim-markdown'
Bundle 'vim-ruby/vim-ruby' Bundle 'vim-ruby/vim-ruby'
@ -26,8 +39,6 @@ Bundle 'Lokaltog/vim-powerline'
Bundle 'godlygeek/tabular' Bundle 'godlygeek/tabular'
" Browse tags of source code files. " Browse tags of source code files.
Bundle 'majutsushi/tagbar' Bundle 'majutsushi/tagbar'
" Increment dates
Bundle 'tpope/vim-speeddating'
syntax on syntax on
set background=dark set background=dark
@ -45,7 +56,19 @@ set nostartofline
set laststatus=2 set laststatus=2
set showcmd set showcmd
set showmatch set showmatch
set cursorline set cursorline
hi CursorLine term=bold cterm=bold ctermbg=blue ctermfg=white
" orange in insert mode, red in command mode
" if you want to use rgb color formatting:
" konsoleprofile CustomCursorColor=#255255255
autocmd VimEnter * silent !konsoleprofile UseCustomCursorColor=1
let &t_SI = "\<Esc>]50;CustomCursorColor=orange;BlinkingCursorEnabled=1\x7"
let &t_EI = "\<Esc>]50;CustomCursorColor=red;BlinkingCursorEnabled=0\x7"
silent !konsoleprofile CustomCursorColor=red
autocmd VimLeave * silent !konsoleprofile CustomCursorColor=gray;BlinkingCursorEnabled=0
" Indent " Indent
set cindent set cindent
@ -77,7 +100,6 @@ endif
set viminfo+=n$HOME/.vim/.viminfo set viminfo+=n$HOME/.vim/.viminfo
" Vim 7 spell checker (z=) " Vim 7 spell checker (z=)
" http://ftp.vim.org/pub/vim/runtime/spell/
if has("spell") if has("spell")
setlocal spell spelllang= setlocal spell spelllang=
" Language : FR " Language : FR
@ -103,7 +125,6 @@ au BufRead,BufNewFile *.md set syntax=markdown
" Display trailing white spaces " Display trailing white spaces
set list listchars=tab:\ \ ,trail set list listchars=tab:\ \ ,trail
" Remove trailing white spaces in all files except *.md " Remove trailing white spaces in all files except *.md
" http://stackoverflow.com/questions/6496778/vim-run-autocmd-on-all-filetypes-except
fun! StripTrailingWhitespace() fun! StripTrailingWhitespace()
" Only strip if the b:noStripeWhitespace variable isn't set " Only strip if the b:noStripeWhitespace variable isn't set
if exists('b:noStripWhitespace') if exists('b:noStripWhitespace')
@ -115,13 +136,9 @@ autocmd BufWritePre * call StripTrailingWhitespace()
autocmd FileType markdown let b:noStripWhitespace=1 autocmd FileType markdown let b:noStripWhitespace=1
" Completion, C-X C-O in insert mode, navigation with C-N/C-P " Completion, C-X C-O in insert mode, navigation with C-N/C-P
" http://vim.wikia.com/wiki/Omni_completion
filetype plugin on filetype plugin on
set ofu=syntaxcomplete#Complete set ofu=syntaxcomplete#Complete
map <F3> <Esc>:tabnext<CR> map <F3> <Esc>:tabnext<CR>
map <F2> <Esc>:tabprevious<CR> map <F2> <Esc>:tabprevious<CR>
map <F4> :NERDTreeToggle<CR>
map <F5> :TagbarToggle<CR>
map <F6> <Esc>:set paste<CR> map <F6> <Esc>:set paste<CR>
map <F10> <Esc>:s/"/'/g<CR>