vi/.vimrc
Samuel Aubertin 5cce2032be first commit
2023-11-25 12:07:22 +01:00

98 lines
3.1 KiB
VimL

set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'scrooloose/syntastic'
"Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-surround'
Plugin 'vim-airline/vim-airline'
call vundle#end()
"Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_c_compiler = "clang"
function! SyntasticCheckHook(errors)
if !empty(a:errors)
let g:syntastic_loc_list_height = min([len(a:errors), 6])
endif
endfunction
"Airline
let g:airline_powerline_fonts = 0
let g:airline#extensions#whitespace#checks = [ ]
let g:airline#extensions#whitespace#mixed_indent_algo = 0
set noshowmode " to get rid of thing like --INSERT--
set noshowcmd " to get rid of display of last command
set shortmess+=F " to get rid of the file name displayed in the command line bar
"Global options
set backspace=indent,eol,start "allow backspacing over everything in insert mode
set history=500 "keep 50 lines of command line history
set ruler "show the cursor position all the time
set showcmd "display incomplete commands
set incsearch "do incremental searching
set nu "show line numbers
"set expandtab "use spaces instead of tabs
"set tabstop=4 "insert 4 spaces whenever the tab key is pressed
"set shiftwidth=4 "set indentation to 4 spaces
set hlsearch "highlight search terms
set ic "Ignore Case during searches
set autoindent "start new line at the same indentation level
syntax enable "syntax highlighting
set cmdheight=1 "The commandbar height
set showmatch "Show matching bracets when text indicator is over them
set nobackup " do not keep backup files, it's 70's style cluttering
set noswapfile " do not write annoying intermediate swap files,
set ttimeoutlen=50 "Solves: there is a pause when leaving insert mode
set splitbelow " Horizontal splits open below current file
set splitright " Vertical splits open to the right of the current file
set wildmode=longest,list " Pressing <Tab> shows command suggestions similar
set t_Co=256
colorscheme mustang
set encoding=utf-8 " The encoding displayed.
set fileencoding=utf-8 " The encoding written to file
"hi ColorColumn ctermbg=235
"let &colorcolumn=join(range(81,999),",")
autocmd FileType latex,tex,md,markdown setlocal spell spelllang=en,fr
hi clear SpellBad
hi SpellBad cterm=underline
highlight clear SpellBad
highlight clear SpellCap
highlight clear SpellLocal
highlight clear SpellRare
highlight SpellBad cterm=underline,bold
highlight SpellCap cterm=underline
highlight SpellLocal cterm=underline
highlight SpellRare cterm=underline
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
au BufNewFile,BufRead *.c,*.h
\ set autoindent |
\ set fileformat=unix
inoremap { {}<Esc>ha
inoremap ( ()<Esc>ha
inoremap [ []<Esc>ha
inoremap " ""<Esc>ha
inoremap ' ''<Esc>ha
inoremap ` ``<Esc>ha