dotfiles/vim/.vim/config/base.vim

119 lines
2.6 KiB
VimL
Raw Permalink Normal View History

2022-01-12 04:23:30 +00:00
" Lines number
set number
" Always show the statusline
set laststatus=2
" Necessary to show Unicode glyphs
set encoding=utf8
" smart tab
set smartindent
" Tab to..?
set shiftround
" Display edition mode
set showmode
" Ignore case in search mode
set ignorecase
" Override the 'ignorecase' option if the search pattern
" contains upper case characters.
set smartcase
" Display uncomplete commands (??)
set showcmd
" Vim file name completion relative to current file
set autochdir
" While typing a search command, show immediately where the
" so far typed pattern matches.
set incsearch
" Use <C-L> to clear the highlighting of :set hlsearch.
set hlsearch
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
endif
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc,*.swp
" Wrap lines
set wrap
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set noswapfile
" Having relative number for lines
set relativenumber
" Display tab and ends of lines
" Shortcut to rapidly toggle `set list`
nmap <leader>L :set list!<CR>
" Behaviour of tab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Folding
set foldmethod=indent
" Use the same symbols as TextMate for tabstops and EOLs
" set listchars=tab:▸\ ,eol:¬
set listchars=nbsp,tab:··,trail,extends:▶,precedes:◀
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
"
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Decorations
" ====================
" 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
endif
" When set to "dark", Vim will try to use colors that look
" good on a dark background. When set to "light", Vim will
" try to use colors that look good on a light background.
" Any other value is illegal.
set background=dark
" Color Scheme
colorscheme zenburn
set cursorline
" Align blocks of text and keep them selected
vmap < <gv
vmap > >gv
" Spelling
" set spelllang=fr
autocmd BufRead,BufNewFile *.{md,tex,rst} setlocal spell spelllang=fr
autocmd FileType tex,latex,markdown,md,rst setlocal spell spelllang=fr
" Remove trailing whitespace at the end of lines
autocmd BufWritePre * %s/\s\+$//e
" Different color for far columns
execute "set colorcolumn=" . join(range(81,335), ',')