Enrico Boldori / Wiki

« Go back ⤓ Download

Linux - .vimrc.txt

set nocompatible

"----------------------------------------
" Vim-Plug initialization
"----------------------------------------

if empty(glob('~/.vim/autoload/plug.vim'))
	silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
	autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin('~/.vim/plugged')
	Plug 'itchyny/lightline.vim'
	Plug 'itchyny/vim-gitbranch'
call plug#end()

" Show current git branch inside lightline
let g:lightline = {
	\ 'active': {
	\   'left': [ [ 'mode', 'paste' ],
	\             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
	\ },
	\ 'component_function': {
	\   'gitbranch': 'gitbranch#name'
	\ },
	\ }

" -- INSERT -- is unnecessary anymore because the mode information is displayed in the statusline.
set noshowmode

"----------------------------------------
" Other settings
"----------------------------------------

set encoding=utf-8                                      " encoding

set background=dark                                     " otherwise you can't read the comments...

set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround                                          " indent always with a multiple of shiftwidth
set autoindent

set hidden                                              " hides buffers instead of closing them
set backspace=indent,eol,start                          " allow backspacing over everything in insert mode

set number                                              " show line numbers
set showmatch                                           " show matching parenthesis
set ignorecase                                          " ignore case when searching
set smartcase                                           " ignore case if search pattern is all lowercase, case sensitive otherwise
set hlsearch                                            " highlight search matches
set incsearch                                           " search as-you-type

set history=1000                                        " remember more commands and search history
set undolevels=1000                                     " everybody screws up sometimes
set visualbell                                          " don't beep
set noerrorbells                                        " again, don't beep

set title                                               " change the terminal title
set term=xterm-256color                                 " tmux and vim do not play nicely without this setting

set nobackup                                            " there are better ways to protect against data loss
set noswapfile                                          " see before

set showcmd                                             " show (partial) command in status line
set laststatus=2                                        " always display status line
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')}

set matchpairs+=<:>                                     " highlight matching pairs of chars. Use the '%' character to jump between them

set paste                                               " activate paste mode by default