2012-12-04 17:24:40 +01:00
|
|
|
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
|
|
|
|
" /usr/share/vim/vimcurrent/archlinux.vim) and sourced by the call to :runtime
|
|
|
|
" you can find below. If you wish to change any of those settings, you should
|
|
|
|
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
|
|
|
|
" everytime an upgrade of the vim packages is performed. It is recommended to
|
|
|
|
" make changes after sourcing archlinux.vim since it alters the value of the
|
|
|
|
" 'compatible' option.
|
|
|
|
|
|
|
|
" This line should not be removed as it ensures that various options are
|
|
|
|
" properly set to work with the Vim-related packages available in Debian.
|
|
|
|
runtime! archlinux.vim
|
|
|
|
|
|
|
|
|
|
|
|
" For more option refer to /usr/share/vim/vimcurrent/vimrc_example.vim or the
|
|
|
|
" vim manual
|
|
|
|
|
|
|
|
" An example for a vimrc file.
|
|
|
|
"
|
|
|
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
|
|
" Last change: 2008 Jul 02
|
|
|
|
"
|
|
|
|
" To use it, copy it to
|
|
|
|
" for Unix and OS/2: ~/.vimrc
|
|
|
|
" for Amiga: s:.vimrc
|
|
|
|
" for MS-DOS and Win32: $VIM\_vimrc
|
|
|
|
" for OpenVMS: sys$login:.vimrc
|
|
|
|
|
|
|
|
" When started as "evim", evim.vim will already have done these settings.
|
|
|
|
if v:progname =~? "evim"
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2019-03-28 15:26:28 +01:00
|
|
|
if has('nvim')
|
|
|
|
set runtimepath+=/usr/share/vim/vimfiles
|
|
|
|
let g:powerline_loaded = 1
|
|
|
|
endif
|
|
|
|
|
2012-12-04 17:24:40 +01:00
|
|
|
" Use Vim settings, rather then Vi settings (much better!).
|
|
|
|
" This must be first, because it changes other options as a side effect.
|
|
|
|
set nocompatible
|
|
|
|
|
|
|
|
" allow backspacing over everything in insert mode
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
|
|
|
if has("vms")
|
|
|
|
set nobackup " do not keep a backup file, use versions instead
|
|
|
|
else
|
|
|
|
set backup " keep a backup file
|
|
|
|
endif
|
|
|
|
set history=50 " keep 50 lines of command line history
|
|
|
|
"set ruler " show the cursor position all the time
|
|
|
|
if has('cmdline_info')
|
|
|
|
set ruler " show the ruler
|
|
|
|
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
|
|
|
|
set showcmd " show partial commands in status line and
|
|
|
|
" selected characters/lines in visual mode
|
|
|
|
endif
|
|
|
|
|
|
|
|
if has('statusline')
|
|
|
|
set laststatus=2
|
|
|
|
|
|
|
|
" Broken down into easily includeable segments
|
|
|
|
"set statusline=%<%f\ " Filename
|
|
|
|
"set statusline+=%w%h%m%r " Options
|
|
|
|
"set statusline+=\ [%{&ff}/%Y] " filetype
|
|
|
|
"set statusline+=\ [%{getcwd()}] " current dir
|
|
|
|
"set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
|
|
|
|
endif
|
|
|
|
|
|
|
|
"powerline
|
2019-03-28 15:26:28 +01:00
|
|
|
let g:powerline_pycmd = "py3"
|
2012-12-04 17:24:40 +01:00
|
|
|
let g:Powerline_cache_file = "/home/cgirard/.vim/Powerline.cache"
|
|
|
|
"let g:Powerline_symbols = 'fancy'
|
2013-09-09 13:12:59 +02:00
|
|
|
set encoding=utf-8
|
2012-12-04 17:24:40 +01:00
|
|
|
|
|
|
|
set showcmd " display incomplete commands
|
|
|
|
set incsearch " do incremental searching
|
|
|
|
set nu
|
|
|
|
"set tw=80
|
|
|
|
"set wrap
|
2019-03-28 15:26:28 +01:00
|
|
|
set colorcolumn=80
|
2012-12-04 17:24:40 +01:00
|
|
|
set tabstop=8
|
|
|
|
set expandtab
|
|
|
|
set smarttab
|
2019-03-28 15:26:28 +01:00
|
|
|
set shiftwidth=2
|
2012-12-04 17:24:40 +01:00
|
|
|
set shiftround
|
|
|
|
"set autoindent
|
|
|
|
|
|
|
|
|
|
|
|
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
|
|
|
|
" let &guioptions = substitute(&guioptions, "t", "", "g")
|
|
|
|
|
|
|
|
" Don't use Ex mode, use Q for formatting
|
|
|
|
map Q gq
|
|
|
|
|
|
|
|
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
|
|
|
|
" so that you can undo CTRL-U after inserting a line break.
|
|
|
|
inoremap <C-U> <C-G>u<C-U>
|
|
|
|
|
|
|
|
" In many terminal emulators the mouse works just fine, thus enable it.
|
|
|
|
if has('mouse')
|
|
|
|
set mouse=v
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Switch syntax highlighting on, when the terminal has colors
|
|
|
|
" Also switch on highlighting the last used search pattern.
|
|
|
|
if &t_Co > 2 || has("gui_running")
|
|
|
|
syntax on
|
|
|
|
let g:hybrid_use_Xresources = 1
|
2019-03-28 15:26:28 +01:00
|
|
|
"set t_Co=256
|
2019-07-10 14:50:34 +02:00
|
|
|
set background=dark
|
2019-07-10 14:35:03 +02:00
|
|
|
colorscheme hybrid
|
2019-03-28 15:26:28 +01:00
|
|
|
hi Normal ctermbg=none
|
2012-12-04 17:24:40 +01:00
|
|
|
set hlsearch
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Only do this part when compiled with support for autocommands.
|
|
|
|
if has("autocmd")
|
|
|
|
|
|
|
|
" Enable file type detection.
|
|
|
|
" Use the default filetype settings, so that mail gets 'tw' set to 72,
|
|
|
|
" 'cindent' is on in C files, etc.
|
|
|
|
" Also load indent files, to automatically do language-dependent indenting.
|
|
|
|
filetype plugin indent on
|
|
|
|
|
|
|
|
" Put these in an autocmd group, so that we can delete them easily.
|
|
|
|
augroup vimrcEx
|
|
|
|
au!
|
|
|
|
|
|
|
|
" For all text files set 'textwidth' to 78 characters.
|
|
|
|
autocmd FileType text setlocal textwidth=78
|
|
|
|
|
|
|
|
" When editing a file, always jump to the last known cursor position.
|
|
|
|
" Don't do it when the position is invalid or when inside an event handler
|
|
|
|
" (happens when dropping a file on gvim).
|
|
|
|
" Also don't do it when the mark is in the first line, that is the default
|
|
|
|
" position when opening a file.
|
|
|
|
autocmd BufReadPost *
|
|
|
|
\ if line("'\"") > 1 && line("'\"") <= line("$") |
|
|
|
|
\ exe "normal! g`\"" |
|
|
|
|
\ endif
|
|
|
|
|
|
|
|
augroup END
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
set autoindent " always set autoindenting on
|
|
|
|
|
|
|
|
endif " has("autocmd")
|
|
|
|
|
|
|
|
" Convenient command to see the difference between the current buffer and the
|
|
|
|
" file it was loaded from, thus the changes you made.
|
|
|
|
" Only define it when not defined already.
|
|
|
|
if !exists(":DiffOrig")
|
|
|
|
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
|
|
|
|
\ | wincmd p | diffthis
|
|
|
|
endif
|
|
|
|
|
|
|
|
set backupdir=/tmp
|
|
|
|
set pdev=iR5870C
|
|
|
|
set spelllang=fr
|
|
|
|
" set spell
|
|
|
|
|
|
|
|
" Buffers - explore/next: F12, Shift-F12.
|
|
|
|
nnoremap <silent> <F12> :BufExplorer<CR>
|
|
|
|
nnoremap <silent> <S-F12> :bn<CR>
|
|
|
|
|
|
|
|
" Open and close the taglist.vim separately
|
2019-03-28 15:26:28 +01:00
|
|
|
nmap <F7> :TlistToggle<CR>
|
|
|
|
" Split to the right side of the screen
|
|
|
|
let g:Tlist_Use_Left_Window = 1
|
|
|
|
" Set the window width
|
|
|
|
let g:Tlist_WinWidth = 40
|
|
|
|
" Sort by the order
|
|
|
|
let g:Tlist_Sort_Type = "order"
|
|
|
|
" Do not display the help info
|
|
|
|
let g:Tlist_Compact_Format = 1
|
|
|
|
" If you are the last, kill yourself
|
|
|
|
let g:Tlist_Exit_OnlyWindow = 1
|
|
|
|
" Do not close tags for other files
|
|
|
|
let g:Tlist_File_Fold_Auto_Close = 1
|
|
|
|
" Do not show folding tree
|
|
|
|
let g:Tlist_Enable_Fold_Column = 0
|
|
|
|
" Always display one file tags
|
|
|
|
let g:Tlist_Show_One_File = 1
|
2012-12-04 17:24:40 +01:00
|
|
|
|
|
|
|
" Open and close the NERD_tree.vim separately
|
2019-03-28 15:26:28 +01:00
|
|
|
nmap <F8> :NERDTreeToggle<CR>
|
2012-12-04 17:24:40 +01:00
|
|
|
let g:NERDTreeChDirMode=0
|
2019-03-28 15:26:28 +01:00
|
|
|
" Set the window width
|
|
|
|
let g:NERDTreeWinSize = 23
|
|
|
|
" Set the window position
|
|
|
|
let g:NERDTreeWinPos = "right"
|
|
|
|
" Auto centre
|
|
|
|
let g:NERDTreeAutoCenter = 0
|
|
|
|
" Not Highlight the cursor line
|
|
|
|
let g:NERDTreeHighlightCursorline = 0
|
2012-12-04 17:24:40 +01:00
|
|
|
|
|
|
|
" LaTeX Suite
|
|
|
|
set grepprg=grep\ -nH\ $*
|
|
|
|
let g:tex_flavor = "latex"
|
|
|
|
|
|
|
|
" XML Folding
|
|
|
|
let g:xml_syntax_folding=1
|
|
|
|
au FileType xml setlocal foldmethod=syntax
|
|
|
|
|
|
|
|
" Perl Folding
|
|
|
|
let perl_fold=1
|
|
|
|
|
2019-03-28 15:26:28 +01:00
|
|
|
" sh folding
|
|
|
|
let g:sh_fold_enabled= 3
|
|
|
|
|
2012-12-04 17:24:40 +01:00
|
|
|
" highlight whitespaces
|
|
|
|
highlight ExtraWhitespace ctermbg=red guibg=red
|
|
|
|
match ExtraWhitespace /\s\+$/
|
|
|
|
|
|
|
|
nmap <silent> <C-n> :exec &nu==&rnu? "se nu!" : "se rnu!"<CR>
|
|
|
|
|
|
|
|
" Turn on the WiLd menu
|
|
|
|
set wildmenu
|
|
|
|
" Ignore compiled files
|
|
|
|
set wildignore=*.o,*~,*.pyc
|
|
|
|
|
|
|
|
" Calendar
|
|
|
|
let g:calendar_monday = 1
|
|
|
|
|
|
|
|
" Syntastic
|
|
|
|
let g:syntastic_enable_signs=1
|
|
|
|
let g:syntastic_auto_loc_list=1
|
2019-03-28 15:26:28 +01:00
|
|
|
"let g:syntastic_mode_map = { 'mode': 'active',
|
|
|
|
" \ 'active_filetypes': ['ruby', 'php', 'perl'],
|
|
|
|
" \ 'passive_filetypes': ['puppet'] }
|
2013-09-09 13:15:06 +02:00
|
|
|
let g:syntastic_perl_checkers=['perl', 'perlcritic']
|
2019-03-28 15:26:28 +01:00
|
|
|
let g:syntastic_enable_perl_checker=1
|
2012-12-04 17:24:40 +01:00
|
|
|
|
|
|
|
" Source the vimrc file after saving it
|
|
|
|
if has("autocmd")
|
|
|
|
autocmd bufwritepost .vimrc source $MYVIMRC
|
|
|
|
endif
|
2019-03-28 15:26:28 +01:00
|
|
|
|
|
|
|
let g:indent_guides_enable_on_vim_startup = 1
|
|
|
|
let g:indent_guides_auto_colors = 0
|
|
|
|
let g:indent_guides_guide_size = 1
|
|
|
|
let g:indent_guides_start_level = 2
|
|
|
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=237
|
|
|
|
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=240
|
|
|
|
|